Home  >  Q&A  >  body text

nginx - About using ab to test docker and problems caused by this machine

First prove that it can be accessed

192.168.99.100 is docker’s
127.0.0.1:9889 is local

Test command ab -c 100 -n 100000 http://xxx

Test nginx display html
worker: 1 worker
cpu: one core
men:1G
Environment: docker (ubuntu 16)



The second time (nginx.conf is the same as above)
Test nginx to display html
worker: 1 worker
cpu: quad core
men:8G
Environment: local (Mac)


The third time (except worker_processes=4;nginx.conf configuration is the same as above)
Test nginx to display html
worker: 4 workers
cpu: quad core
men:8G
Environment :Local (Mac)


Change the number of commands to 1W

Why is the container's processing power higher than that of the local machine? Even if I open phpStorm, qq, chrome, etc. locally, the gap will not be that big. Can you analyze the reason? Another question is why the cpu is accessed Is it basically used by most kernels?

PHP中文网PHP中文网2677 days ago749

reply all(1)I'll reply

  • 伊谢尔伦

    伊谢尔伦2017-05-24 11:33:48

    1.ab simulation is all about running threads and consuming system resources, most of which are used to run threads.
    2. Why can’t I see which one has higher performance? Such test data are all misunderstandings.

    reply
    0
  • Cancelreply