edit httpd.conf file?

Rebecca

Verified User
Joined
May 20, 2006
Messages
36
Anybody have any experience with editing & optimizing the httpd.conf file?

I've got a very high traffic site serving only static web pages & images. (it's on a dedicated server) I'm trying to figure out what settings would be best. Right now I have MaxClients set to 450, but I'm wondering if that's adequate. Any thoughts?

Also, I'm new to Apache & Direct Admin... if I restart httpd through DA will that make changes to the httpd.conf file take effect.

Grateful for any input!
Rebecca
 
I've got lots of experience with managing httpd.conf files for optimization. However my knowledge isn't going to easily transfer to your server because I haven't studied your server logs.

For example, how would I know if MaxClients 450 is enough for your server without a study of the logs to see how many clients are trying your server, and without actually listening to user experience and trying your sites myself over time to determine if the problem really is the number of available clients. If your server doesn't have enough power for 450 clients, then setting it that high could be creating problems rather than fixing them.

Optimization is certainly doable. It's not easy, and it's definitely done on a server-by-server basis, based on the load characteristics of the specific server you're attempting to optimize.

That said, try higher and see if it helps.

Yes, you can restart httpd through DA to get the new file read, but you can also do it from the command line. (How depends on your server OS distribution.)

Jeff
 
Thanks for your thoughts... I'll try futzing with it. Here's a little bit more info... I'd be curious to hear what you think.

I have a dedicated server with a 10mbps connection (unmetered). When I look at the bandwidth charts, they transfer rate is pretty much plateauing around 7.7mbps for most of the day, and it dips down to around 3.5 in the middle of the night for a few hours. When the bandwidth is plateued, the site tends to have performance problems... ie: really slow to load, pages will load, but no pictures, sometimes you can't get in at all.

All of the technicians tell me it can't be a bandwidth problem because I have a 10mpbs pipe. But I have a friend who is a TCP/IP expert and he said that because I'm serveing millions of requests for very small files (average 10K) the header info could use up to 25% of my bandwidth, and depending on where the charts get their data from (chart made by NOCWizard) they might not be reflecting header info in their numbers. (Something about how the chart would actually have to be intercepting the TCP/IP stack in order to see header info and that was unlikely.) According to the Apache documentation, the transfer numbers in the web usage logs don't include header info, so if NOCWizard is just reading those logs, that would support my friend's suggestion.

But, before I spend an arm & a leg for a bigger pipe, I wanted to make sure that there wasn't something else cutting off the traffic. I know I've got some RAM issues (mostly that webalizer is gobbling up my RAM trying to process massive weblogs - I'm trying to figure out how to turn it off - that's in a different post). But I've tried just killing webalizer temporarily. This frees up RAM, but does nothing to improve site performance, or to get me above my 7.7mbps transfer rate.

My only other thought is that I might need to bump up MaxClients. Soooo... I figured I'd disable webalizer and bump up MaxClients and see if there was any effect. If there isn't, do you think it's safe to assume that my issue is bandwidth? (CPU is only at 5% even when the load is really high).

Oh... and one other stray question. I read somewhere that if you bump up MaxClients you also have to bump up something called Server Limit... but I can't find Server Limit anywhere... not in httpd.conf anyhow. Do you know what that's all about?

THANK YOU VERY MUCH!
Rebecca
 
I have seen many people with a 10Mbit pipe not able to get close to 10Mbits, it could be your host.

Seems to me I would look into optimizing applications as you are, the disk system could be a bottleneck also since you are serving so many small files the HD may not be able to keep up and then of course your connection at the DC.

You could ask your DC if you can upgrade to a 100Mbit port and see if it helps. If not downgrade back and not have to pay the full month for it. Can't hurt to ask.
 
Thanks, I'm checking into the bandwidth options, and the disk system is also worth looking at.

In the meantime, do either of you know which of the things listed in netstat count as a "client" under MaxClients? In other words, before I fiddle with that setting I'd like to be able to see how many simultaneous connections the server is actually handling now. Or maybe I could deduce that info from the logs somehow?

Also, the Apache documentation says that in order for any changes to MaxClients to take effect, you must also make changes to the ServerLimits directive. There is no ServerLimits directive set in my httpd.conf file, nor have I seen any other reference to it anywhere on the web. Any clues?

Thanks,
Rebecca
 
7.7 out of 10 is actually reasonable because of overhead issues, and today's systems generally can flood a 10 mbps connection.

Since you haven't told us anything here about your server, your system may or may not be experiencing issues based on system load/limits.

The DirectAdmin default httpd.conf file doesn't include most of the comments; here are some definitions in the comments generally included in httpd.conf files:
Code:
# StartServers: number of server processes to start
# MinSpareServers: minimum number of server processes which are kept spare
# MaxSpareServers: maximum number of server processes which are kept spare
# MaxClients: maximum number of server processes allowed to start
# MaxRequestsPerChild: maximum number of requests a server process serves
Jeff
 
can't get changes to take in Apache 2.2

Hello again...

My host upgraded my server to Apache 2.2, and now I can't seem to get any changes to httpd.conf to "stick".

I need to up MaxClients to 1024, and set the keepalive timeout down to 2.

Here's what I put in httpd.conf

ServerLimit 1024
MaxClients 1024
KeepAlive On
KeepAliveTimeout 2

Then I restart Apache, but still I'm maxed at 256 open connections. The machine is performing like mud and I can barely get into my sites.

Any thoughts would be greatly appreciated
 
problem solved

OK... just in case anybody else has this problem. The key was that those settings must be set in this file:

/etc/httpd/conf/extra/httpd-mpm.conf

not in httpd.config.

Don't know if all installations of Apache work the same way, but that's how mine was.
Cheers,
rebecca
 
OK... just in case anybody else has this problem. The key was that those settings must be set in this file:

/etc/httpd/conf/extra/httpd-mpm.conf

not in httpd.config.

Don't know if all installations of Apache work the same way, but that's how mine was.
Cheers,
rebecca

It seems you're running Apache 2. The advice given was for an Apache 1.3 install. Just goes to show you should give as much information as possible when you ask for help ...

Regards,
 
Back
Top