Jump to content

Random 502 from php7-fpm


Recommended Posts

Hi,

My server receives random 502 bad gateway almost every hour. I've been trying to figure this one out for almost two weeks but I cannot seem to solve it.

Max children isn't reached once since yesterday, but I know of multiple incidents of 502 since yesterday. Do you have any ideas? Any help is deeply appreciated.

fpm status report:

pool:                 www
process manager:      dynamic
start time:           15/Nov/2016:06:40:08 -0500
start since:          121517
accepted conn:        349082
listen queue:         0
max listen queue:     0
listen queue len:     0
idle processes:       25
active processes:     2
total processes:      27
max active processes: 8
max children reached: 0
slow requests:        0


I run ubuntu 14.04.5 LTS, nginx 1.4.6, php 7.0.12-1. 4 core Cpu, 8 gb ram. SSD drive.
Link to comment
Share on other sites

This sounds like an issue linked to running php-fpm in Unix socket mode rather than in TCP/IP mode (in the latter mode, it'll listen at an IP address and port number like 127.0.0.1:8000). php-fpm handles significant traffic more gracefully in TCP/IP mode. Your syslog, php-fpm, and nginx error logs may have details on the cause, too, if you haven't already checked them.

If your php-fpm is configured in socket mode, try changing that to TCP/IP mode. To do that, modify the "listen" setting in the fpm pool configuration (it's probably located in /etc/php/7.0/fpm/pool.d/www.conf) - there should be a comment in the file that explains what to set it to. Remember to also update your nginx configuration to refer to the IP+port after instead of the socket after changing this.

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...