php-fpm81 get stuck / big load - server very slow / php-fpm: pool admin

websterPL

Verified User
Joined
Oct 7, 2021
Messages
102
Hello, I have problem with php-fpm81. The pages is very slow. Also server is stuck multiple times in a week.

After restarting the service system works fast but after just few seconds memory usage is very big (~1.5 GB). Also there is a lot of PIDs (processes) attached to php-fpm81. I have another servers with DA and there is no problem with that.

The system have one default user who have just 19 domains and 19 databases (Joomla 4 portals with cache on).

I already set Cron to restart php-fpm81 and httpd for each hour however that is not solution.

The server is new DELL (x2 POWEREDGE R550) dedicated in client infrastructure. Ubuntu 22.04.1 LTS (Jammy Jellyfish). Firewall is ON, also ClamAV is on.

CPU showing 400%-800% usage. Total RAM is 49 GB / Free 1 GB / Cached 42 GB. Server load averange is ~10%.

Also in process monitor there a lot "php-fpm: pool admin" processes with high CPU usage.

For statistic we have Webalizer and AWStats. Daily Avg for Sep 2023 is 9540 visits.

With this server the pages should load in blink of eye. Sometimes it works very fast but only sometimes.

What should I do to make server work fast without overload stuck ?
 

Attachments

  • Screenshot.png
    Screenshot.png
    41.9 KB · Views: 185
  • Screenshot2.png
    Screenshot2.png
    46.4 KB · Views: 152
  • Screenshot 3.png
    Screenshot 3.png
    33.1 KB · Views: 152
  • Screenshot 4.png
    Screenshot 4.png
    10.8 KB · Views: 146
  • Screenshot 5.png
    Screenshot 5.png
    31.8 KB · Views: 141
  • Screenshot 6.png
    Screenshot 6.png
    48 KB · Views: 152
Sounds like some system tuning needs to be done, probably getting held up on SQL queries.

I would start with checking MySQL/MariaDB with MySQLTuner


It will give you recommendations to make to your my.cnf
 
Total RAM is 49 GB / Free 1 GB / Cached 42 GB
Almost all RAM cached (not actively used) you can tune mysql as cjd recommends to speed it up, also you maybe using default php-fpm child limit - for such load you need to increase it, but better check php-fpm log.
Also adding nginx in front of apache can make it faster if you have a lot of static content (pictures, styles, etc.)
 
Any site using persistant connection on backend ? like mysql, redis ..etc..
 
Thanks for any sugestions but the problem was generated by bots with mod_security set to OWASP. When I changed that to Comodo (and made some small SQL fixes) - the sites is rocket now. Also dont forget to turn ON cache in J4 CMS.
 
Last edited:
So, the server is working fast BUT I must restart php-fpm81 averangely one time a day because server stop answering. php-fpm81 gets 1.5GB and stop working - any idea how to resolve this problem ? Also php-fpm81 gets very fast > 1.4 GB (couple of seconds).
 
Guys - is this possible to restart automatically php-fpm81 when server is detected as DOWN (Connection Timeout) ? I still dont know why server is going DOWN, only restart php service resolve this state - for couple of hours. The best approach will be execute restart commad by URL and php file.
 
@websterPL you can add cron script to monitor service status and restart it, hardest thing is how to check if service really stuck.
 
Exactly - when server is stuck - all services in monitor are running (green status) but external monitor push notification abour server is DOWN.
 
@websterPL that's why you need to find/write some local script which will CURL/HEAD local website and if it not return http200 answer - restart php-fpm. You can ask ChatGPT or google for ready solutions
 
Does DirectAdmin allow to execute PHP script like <?php shell_exec("restart php-fpm81' > /dev/null 2>&1 &"); ?>
 
Back
Top