On nginx Pressure Test under docker

  docker, question

In the background environment, a version image of ngingx:1.11.1 was pulled from docker’s website to start a container process.
The local host has installed NGINX version 1.11.3 with yum
The two configurations are the same

worker_processes  4;
 error_log  /var/log/nginx/error.log warn;
 pid        /var/run/nginx.pid;
 events {
 worker_connections  10240;

Then use ab tool to test the pressure of two nginx respectively.
3 sets, totally 6W concurrent

ab -c 20000 -n 400000 -r

During the test, the machine pressure is as follows
Nginx under docker

Nginx under Host


The performance of nginx installed under nginx and docker is still much worse?

Try adding –net=host when docker run, and check again to see if it is caused by dockervirtual network.