• If you are still using CentOS 7.9, it's time to convert to Alma 8 with the free centos2alma tool by Plesk or Plesk Migrator. Please let us know your experiences or concerns in this thread:
    CentOS2Alma discussion

Question Getting regular spikes in Apache & php-fpm memory usage for some reason?

PortMacOnline

New Pleskian
Hi all,
I have been using computers since 1985, but a noob with Plesk, so please be gentle! :)

I have a Vultr server (2 gb, 1vCPU) running Ubuntu 18.04/Plesk Obsidian to manage at present 11 WP small business websites.

Over a 24 hour period the memory usage is usually only around 20-25%, but I am getting warnings on a regular basis that the "Apache and php-fpm memory usage is critical" then a few minutes later it is okay again.

Looking at the Advanced Monitor, the problem seems to be sw_mem-Web:ps_rss:Value which is using up to 800MB of memory in a very short time, then dropping it. But I have NO idea what this process is, or why it is using up so much memory so quickly, so less than no idea how to fix the problem. Any suggestions, beyond RTFM?

Cheers,
Terry Chadban
 
There might be nothing wrong, these alerts are more or less of an informative nature. Not that they aren't real, it just that they are too vague to be solely relied upon.

You'll have to resort to additional tools to get more information. Take a peek into the site and server logs to see what's happening when these surges happen, refer to tools such as top or htop and sysstat, etc..

I'd be looking at the web site traffic first, either legitimate or some bot activity.
 
@Ales, thanks for the input, but I have eleven websites on the server, so a lot of site/server logs to check when I don't even know what I am supposed to be looking for! I will check out your suggestions for tools, but when I get a warning marked 'Critical', I don't think it is too much to ask for Plesk to give me a bit more information?

Looking at the timing, there is no regular pattern, so I think we can rule out a cron job, but the worrying thing is that the warnings are getting more frequent.

Cheers,
Terry Chadban
 
When the issue occurs, run
# watch "ps aux | sort -nrk 3,3 | head -n 20"
to watch live where all the cpu power goes.

You can also simply run
# ps aux | grep httpd
and then strace the process with an abnormally high cpu usage to find out more about what it is doing.
# strace -p <pid>

Anyway, I'd also say that checking the log files is the best approach, because you know the time and date when the issue occured, and eleven sites is "nothing", can be quickly checked.
 
When the issue occurs, run
.......

Anyway, I'd also say that checking the log files is the best approach, because you know the time and date when the issue occured, and eleven sites is "nothing", can be quickly checked.

Thanks for that @Peter Debik, but I don't spend 24 hours a day monitoring the server, that is why I bought Plesk! :)

I will try checking the logs as you suggest, but the only reason I have an approximate idea of the time that the memory spiked is from the usage graphs when I check the dashboard in the morning. That doesn't tell me which domain or process is causing the spike. Still it is better than nothing I guess, and gives me a rough idea of where to start.

Cheers,
Terry Chadban
 
Back
Top