18+ Million Hits per Day with 120 Mega Bytes RAM, on a Small Linode

Written by
Date: 2011-08-31 17:10:00 00:00


Today a post about 9 million hits per day with 120 MB RAM on Hacker News, called my attention.

As the guy who wrote that post, I've trying to make my blog be ready for a rush of visits.

As him, I've been hit in the past from Digg (Twice) and from Slashdot once, that was when I was beginning and I had Drupal (no optimization) running in a shared hosting server.

The server took my page out, because I was making too many requests to the MySQL database. Sure I was, I had Drupal modules showing recent comments, showing most visited posts, in fact showing too much real-time information.

From those days I've been trying to improve the performance of my server, the last effort I made was this configuration:

Client -> Varnish -> Nginx (serving static pages created by boost) -> Apache -> Drupal+boost

Actually, Varnish is not needed or Nginx is not needed here my analysis

Well, later I decided as some of the comments here suggests, that a blog is actually static content, and as thus there is no need of PHP or any other dynamic page creation.

I've moved to Jekyll + Nginx.

Guess what. Using the same testing tool, I've got 18+ millions possible hits per day I'm sure the server can do more, and with 128 MBytes of RAM.

Here are some info about my server:

Nginx running on Linux, powered by Linode with RAM limited to 128 Mega Bytes.

What I've done was to run the same tool, from two different computers/account at the same time, agains the same site:

Here some pictures that show the test results:

Response times 1

web test response time

Response times 2

web test response time

Hit rate 1

web test hit rate

Hit rate 2

web test hit rate

Summary 1

web test summary

Summary 2

web test summary

As you can see, there are some few errors from the second test running, so it seems we are achieving the top of the server capacity.

Here is a screenshot of TOP command running during the tests:

htop screenshot

Off course running a dynamic blog have some advantages, as for example Infinite scroll, but on the other hand, running a static blog, has other advantages, and maybe security may be the most important.