here is the million dollar questoin! 😀 what is the best web server ? nginx or apache ? if you dig some deep on this, you’ll come around that unless, you have a very big user base or limited hardware resources, it doesn’t matter.

so i wanted to test this with drupal, whether it actually makes a difference in a practical situation. (theoretically it should) thanks to AWS free tier i setup my test environment using AWS as below.


following are the actions i performed in AWS console and in EC2,

  • launched an EC2 instance
  • launched RDS instance for mysql (for use as drupal’s DB)
  • installed both apache and nginx servers in EC2 instance
  • installed drupal and connected it to RBD server
  • added some dummy content in drupal site

next i created an image of my EC2 instance (AMI) and launched another instance with the same hardware features as previous EC2 instance in same region from the created AMI.

so the next steps followed are,

  • configured one instance to run apache only and another to run nginx only.
  • pointed drupal installation as root directory in both servers.

after this, i had two drupal installations with same content running on apache and nginx in same location.


so the basic thing i wanted to test is,

server performance in limited hardware over a large traffic.

i used jmeter with performance monitor plugin for this. performance monitor plugin will allow you to measure server performance metrics in jmeter.(cool right ? 🙂 )

for the test plan, in jmeter

  • added thread group with 1000 threads to simulate 1000 users
  • inside thread group added HTTP GET request to root folder to simulate main page access in druapl site
  • added a performance monitor metric collector to measure server CPU & memory usage
  • added a summary report to get overall statistics
jmeter test plan
jmeter test plan



so i performed this same test on both of my EC2 instances. following are the results i obtained.


requests failed throughput
1000 18.7% 4.437640063/hr
apache server performances for 1000 users
apache server performances


requests failed throughput
1000 7.2% 4.4314258999/hr
nginx server performances for 1000 users
nginx server performances


so so so, here it is! answer for the million dollar question.

under a large traffic with same hardware resources, nginx performs way better than apache.


leave a reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

This site uses Akismet to reduce spam. Learn how your comment data is processed.