Answer the question
In order to leave comments, you need to log in
How to fix 502 Bad Gateway when sending an email?
Hello. I ran into a problem that when sending a letter I get a 502 error
when I send html, that is,
But I don’t get an error when sending raw text, like this
Error logs:Mail::send('view', $data, $callback);
Mail::raw('Some text', $callback);
*20639 recv() failed (104: Connection reset by peer) while reading response header from upstream,
upstream: "fastcgi://unix:/var/run/php-fpm/php-fpm.sock:"
WARNING: [pool site.com] child 16813 exited on signal 11 (SIGSEGV) after 51.029643 seconds from start
Answer the question
In order to leave comments, you need to log in
Falls off on timeout.
Set up your email provider.
If this is not a local provider, then use queues and send emails from background processes.
Adjust the server to use less memory. In your "dmesg | tail" you can clearly see that the server is killing processes because it runs out of memory.
Solutions include:
- decreasing pm.max_children in the PHP-FPM settings
- allocating a larger swap file
- decreasing the size of MySQL buffers. In general,
the most basic setting So you can wait for any problems here before the problem of lack of memory is not solved.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question