The server with Debian has nginx/1.23.1 and php7.1-fpm. At times of peak loads, sometimes errors like:
2023/10/23 19:02:25 [error] 30071#30071: *18086042 connect() to unix:/run/php/php7.1-fpm-domain.pro.sock failed (11: Resource temporarily unavailable) while connecting to upstream, client: 1.2.3.4, server: domain.pro, request: "GET /url HTTP/2.0", upstream: "fastcgi://unix:/run/php/php7.1-fpm-domain.pro.sock:", host: "domain.pro", referrer: "https://yandex.ru/"
In /etc/sysctl.conf I set
net.core.somaxconn = 20000
net.core.netdev_max_backlog = 65535
before that it was 128 and 200, respectively. But a week later these errors appeared again, restarting nginx and php-fpm helps. What else can be done to avoid these errors, since the site is not accessible and a 502 error is displayed? The variables above were increased by another 2 times.