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 http://192.168.10.38:8002/index.html

During the test, the machine pressure is as follows
Nginx under docker
TB2ANqstVXXXXXYXpXXXXXXXXXX-490506202.jpg

Nginx under Host

clipboard.png

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.