How To Keep Number Of Apache Running Processes Down
Mar 30, 2007
I have small issue with load speed of pages when number of apache running processes goes over +-310, during peak traffic of day. IE: They load really slow.
Here's pic of what I mean:
Only thing that fixes it temporarily (at least until peak traffic ends) is to stop either httpd or mysql for several seconds, as everything cools down, then start it back up. Stop/starting mysql usually has longer terms temporary fix.
Anyway, would you have any ideas on what to configure or change within the system in order to keep the processes under 300?
The load is normal. Even at load 40, pages are blistering fast, as long as processes are under 300. So it's got nothing to do with load.
Our server is running; Plesk 11.0.9 and CentOS 5.7 it has a Q8200 CPU @ 2.33GHz and 2GB of RAM. Now there are just two websites on the server plus a couple of redirects/forwarding domains, although lots of domains are still on the server but turned off in Plesk. Both websites are OSCommerce sites and I just need to keep these sites going until the end of the year when we will switch to our new Joomla based website.
We have seen an increasing number of server crashes and after various checks of the logs, fitting a new BIOS battery, check of the hardware by EasySpace who host the server, installation of ClamAV, LMD and RKHunter (which did find some Trojans and Suspect software), I have traced it down to some external Http activity that is taking all of my CPU time and RAM. Here is a screen capture of the Htop listing and when I killed these processes the CPU and RAM went back to normal. The problem is that I usually have to restart the HTTPD service and sometimes things get so bad that the server crashes and I have to request a power cycle.
so here is a simple question that i just can't seem to figure out.. when i run the command top or ps -auxw.. they show the httpd processes as the command httpd or /usr/sbin/httpd, but how do i know what file that is? is there anyway to find out what file that is actually getting executed or served?
I update the sources.list on server 1 to mirrors of the new debian 4 etc . I run apt-get update and apt-get dist-upgrade . A whole bunch of things get updated (it was long time ago that I did this anyway). After some troubles with /boot/grub/menu.lst the server boots ok, and everything is well. This server used to have loads of 15-25 at peak times, but after the update its running very smooth with loads of 2-3 at the same peak times. I dont know why exactly, as I noticed updates in OS , kernel version (from 2.6.8x to 2.6.18) , apache2 , php (4.4.4-8+etch1) , and I also needed to update eaccelerator from 0.94 to 0.95 .
A few days later I update server 2. Everything seems to go the same, although the kernel version stays at 2.6.8-3-686. I dont think kernel version at start was exactly same at server 1. But the new php version is the same as server 1, and everything else looks the same too.
But when peak times are coming up, this server starts to have troubles. It is quickly rising to total of 200-300 processes , while server 1 always stays stable at 60-70.
Server 2 also reacts slow if I click somewhere on the site. It takes 5-10 seconds to show a new page. However the load stays pretty low at 1-2 . I see no big cpu usage and also no big memory usage. I have the impression that this server 2 is somehow wasting a lot of apache processes and is making things hard for itself without a real reason.
When I check the seperate mysql database server, I also notice a lot of processes.
Around 200-250 whereas it used to be 40-60. Sometimes this adds up so hard, that all webservers are blocked because mysql has too much processes. When I check the mysql connections, I see a few dozen things like 'unauthen ip:port Connect login' just hanging. All of them have the ip of webserver 2. Those extra apache processes are somehow hanging on to the mysql server without really doing something.
I dont know what is happening, but this server is underperforming very badly now. I managed to limit the problem by drastically lowering ServerLimit and MaxClients on webserver 2 , but this is no real solution. The server is still slow, at least now its not bringing down the others.
My question : what should I check for now ? I noticed a different structure in the conf files in debian etch, maybe something new has a bad influence on my old conf files? Is there something wrong with the combination of kernel+php version? I have no idea, please point me in the right direction so I can learn from this.
I would like to know what is the maximum number of Apache connections a Server can handle? Does this depends on the Config of the Server? Is it Possible for a server to handle more than 2500 Active Apache connections without timeout / connection failure / slowness?
I use url http://myurl:8020/ERC to access application and I am able to. But I dont want to use port number in the URL.Would like to access application using http://myurl/ERC . I referred to one of the post and added below entries to httpd.conf file.
ProxyRequests Off ProxyPass /ERC http://myurl:8020/ERC ProxyPassReverse /ERC http://myurl:8020/ERC
But I am still not able to access http://myurl/ERC.LoadModule entries are enabled and I have restarted apache.
I have installed apache 2.4.10 with tomcat-7 as backend .Proxypass has been added in apache to access tomcat via http port .now requirement is to restrict each Context to 100 sessions only , how i need to achieve this .
I've installed apache on my windows 2008 vps . It's run and when I browse localhost , it's works fine . But when I enter the vps ip address , it says Chrome could not connect to ... , I'm sure that httpd is running on port 80 (I checked it via netstat -ao and task manage ) ....