Skip to main content

PHP-FPM Stuck: FCGI: attempt to connect to Unix domain socket

Comments

7 comments

  • cPRex Jurassic Moderator
    Hey there! Can you run this command on the server and see if Apache is restarting frequently? grep Graceful /etc/apache2/logs/error_log
    0
  • AusWP
    Hey there! Can you run this command on the server and see if Apache is restarting frequently? grep Graceful /etc/apache2/logs/error_log

    Thanks, tried that but nothing recently showing (all over a year ago).
    0
  • cPRex Jurassic Moderator
    Thanks for checking that. That was the only thought I had, so it might be best to submit a ticket as that is a generic PHP-FPM/Apache error that can have many causes. If you are able to submit a ticket to us, please post the number here so I can follow along.
    0
  • AusWP
    Thanks it's #95107922
    0
  • cPRex Jurassic Moderator
    Thanks - I'm following along with that now!
    0
  • cPRex Jurassic Moderator
    It seems one of the sites on the server was frequently hitting the max_children setting, causing the PHP-FPM issues.
    0
  • AusWP
    For those getting the same issue you can diagnose the max_children issue by checking over the different php-fpm logs based on the PHP version. grep max_children /opt/cpanel/ea-php80/root/usr/var/log/php-fpm/error.log
    It can be quicker only going over the last x line using something like tail -n 5000 /opt/cpanel/ea-php80/root/usr/var/log/php-fpm/error.log | grep max_children
    Now you can certainly increase the amount of workers available to PHP-FPM which we did but as Apache limits are server wide getting heavy load to 1 or more sites could cause the issues we had. I couldn't really get an answer on why this is happening or which part of the chain is failing but either PHP-FPM to stops responding or the connection using fastcgi is failing. Restarting the PHP-FPM service does resolve the problem but I'd rather it not exist in the first place. Based on this we decided to test out LSAPI which is nice as you can use is alongside PHP-FPM so it's not an all or nothing change. We did tweak a few LSAPI settings to accommodate single site heavy load but the move to LSAPI has solved the problem (so far). Not knowing if this could still occur we are planning some load testing to see if we can also cause LSAPI to crash under similar circumstances. TL;DR: Allocate PHP-FPM more children, because this doesn't limit usage it could cause issues still under heavy load. OR switch to another PHP service like LSAPI or even Lightspeed web server.
    0

Please sign in to leave a comment.