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've been benchmarking a Drupal 7 site and I've found apache is up to four times slower in terms of page execution than an Nginx set up I've created. As it's page execution time my understanding is that no other requests will be made for page assets until after its execution is complete so it's unlikely to be caused by how multiple requests are handled (I should also mention that these are test servers only being accessed by myself).

I tried setting up PHP-FPM to work with apache to rule it out as a possible factor but it only had an effect on the page execution time of around 2%.

Each server is running Ubuntu 11.10 with the software coming from the PPAs and only the minimum amount of configuration changes after install to get the servers showing drupal.

As far as I know this is the reverse of what I should be expecting with this setup. Apache should have an advantage as it's not having to call out to an external service but instead I'm seeing results massively skewed in favor of nginx.

Is there any explanation for the results I'm seeing? Can someone provide tips for how I might go about determining the cause?

share|improve this question
How is Apache configured? Do you have an opcode cache enabled or PHP? Why do you believe Apache should be faster? – Zoredache May 7 '12 at 23:13
What exactly is surprising about Apache being slower? Just because a lot of people use it doesn't mean it isn't shit. – gparent May 7 '12 at 23:18
Apache still has all the default configuration. Both servers are using APC and I've checked to ensure there's no cache churn. I find it surprising as the page execution time is calculated using the Drupal developer module which uses a simple microtime(); at the start and end of the page. So for one thing when both servers are set up to use a FastCGI process they should be running in nearly identical environments yet there's a speed difference of a factor of four. I've also checked to make sure the server isn't being taxed to heavily by the requests. – Dean Reilly May 7 '12 at 23:24
up vote 1 down vote accepted

I managed to track down the reasons. It seems the server configurations were not quite as uniform as I believed. One of the apache test machines had xdebug installed which was causing it to run very slowly and another was using the pecl memcached module rather than pecl memcache which was also causing problems. Once these differences had been resolved the page execution times became much more similar across the servers.

I hope no one went to too much trouble on this question as clearly I didn't include enough details in the original post to correctly diagnose this.

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.