Home  >  Q&A  >  body text

In the worker_connections configuration in the nginx configuration, the larger I set it, the slower it feels?

My server configuration is as follows

1. When I set worker_connections 1024; I used webbench to do stress testing, and the data returned was like this!

2. When I set worker_connections 10240; I used webbench to do stress testing, and the returned data is like this!

To summarize, it feels like the speed has dropped by 4 times

Can someone help me analyze it?

PHP中文网PHP中文网2691 days ago935

reply all(4)I'll reply

  • 巴扎黑

    巴扎黑2017-06-06 09:56:32

    If no error is reported, it is best to make worker_processes*worker_connections/4 smaller than the total number of files opened by system processes

    reply
    0
  • 伊谢尔伦

    伊谢尔伦2017-06-06 09:56:32

    Thanks for the invitation!

    Please read the article in detail
    http://liuqunying.blog.51cto....

    reply
    0
  • 漂亮男人

    漂亮男人2017-06-06 09:56:32

    ulimit -n What is it?
    If not, set it up
    ulimit -n 65535

    reply
    0
  • 淡淡烟草味

    淡淡烟草味2017-06-06 09:56:32

    There may be something wrong with your test result

    Calculate, the single page sizes for the two requests are:
    41381 bytes/sec * 60 / 31234 pages/min = 80 bytes/page
    10556 bytes/sec * 60 / 1607 pages/min = 394 bytes/page

    If the two tests are on the same page, it is obvious that many requests are abnormal.

    So, you have to check if there is anything wrong with the testing method first.

    reply
    0
  • Cancelreply