G
G
GogenZZo2017-10-23 17:31:38
Nginx
GogenZZo, 2017-10-23 17:31:38

A large number of sites on nginx?

There are 200 domains on a dedicated server, which are processed by 1 script. When adding another 200 domains, nginx does not start 24: Too many open files pointing to the line with the logs in the nginx settings
Tried to change ulimits , but to no avail. Specified a file with errors and logs for 400 domains all in one to write, nginx starts, but the sites do not load, error 500 timeout

Answer the question

In order to leave comments, you need to log in

2 answer(s)
P
Puma Thailand, 2017-10-23
@opium

The system ulimit was not raised once, if you run nginx through systemd, then you must also raise the ulimit in the initialization script. Well, you need open files in the nginx config

M
Mikhail Grigoriev, 2017-10-24
@Sleuthhound

In the server console:
Check soft limit:
# ulimit -Sn
Check hard limit :
# ulimit
-Hn : In the file /etc/security/limits.conf we add: * soft nofile 65525 * hard nofile 100000 nginx hard nofile 65000 Now we change the limits in nginx, for this in the file /etc/nginx/nginx.conf at the very beginning, approximately after the lines user www-data; worker_processes auto; write worker_rlimit_nofile 65000; In console: # nginx -t && nginx -s reload

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question