Click to See Complete Forum and Search --> : Apache lagging the #$#$#$ out of a server?


SKoL
08-23-2001, 12:38 AM
Hey, I've got a problem and I am curious on how to fix it.

I currently run Apache 1.3.4 with mod_perl 1.16 (I know it is old, I wish I could upgrade, but this is a propritary application, httpd, mysql, perl and java)


We currently have a dual 800 P3 1 gig of sdram server. This is a VERY high volume server. The problem is this server just seems to "run" away. It will work fine, but under pressure it folds every time. I have to constantly kill/restart apache. I am a experienced linux admin, and I've never seen something like this. I do not know apache 100% , thats why I am asking for some help. Like I said, this server has 1 gig of ram, and it uses 99.9% of it. This software isn't the best written, but it shouldn't freaking take a gig of memory to run.

I've heard rumors about apache spawing too many child processes, etc. Does anyone know of a way/guide to tweak the hell out of apache? We are about to upgrade to a 4 gig machine, and I'm curious if it still doesn't fix the apache/memory problem. My httpd.conf has been tested over and over, no errors, but I'm not sure that I have the most optimal settings. Here is a snip.

<snip> (comments taken out)

UseCanonicalName on
#
Timeout 300
#
KeepAlive On
#
MaxKeepAliveRequests 300
#
KeepAliveTimeout 15
#
MinSpareServers 8
MaxSpareServers 12
#
StartServers 6
#
MaxClients 256
#
MaxRequestsPerChild 1000

</snip>

Thanks for the help, I'll be here watching to answer any more questions.

freebsd
08-23-2001, 02:04 AM
>> but I'm not sure that I have the most optimal settings

The optimal settings of Apache depend on many other settings and situations. You said it's a high volume server, so how high? What exactly do you support? How many simultaneous connection in average? Anyhow, your settings of:

StartServers 6
MinSpareServers 8
MaxSpareServers 12
MaxRequestsPerChild 1000

are way too low. Your memory and CPU are more than enough to handle StartServers 100 and MinSpareServers 30 and MaxSpareServers 70 and MaxRequestsPerChild 10000. However, you will need to recompile your kernel as well as Apache to change your default settings to handle that because your system has hard limit and soft limit settings and you can blindly put a big number, or else it won't do any good but make it worse.

The King Ant
08-23-2001, 11:01 AM
It's not abnormal for Linux to show all your memory as in use. It just caches things to help speed stuff up, but it will free up memory if something else needs it. You should be ok as long as you're not using a lot of swap space (more than 100MB in use probably means you actually are using all your memory, and you should probably get more).

SKoL
08-23-2001, 07:03 PM
1 gig in a regular tower server is the max you can fit usually.

We just upgraded, but I doubt this will solve the problem. I guess I should test if the software will take a recompiled apache binary..

SKoL
08-23-2001, 07:09 PM
Originally posted by freebsd:
<STRONG>&gt;&gt; but I'm not sure that I have the most optimal settings

The optimal settings of Apache depend on many other settings and situations. You said it's a high volume server, so how high? What exactly do you support? How many simultaneous connection in average?

5000 page views, about 500 simultaneous connections a day is the lowest, and up to 25000 page views and 1100 simultaneous connections in a single day.

I work for a EDU, we run online courses on this server, its called Blackboard, the software can lick my nuts, its all written in perl and slow as ****. The DB is even worse. Basically its laggy outdated software. They claim to upgrade and it will fix the problem... so we are testing the upgrade.


StartServers 6
MinSpareServers 8
MaxSpareServers 12
MaxRequestsPerChild 1000

are way too low. Your memory and CPU are more than enough to handle StartServers 100 and MinSpareServers 30 and MaxSpareServers 70 and MaxRequestsPerChild 10000. However, you will need to recompile your kernel as well as Apache to change your default settings to handle that because your system has hard limit and soft limit settings and you can blindly put a big number, or else it won't do any good but make it worse.</STRONG>

Yes, I knew that as well, but I guess I'll just have to test it myself, to see if this software will acually take a modified apache binary.

Craig McPherson
08-29-2001, 12:04 AM
Could you please post the output of the "free" command when Apache is causing trouble?

What about swap space -- do you have plenty of that available? This sounds somewhat similar to what happens when the system needs swap space that isn't there -- everything gets very, very, slow, everything seems to freeze up, and random processes start crashing. It could be any number of things, but that's what I'd look for first.