I recently split database and web on two seperate servers. Even moved all "static" files to another to lower the load, but it didn't help.
Apache builds up processes and I have to deal with loads over 90, at times even over 120. I am playing with my options, but nothing helps really.
Hardware:
Xeon, 1Ghz
1 GB RAM
80 GB IDE HDD
Apache:
Timeout 300
KeepAlive Off
MaxKeepAliveRequests 100
KeepAliveTimeout 15
MinSpareServers 7
MaxSpareServers 13
StartServers 7
MaxClients 256
MaxRequestsPerChild 50
Thanks,
Till
Captian_Spike
12-02-2004, 02:01 AM
That configuration looks fine. Can you tell us a little more. Loads that high are outragous and shouldn't be happening with static files.
We need more info about whats running, cpu and ram usage as reported by top etc.
andreyka
12-02-2004, 06:18 PM
Yes, we need know more.
Please put top output here. May be it not apache cause load. May be somebody used huge script. Just set up limits.
wphowell
12-03-2004, 12:37 PM
Your MaxRequestsPerChild setting is way too low; it should be at least 10,000. You also need to look at the number of hits your receiving vs bandwidth used. You should also check your memory usage, as the system could be swapping; you may not have enough memory on your system.
<<< Signatures need to be set up in your profile. >>>
eth00
12-03-2004, 01:18 PM
As wphowell said you need to find the limit
Are you out of ram?
free -m
see just how much swap you are using
Are your disk drives too slow?
hdparm -tT /dev/hda
that will give you a disk speed, compare it to when your busy and not to see if the drives are really slowing down
IOwait is also a good indication of disk trouble (in top)
Finally you may just not have enough brute cpu power.
Sorry for not replying earlier. Notification was turned off.
I moved all static files (js, html, images) on a thttpd on another box. And I also turned off the keepalive setting, since it's not needed if he retrieves a single file only.
The site is build up from PHP scripts, not the most efficient ones though. Database was also moved to another box. So this load should be off.
I moved the homepage to HTML, but it's still slow. Apache builds up a lot of processes and they are all in lockf state. Constantly.
The server pushes around 70 GB a month of traffic. There is probably a lot of bottlenecks in the code. I just don't know where they all are, since it's not my own. :)
Thanks,
Till
I personally believe that the Apache "locks" itself by writing a lot of files to the HDD. There is enough space but I think this is the reason for the busyness.
Can anyone confirm or deny this notion?
Regarding top:
last pid: 55034; load averages: 1.43, 22.54, 92.19 up 6+19:49:57 21:29:23
20 processes: 2 running, 18 sleeping
CPU states: 2.3% user, 0.0% nice, 3.5% system, 0.0% interrupt, 94.2% idle
Mem: 15M Active, 531M Inact, 138M Wired, 37M Cache, 112M Buf, 280M Free
Swap: 1008M Total, 56K Used, 1008M Free
I just managed to shut down the Apache. To gain some control of the server.