Node.js Versus Nginx: Bare Bones Test Node.js Versus Nginx: Bare Bones Test

This is a quick follow up to yesterday’s post on Node.js Versus Apache2: Bare Bones Test where I performed a straight HTML test of Node.js tutorial versus Apache.  With my recent switch to Nginx, I thought it prudent to perform this exact same test swapping out Apache for Nginx.  The results are much more interesting to yesterday’s since there is no total destruction (sorry for the spoiler if you didn’t read yesterday’s article).

To do this test, I simply installed Nginx on my Windows 7 laptop to ensure the playing field is level and copied the HTML file created for Apache to my Nginx web root.

I then proceeded to re-run the simple speed tester on both the Node and Nginx applications, respectively.

I was much more pleasantly surprised in the results this time.  I ran the test multiple times because it was so close and each time both the Node and Nginx website ran over 6,700 times.  It would swap between Node winning by 20 results than Nginx winning by 20 results.  At the end, I would have to call it a tie since the results were always within +/- 20 of each other!

I would be curious to include php5-fpm and redo this test because at this stage I feel that Node would step out as more of the clear leader because Node is already doing some full circle processing where-as Nginx is just loading a plain jane HTML page…


Unlike Apache, Nginx seemed to be quite respectable when comparing against a basic Node.js application.  Which of course makes a lot of sense since the concepts behind them are somewhat simpler unlike Apache which follows a more blocking pattern when loading web pages.

Published on Dec 4, 2012

Tags: Optimization | speed comparison | Node js Tutorial | nginx | Theory | JavaScript | apache

Related Posts

Did you enjoy this article? If you did here are some more articles that I thought you will enjoy as they are very similar to the article that you just finished reading.


Learn how to code in HTML, CSS, JavaScript, Python, Ruby, PHP, Java, C#, SQL, and more.

No matter the programming language you're looking to learn, I've hopefully compiled an incredible set of tutorials for you to learn; whether you are beginner or an expert, there is something for everyone to learn. Each topic I go in-depth and provide many examples throughout. I can't wait for you to dig in and improve your skillset with any of the tutorials below.