uncontrolled amount of httpd processes, high memory and CPU usage

bernhard

Verified User
Joined
Nov 19, 2012
Messages
31
Location
Oldebroek, The Netherlands
Hello everyone,

Let me start by saying that my web-host advised me to re-install the VPS when I had this problem (it was an newly installed one so there was no problem with re-installing it). Therefore I can not give more information then what I will give in this post. I do not want an solution, just some pointer to what I could try if I get this problem again.

After installing DirectAdmin on my VPS and migrating a domain to this server I installed csf with lfd. After installation I left all the configurations the same, except for the SSH port. I changed that to another port.

When a few days had passed my server began to randomly start httpd processes and the memory use started to increase exponentially. Each time I would reboot the server, it would take about 10 minutes before it happened again. Stopping the httpd daemon did not help, as the daemon would automatically start again.

Also, the mysqld process would take up about 2.4GB of RAM, the combined httpd processes 1.6GB (the server has 4GB of RAM). So the server would become unavailable.

I checked the Apache logs and server logs but could not find anything out of the ordinary.

What I would really like to know if anyone else has had this problem. If so, did you find an solution for it. What was the solution? I would like to know this for future reference. And maybe someone else will find it helpful too.
 
Hello,

Apache's server-status might help to find what is wrong... so the first step would be to enable it and to see what is requested the most. Then you might need to tune your MySQL server and enable caching in it...

Note, most of us here from time to time faces such a issue described by you, and we find solutions for that. There is no 100% suitable for all solution, so it always depends on your server resources and what CMS (PHP-scripts) are you running there. 4Gb RAM might be too little for certain cases. If you don't want your Apache to take so much RAM, you need to lower some values in it's configs here /etc/httpd/conf/extra/httpd-mpm.conf
 
Hi Alex,

How could I enable Apache's server status? Is that done in the Apache config files?

What is the recommended amount of RAM for a small server? Our server contains one website which gets somewhere between 25 and 200 visitors per day. It varies a lot. And there are about 10 really small websites running on it. Now, with the webserver newly installed and DA running, CSF - LFD running and the websites working on it the server uses about 1GB or RAM when 5 people connect to it.
 
How could I enable Apache's server status? Is that done in the Apache config files?

Yes, you should do in apache configs, they are located here /etc/httpd/conf/extra/

What is the recommended amount of RAM for a small server?

I've got no answer for you here. It's said here http://directadmin.com/install.html:

A minimum 1 Gigabyte of memory is required (2+ Gig is preferred), with at least 2 gig of swap memory.

I've got a server with 512 RAM and running only one website (and it might be to little in some certain cases), and it still is OK. And I've got 384 vhosts running with 4Gb RAM, and it's OK. So it depends on many things.

So if you want your server to run without issues with 4Gb it's possible to achieve that, and in this case you might need to tune services. If you don't know how to tune the services, and don't want to hire anybody for that job, then you might need to buy extra RAM.

I have no a ready made guide which you as well as others could follow in order to configure your services to run with 4Gb RAM. I'm sure if you spent time you'll definitely find some in Internet.

So please decide what you want and make your choice. Should you have more questions please feel free to do it here or privately.
 
Back
Top