• 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

Resolved Apache consuming RAM and not releasing until traffic slows down

Bart Marek

New Pleskian
1vnr2

Just wondering is someone seen situation like that. When the server hits high number of visitors Apache starts to consume RAM and not release it. So in a few hours it consumes all available RAM. I have absorved it for few years now, and just wonder if PLESK just can not handle that much traffic or it is just miss-configuration of the Apache. I'm attaching screenshots of that incident.
JustPaste.it - Share Text & Images the Easy Way
 
It should not be a big problem as part of the RAM might not be "in use" and could be requested by other applications. What you should do in such a situation is to look into the process list, e.g. on Debian
# ps aux | grep apache2
or on RHEL/Centos
# ps aux | grep httpd
and check the real RAM usage of the processes there. It should not be very high. If it is, you could use
# strace -p <pid>
with "<pid>" being the process ID of the Apache process that is using much RAM, to see what that process is currently doing. That way you can trace the reason to the cause and resolve the cause.
 
Thanks for your response Peter. It is a big problem, because it does actually holds that memory, bottom part of the attached screenshot shows TOP command showing those 3.8GB files that PHP-PFM files. This year I gave server 64GB of ram and we only got to 30GB so we were fine this year, but last year we had 16GB of RAM and apache eat all of it, once that happened website was still fine since Apache and mySQL had the RAM but everything else was stuck, you could not even run LS command due to lock of memory.
 
I understand that this is a big problem when system resources run short, but what have you found out using the methods I described, especially strace?
 
Sorry Peter. We only have that problem once a year day before Thanksgiving since we sell smoked turkeys. I'll let you know next year. I was just looking for someone who faced that problem as well, just more often than I.
 
In this case it is quite obvious that the load that your website generates is simply too high. You'll need to check your scripts thoroughly and speed them up.
 
In that case I'll stick with adding more RAM, nowadays thanks to companies like DigitalOcean, you can for $40 buy 128GB of ram for a week, and then go down to 4GB for the rest of the year. Have a great day.
 
Back
Top