How to set maximum queue connection for nginx port

2019-09-20 08:39发布

问题:

I am learning to design scalable system, for now using Windows machine. I created two servers that will listen to port 27016 and 27015, all they do is return "HelloWorld!" response. I had set listen(ListenSocket, SOMAXCONN) for both the servers when creating them in Visual studio following Winsock tutorial. Using jmter performed load test on each of them individually (1000 request per sec) and got everything OK.

Now when I introduced nginx which is listening to port 80 and load balancing the requests (1000 req per sec) among the two servers I mentioned above, many requests are being dropped down while performing load test using jmeter.

I am assuming that queue size for port 80 is not configured for high traffic and want to tune it. How to set the queue size to maximum possible value either from nginx config or cmd command?

回答1:

Even though increasing queue size did not fix my problem the way to increase queue size is modifying backlog value, example

listen       server_port backlog=queue_size;