What have we done ?
For one request :
- Apache generates a static file after code execution
- This static file will then be served blazing-fast by nginx for subsequent request
- Thanks to Browser-cache plugin, Varnish will also be tell to keep this content RAM-Cached
The synergy of these elements is the key of the performance we get, and is why you should now get 6000+ requests/sec performance on your blog, just as I am (and with a page load time of 0.892sec for the whole index page approximately including images, 0.00163sec for the index page generation itself)
Have fun tuning your new system, and please contribute and give feedback within comments !
=== Update ===
Thanks a lot for all your mail feedbacks and private messages.
What could be done to go further ?
This article was written for a low-end VPS case, although these advices will fit your needs even for High-end dedicated server.
However, here are a few things that could be done on a dedicated environment to scale up the solution (horizontally) :
- Varnish fine-tuning : thread_pool/-s malloc storage
- Dedicated Varnish server
- Web servers Load balancing(Varnish, HAProxy)
- Memcached backend
- Dedicated MySQL server
- Hyperdb MySQL Sharding
- And more…
In an upcoming article, I’ll talk about the fine tuning of Varnish, to better fit your needs on High-end dedicated servers or Large Instance VPS.
Another article is coming which will define a High Availability/Scalability architecture for Million-Views/Day WordPress.
Prepare yourself to more Nginx, HA Proxy, Varnish, Keepalived, HyperDB, MySQL Sharding, Memcached, Repcached, SSD-Swap-Dedicateds disks…
And last but not least, the very same series of article will come about Magento :
- Magento Performance Guide : From 0.68rq/s to 7100rq/s on a 1Vcpu/2GB Ram VPS
- Magento High Availability/Scalability architecture for Million-Products/Thousands Checkouts a day