Weird PHP7 FPM Issue

If you running PHP7 on Linux and encounter any of these following messages in your access or FPM logs:

[error] 7050#0: *29232 connect() to unix:/run/php/php7.0-fpm.sock failed (11: Resource temporarily unavailable) while connecting to upstream

WARNING: [pool www] server reached pm.max_children setting (5), consider raising it

resulting in a 502 Bad Gateway page then this might be for you.

@akuzemchak and I discovered that the backlog.listen setting for PHP7 (511) is set MUCH lower than the defaultin PHP5 (65535) resulting in PHP-FPM throwing away back-logged connections much sooner then what we would expecting coming from the PHP5 world.

If you edit your /etc/php/7.0/fpm/pool.d/www.conf file and raise the backlog.listen setting to something closer to the PHP5 default you'll see those errors go away and PHP-FPM queue the back-logged connection and handle it later.

What impact does this have on PHP7 and your system? I have no idea, maybe someone who knows more about this can provide some light?

Hit me up at @danalloway if this post has helped you in anyway.