G
G
grafchitaru2020-04-28 07:44:29
linux
grafchitaru, 2020-04-28 07:44:29

How to make the server skip more than 1024 connections at the same time?

When testing the load on the server, errors constantly fall out if you set more than 1024 simultaneous connections (ab -c 2000 -n 2000 https://site_address):
apr_socket_recv: Connection reset by peer (104)
Total of 110 requests completed
On this the operation is interrupted.
I can't find anything in the logs.
Increased limits wherever possible.
When viewing htop, the load is small.
I need to configure the server in such a way that 2000-4000 people can be on the site at the same time.

Configuration:
Debian GNU/Linux 9
Intel® Xeon® 2 vCPU core
SSD
RAM 8 GB
nginx/1.16.1

Answer the question

In order to leave comments, you need to log in

1 answer(s)
V
Vladimir Korotenko, 2020-04-28
@grafchitaru

https://www.monitis.com/blog/6-best-practices-for-...
https://www.nginx.com/blog/tuning-nginx/


2. Maximize worker_connections
Worker connections tells worker processes how many clients can be served simultaneously by Nginx. The default value for this is 768 but it's important to keep in mind that each browser will usually open at least 2 server connections. The maximum number for the worker connections setting is 1024 and it's best to use this to get the full potential from Nginx. On this basis then, assuming 1 core for each worker process, setting worker_connections to 1024 implies that Nginx can serve 1024 clients/second.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question