Answer the question
In order to leave comments, you need to log in
What can cause a 502 error?
Hello everyone, I'm trying to figure out why the site knocks out a 502 error.
The site sells digital goods, there are more than 1k items in the product table (MySQL database), when buying and adding to the cart, the availability is recalculated with an entry in memcached.
There are plenty of resources on the server, according to digitalocean analytics (peak about 7% percent and RAM).
All pages of the site fly, are
given in 50-70ms, but sometimes the user throws out a 502 nginx error
Tell me where to dig to start, what and how to log, maybe there are relevant articles
I suspect a problem in the database, since the problem was discovered
recently
4 times
- indexing was done
- when updating the availability, many requests are made, maybe there is some kind of block xs
In this case, a beginner, but there are no other hands now
UDP
in the nginx / errors logs, such an error pops up
connect() to unix:/var/run/php/php7.4-fpm.sock failed (2: No such file or directory) while connecting to upstream
Answer the question
In order to leave comments, you need to log in
HTTP 502 is Bad Gateway. As you can see from the description , this means that the proxy (in your case, I will assume nginx) cannot receive a response from the upstream (php-fpm in your case). The text of an error resulted by you directly confirms it.
From this we can draw the first conclusion: php-fpm processes disappear somewhere. Since php-fpm worker processes restart the main php-fpm process even when it crashes, a few initial assumptions can be made offhand:
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question