Home  >  Q&A  >  body text

关于docker下的nginx压力测试

背景环境,在docker官网拉取了ngingx:1.11.1的版本镜像,启动一个容器进程。
本地宿主机用yum安装了nginx 1.11.3的版本
两个配置是一样的

worker_processes  4;

error_log  /var/log/nginx/error.log warn;
pid        /var/run/nginx.pid;


events {
    worker_connections  10240;
}

然后用ab工具分别对两个nginx压力测试
3台,共6W并发

ab -c 20000 -n 400000 -r http://192.168.10.38:8002/index.html

测试时,机器压力如下
docker下的nginx

宿主机下的nginx

安装nginx和docker下的nginx的性能还是差的比较多呢?

天蓬老师天蓬老师2708 days ago701

reply all(2)I'll reply

  • 迷茫

    迷茫2017-04-24 16:02:28

    Try adding --net=host when running docker and test again to see if it is caused by the docker virtual network

    reply
    0
  • 習慣沉默

    習慣沉默2017-04-24 16:02:28

    I also encountered the same problem. do not know why.

    reply
    0
  • Cancelreply