502 Bad Gateway while writing to DB

Hi all,

I am running a script called cpvlab on a DO server and it started to give me 502 Bad Gateway errors when I write info to the DB. It happens 1 out of 5 times or so …

I’ve searched high and low for the cause, but can’t find it … anyone have an idea ?

NGINX - /var/www/mydomain/logs/error.log

2018/01/05 12:28:53 [error] 1719#0: *139 recv() failed (104: Connection reset by peer) while reading response header from upstream, client:, server: mydomain.com, request: “POST /direct-and-landing-campaign.php?id=2 HTTP/1.1”, upstream: “fastcgi://”, host: “mydomain.com”, referrer: “http://mydomain.com/direct-and-landing-campaign.php?id=2

PHP-FPM - /var/logs/fpm.log (some kind of loop ?)

[05-Jan-2018 11:55:26] NOTICE: exiting, bye-bye! [05-Jan-2018 11:55:40] NOTICE: fpm is running, pid 1510 [05-Jan-2018 11:55:40] NOTICE: ready to handle connections [05-Jan-2018 11:55:40] NOTICE: systemd monitor interval set to 10000ms [05-Jan-2018 12:11:40] WARNING: [pool www] child 2255 exited on signal 11 (SIGSEGV - core dumped) after 0.332833 seconds from start [05-Jan-2018 12:11:40] NOTICE: [pool www] child 2257 started [05-Jan-2018 12:25:29] WARNING: [pool www] child 2744 exited on signal 11 (SIGSEGV - core dumped) after 0.380919 seconds from start [05-Jan-2018 12:25:29] NOTICE: [pool www] child 2746 started [05-Jan-2018 12:28:53] WARNING: [pool www] child 2804 exited on signal 11 (SIGSEGV - core dumped) after 0.259890 seconds from start [05-Jan-2018 12:28:53] NOTICE: [pool www] child 2806 started