Docker Community Forums

Share and learn in the Docker community.

Significant throughput drop in Java Program

Hi everyone!,

I recently noticed a significant throughput drop when runnning a simple Java program in a Docker container on Docker desktop for Mac.

Issue type - Performance issue
OS Version/build - Mac OS Mojave 10.14.6 (18G3020)
App version - Docker Desktop for Mac 2.1.0.5 (40693)
Steps to reproduce - Given in the medium article linked in this post below

All the details about the problem can be found in the following medium article, including steps to reproduce it.

I executed a simple Java echo service to test this and ran it natively on the OS and inside a Docker container and compared the throughput. The service and the JMeter client ran on the same MacBook. The throughput results are as follows.
1.Netty echo service on Mac OS natively — 68693 requests/second
2. Netty echo service in a Docker container on Mac OS— 6222 requests/second

As you can see there is a significant drop in throughput when executing the service inside a Docker container.

Then I ran the same tests on two Linux machines. The services ran on one while the JMeter client ran on the other. The throughput results are as follows.
1.Netty echo service on Ubuntu natively — 25254 requests/seconds
2. Netty echo service in a Docker container on Ubuntu — 23210 requests/seconds

This time the performance drop is not that significant.

I have been unable to figure out what is causing this performance degradation. Can someone please help me to understand and correct this issue?