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:
=> [url]
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.
I'm not sure I understand the server-status page enough to know if this is a problem or not, but I have several processes that seem to run forever, or until I restart Apache. e.g.
Code: 13-1 21045 0/697/4264 W 59.45 19641 0 0.0 43.28 274.97 66.249.66.133 www.example.com GET /wp/2005/01/ HTTP/1.1 19-1 408 1/834/1831 C 83.52 32463 0 14.8 149.66 263.48 66.249.66.133 www.example.com GET /wp/ HTTP/1.1 30-1 14416 0/430/431 W 35.19 13347 0 0.0 37.42 37.44 66.249.66.133 www.example.com GET /wp/category/issues/ HTTP/1.1
They are almost always on a single domain (there's about 100 on the server) that's a Wordpress site. These processes are also almost always a search engine.
On the rare case I see them running on other domains on the same server they're always on Wordpress sites.
The longer the processes run, the more processor/memory they use, the more they slow the server down.
It seems to have just started in the past few weeks, I've had the site there for a couple years.
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?
To start the process in the background how and hide him?
In the system CentOS is command "screen" There is the command screen a system debian does not have this command, only "&" but I do not know her to use.
Apache keeps increasing processes and when it reaches 256 value, it crashes. These are the values from our conf file. This doenst happen everyday, it occurs once or twice a week and at random timing.
Timeout 120 KeepAlive Off MaxKeepAliveRequests 100 KeepAliveTimeout 15
I enabled server-status and found request for index.html, is holding the processes. Only thing i see in access logs is ""OPTIONS * HTTP/1.0" 200 - "-" "Apache (internal dummy connection)""
Each one takes up like 4% of the available ram - and when the ram is gone, the server dies (it doesn't have a swap file - half the time you can't even log in to it), and you have to reboot Apache.
I thought of limiting maxchilds, but would that break something else?
Should I just make a swap file? Will that defeat the point of creating child processes?
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 am trying to figure out how Apache is working on windows 7 - so far so good - but how do I set restrictions and limitations on bandwidth usage and max number of IP-connections?
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'm new to Private Virtual Server and the package offered by different company are quite confusing.
I was on RackForce and their basis VPS package dds200-L can host 100 domain names on Plesk and unlimited domain names on WHM/Cpanel.
On 1and1 it didn't say if Plesk support 100 or unlimited domain names. My question is, do we always have the liberty to host unlimited domain names on our PVS?
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 ) ....
I'm not an admin, I can't make apache run cgi's, I have followed several documents in different pages without luck, I can run normal html pages but not cgi's. I only get the code displayed in screen.