CPU: Intel(R) Core(TM) i7-7700K CPU @ 4.20GHz (8 core(s))
OS: AlmaLinux 9.4 (Seafoam Ocelot)
Product: Plesk Obsidian Version 18.0.62 Update #2, last updated on July 25, 2024 03:27 AM
I am running two active wordpress+woo websites in separate subscriptions that get 50-100 real visitors per month, so really not that many, and some trial installations of wordpress, woo and joomla in other subscriptions with practically no visitors. However, I observe a very similar problem which started around April this year:
My CPU is typically running at 20-30% with less than 5% from the system and all the rest from domains. In the process list I see regularly 10-15 php-fpm processes only from the users of the two active subscriptions each using 2-5% of CPU. These processes don't run continously but get cancelled and new ones are starting with the same users.
Now, since April I had almost daily periods of up to one hour with a steap increase in the CPU usage by these processes that occassionally led to downtime of those domains sometimes affecting also other domains. In order to control this problem, I started implementing certain safety measures - my incoming emails are pre-filtered by an external server, my http and https requested are going through cloudflare, the PLESK firewall blocks all http and https access except for cloudflare (with the exception of access to the PLESK admin panel on HTTP/3) and all SMTP requests except from the external server that pre-filters my incoming email. Fail2Ban is enabled and Apache ModSecurity 2.9 runs on Comodo rules. I believe this is a pretty safe setup. Since then I observed in fact a fewer such steap increases but they do still happen. So, obviously, a part of the problem was also illegitimate server access.
Now, I have applied the checks proposed in this thread to rule out any server-external sources. I found that I have no surprising bots or hackers or whatever accessing my server, i.e. the above mentioned measures are effective. Also, I observed no particularly increase in I/O data flow. Since only the active websites show high CPU usage, I conclude - like some of the others above in their particular cases - that the problem is caused by php processes on the server which are triggered by legimite user access on the website but generate exceptional irregularly high CPU usage.
Does anyone have suggestions how to dig deeper into that problem to identify the real root cause and to eliminate it? Thanks a lot!