A
A
alekssamos2019-11-07 18:37:50
PHP
alekssamos, 2019-11-07 18:37:50

Why 502 Bad Gateway?

There was Apache prefork, there was not enough memory under huge loads, I installed nginx + php 7.2 fpm.
Now the server waits a long time without responding and then issues a 502 Bad Gateway.
All default settings installed via apt-get.
Scripts run for a long time, 10 seconds, photos are processed, several thousand requests per second.
Apache worked well, but crashed at peak load. So I decided to replace it.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
G
grinat, 2019-11-07
@alekssamos

If fpm does not seem to have enough workers, increase their number in the fpm config. In any case, the 502 error is not because nginx has crashed, but because the third-party application has not responded, in your case it's puff.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question