Server Fault is a question and answer site for system and network administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I have the following dedicated box that I only install apache httpd server on, what parameters in httpd.conf should I tune to achieve max performance?

cat /proc/cpuinfo shows 8 processors(only pasted one below, others are identical)

processor   : 0
vendor_id   : GenuineIntel
cpu family  : 6
model       : 23
model name  : Intel(R) Xeon(R) CPU           E5410  @ 2.33GHz
stepping    : 6
cpu MHz     : 2333.470
cache size  : 6144 KB
physical id : 0
siblings    : 4
core id     : 0
cpu cores   : 4
apicid      : 0
fpu     : yes
fpu_exception   : yes
cpuid level : 10
wp      : yes
flags       : fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush dts acpi mmx fxsr sse sse2 ss ht tm syscall nx lm constant_tsc pni monitor ds_cpl vmx est tm2 ssse3 cx16 xtpr sse4_1 lahf_lm
bogomips    : 4666.94
clflush size    : 64
cache_alignment : 64
address sizes   : 38 bits physical, 48 bits virtual

free -m

             total       used       free     shared    buffers     cached
Mem:         16054      15546        508          0        251       8084
-/+ buffers/cache:       7210       8843
Swap:        16370          0      16370
share|improve this question
What load do you expect on it, say, in requests per second? – Alex Feb 9 '11 at 2:24
it various greatly anywhere between 1 to 100 request per second. – user12145 Feb 9 '11 at 2:27
What is a main purpose of this server - serving dynamic content, reverse proxying content to other servers, etc? – Alex Feb 9 '11 at 2:30
serving dynamic content, it proxypass & loadbalance requests to backend tomcat servers where each request can take up to 20 seconds to process, but typically would take 1 second under normal load. – user12145 Feb 9 '11 at 2:38
up vote 2 down vote accepted

A few comments that may help you:

  • The Apache settings that make the biggest performance impact will be the memory each instance takes (depends on the number of mods loaded and their configuration) and the number of MaxClients/Servers set. If Apache is truly the only thing needed on the server then you generally want to eliminate any mod you don't need and then increase MaxClients/Servers to use as much RAM as possible but never so much as to begin using the swap. To determine this you'll need to test the configuration...
  • I would strongly suggest stress testing the application using ab/siege or a similar framework. This will let you determine the optimal settings for your application as well as give you some hard(er) numbers of the capability of your hardware. You might find, for example, that with the default settings you can get 500 req/sec without blinking in which case spending time optimizing things will be mostly a waste. On the other hand it might tell you that you can only get 20 req/sec at best which will mean re-looking at the overall application architecture.
  • Re-run the stress test each time you make a change in configuration, software, or hardware of the system. This will tell you what effect everything has and permit you to make more informed decisions to optimize things. If you don't measure/test there is a risk of spending a lot time/money working on things that has no effect (or worse, actually has a negative effect).
  • Consider using different software for the dynamic and proxy/load balancing portions, though your server is beefy enough that it may not make much difference.
share|improve this answer

You should consider using HAProxy or nginx as a proxy/load balancer, Apache is not really good at it, because it can't process requests asynchronously. Apache is simply not designed for this kind of tasks. Using an asynchronous I/O-enabled proxy/balancer can save you a lot of resources. And you don't need such a big server to proxy/balance 100 requests per sec, I was able to proxy about 500 requests per sec using HAProxy on a 512Mb Rackspace Cloud instance (it used a quad core CPU but a LA was around 0.1 typically on this host, so I just did not need so much processing power).

share|improve this answer

Your Answer


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.