Take the 2-minute tour ×
Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

I want to tune my httpd.conf. I have constantly about 60-130 Apache processes (all 20+MB). However my server only needs like 3GB and I have 8GB overall.

My settings:

Timeout 10
FileETag None
StartServers 15
<IfModule prefork.c>
MinSpareServers 20
MaxSpareServers 30
</IfModule>
ServerLimit 500
MaxClients 300
MaxRequestsPerChild 8000
KeepAlive On
KeepAliveTimeout 15
MaxKeepAliveRequests 1000

What can I increase to server my page faster? I want to go for speed! Well, I guess I could change MaxRequestsPerChild to 0 and KeepAliveTimeout to 50 but what else? Is it worthwile to up the MaxClients value?

Any tips? Thanks, Oliver

share|improve this question
    
Without knowing what the current bottleneck is, it's impossible to say how to improve things. –  womble Jul 25 '11 at 6:07

2 Answers 2

The only boost you might get there is eliminating the time it takes to start up a new server - boost the StartServers directive [if you are sure there are always 60 running at any given time!]

Otherwise your performance bottleneck may be elsewhere:

  • test your applications to be sure it not them that are slow
  • test your database[s]
  • make sure you are not loading any unnecessary apache modules
  • use caching wherever possible
  • check your disk and processor

-sean

share|improve this answer

Right - tuning the webserver (Apache) is the place where you'll get some of the least performance gains.

You have extra resources available, so you're on the right track - you need to put them to use. It's time to use your memory much more aggressively to speed up your side - this is where you're going to get the most performance gains. Reduce CPU usage, increase memory usage (through caching), minimise disk access.

You don't mention what OS you're running on, or what programming language you're using. My area of expertise is Linux and PHP, so I'll go with some advice for that and if its wrong you might be able to adapt it for other stacks.

PHP - are you using something like APC or xCache? If not, get on it! Make sure you allocate enough memory in the config to contain your whole application.

Start building in caching into your application - make use of things like memcached (you can also probably use xcache/APC variable storage).

Do some analysis of the database usage. Increase the buffers and caches to keep more stuff in memory => less disk access.

Many people concentrate on minimising your memory usage, but what use is a server with 8gbs of RAM if you're only using 3. Obviously minimise any memory usage that is unncessary or not actually serving a purpose, but other than that, use your resources!

share|improve this answer
    
Thank you for the advice. I am already using APC but it's only using about 300MB and doesn't go over that even thou I assigned 1GB to APC. I am running CentOS and using a lot of PHP code (Wordpress) but I already have W3 Total Cache, ObjectCache, Database Cache, SQL Query Cache, CDN, etc. - problem is I am not so satisfied with First-Byte time and would like to cache even more requests. Maybe I should try that Varnish cache. –  mashup Jul 25 '11 at 15:12

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.