× English Section!

We will be more than happy to help you with problems related to our services and products. Please feel free to write it down as clear as possible

How to fix the "Resource temporarily unavailable" error in nginx?

Περισσότερα
3 Μήνες 3 Εβδομάδες πριν - 3 Μήνες 3 Εβδομάδες πριν #292 από infogate
This tutorial discusses using nginx + php-fpm (at the time of writing, the PHP version was 7.4).

If you experience the problem that when there is a small load on the server, all sites suddenly start to give a 502 Bad Gateway error. In the logs, you may see something like:

[error] 7460#7460: *5365312 connect() to unix:/run/php/php7.4-fpm.sock failed (11: Resource temporarily unavailable) while connecting to upstream

This situation occurs because the operating system rejects attempts by nginx to connect to the Unix socket. The reason may be that the maximum number of connections to the socket has been exceeded, or the maximum number of unprocessed connections to the socket has been reached.

To check the limits, run:

sysctl net.core

Look for the following lines:

net.core.somaxconn = 128
net.core.netdev_max_backlog = 200

The error occurs because the maximum number of connections is 128, while the maximum number of unprocessed connections is 200.

To change the limits, change the following lines to the /etc/sysctl.conf file:

net.core.somaxconn = 20000
net.core.netdev_max_backlog = 65535

Apply the parameters by running:

sysctl -p

Restart php-fpm:

/etc/init.d/php7.4-fpm restart
or better to CWP7...
systemctl restart php-fpm74

Use the loadem utility to test your site with the new configuration:

./loadem -l 1 mysite.com 200

URL: mysite.com
Clients: 2000
Starting
MaTps 7.81, Tps 7.81, Err 0.00%, Resp Time 0.966

Completed 8 requests in 1.03 seconds
Total TPS: 7.74
Avg. Response time: 0.966
Max Response time: 1.064


The best possible way to start your online marketing : fspirits.com/go/leadsleap-home
Explode Your Web Site Traffice: fspirits.com/go/sparktraffic
Start your affiliate journey here: fspirits.com/go/olsp-academy
Best Solution To Create Videos: fspirits.com/go/create-studio-pro
Best Solution To Create Graphics: fspirits.com/go/clickdesigns
Smart Chat Automation: fspirits.com/go/chatterpal
Multi-Purpose Video Maker: fspirits.com/go/avatar-builder
Multi-Purpose Video Creator: fspirits.com/go/video-creator
AI Human Spokesperson Videos: fspirits.com/go/humanpal

Last edit: 3 Μήνες 3 Εβδομάδες πριν by infogate.

Παρακαλούμε Σύνδεση ή Δημιουργία λογαριασμού για να συμμετάσχετε στη συζήτηση.

Χρόνος δημιουργίας σελίδας: 0.073 δευτερόλεπτα
Powered by Kunena Φόρουμ