Hello everyone, I face an issue on fpm. I have a vps with 4 wordpress websites. Whenever in any of them I try to make a process, like a wp all import update or even on some plugin installation and customizing, the cpu goes 100% and everything crashes. I tried 7.4 and 8.2 php but still no luck. Played a bit with fpm configurations but still. My latest configurations are these below. Do you have any suggestions? I am kinda stuck.
pm = dynamic
pm.max_children = 16
pm.start_servers = 2
pm.min_spare_servers = 1
pm.max_spare_servers = 8
| SYSTEM INFORMATION||
Cores 4
Ram 8GB
|------------------------------|-------------------------------|
| OS type and version | AlmaLinux 8.8 |
| Webmin version | 2.101 |
| Virtualmin version | 7.8.2 |
| Usermin version | 2.001 |
I use this in my template, reduce ram usage as its ondemand.
pm = ondemand
pm.max_children = 40
pm.process_idle_timeout = 10s
pm.max_requests = 200
You will need to disable and enable php on each server to effect that virtualserver,
Does the CPU stay at 100% ? (seems like a process hanging)
Is this some poorly designed request on the database?
PHP logs should give a better idea of the cause.
system logs?
I’m assuming these updates are WP related. Not system (OS) updates as these do use CPU but shouldn’t crash the system. Really need to narrow down the actual action that crashes the system.
At least it returns to a steady state (is that on a reboot?)
Well, the php error logs dont have much info to tell. Usually I get either a 500 error or the sites in server gets ridicously slowed. Most of the times I have to restart the server or fpm or stop the process I am doing (Let’s say wp all import) before the cpu comes back to normal ( usually takes time). This is for example the fpm logs when wp all import is running. Screenshot by Lightshot
Cant find anything usefull in system and php logs at all.
Thank you Stefan. Not much of difference though. Any other suggestions?
Really, does restarting the php service see a big drop of ram usage?. I only have 4gig of ram and alot more wordpress websites and my ram is 40-50%.
I think your issue is something else.
BTW my config look like this after the disable and enable of php.
My bets are still on some wp action that is hanging the database (despite not showing as a 500 error).
If you do not do the “wp all import” I assume nothing happens and no CPU overload.
Rather than a “wp all import” can you do a “wp specific import” to narrow it down to a specific update. IIRC all import updates the core + themes + plugins - everything. That could be quite a lot of interactions (potential clashes).
Actually it is not a ram issue. Ram is in good levels, the issue in is cpu that gets overloaded.
Yes, if no actions are happening, the cpu levels are very low. By wp all import plugin I update or import products in the website. But I had similar issue with other wordpress sites and other actions. Like installing and change settings in another plugin.
Opps sorry, i’m on the wrong path.
The GUI if you click on the CPU monitor it should show you what using so much CPU, or TOP in the terminal. I’ve never had CPU high usage with WP (not that i’ve noticed anyway)
Definitely not a Webmin/Virtualmin issue then. It is only when you go into WP that it becomes a problem.
I’m sorry I’m always very negative about WP (there are good reasons to be - too many half-baked cooks boiling a can of worms) but you have to try to narrow it down to a single plugin/theme being updated. - the core is pretty solid and I am also pretty sure it can be updated on its own.
narrowing it down could be a long task, especially without PHP logs.
As I am thinking this may have something to do with the database - is there anything in the MariaDB log (around the time of the CPU going up) though if this is also happening with small changes in settings/configuration then less likely.
Well it seems you are right. It was an issue caused by a caching plugin. I will make some more checks and come back to inform the forum.
Thanks a lot for your time.
In such situations, the faster you isolate the problem, the more you identify the cause. WP has a lot of plugins with issues.
Look at your app. PHP-FPM doesn’t consume 100% of CPU, apps do.
This topic was automatically closed 60 days after the last reply. New replies are no longer allowed.