After teasing in my last post, here is the full tutorial on how to improve your WordPress performances.
This idea started last week. As a Solution Architect @Hegerys, I had to provide a new solution for Magento hosting on a unique dedicated server.
But as we all know, if Magento is a very good and competitive eCommerce Software, it is also one of the slower, if not the slowest and heavyest. Getting good performance for this kind of web application on a unique dedicated server just seemed impossible.
Then before delivering, I wanted to test out how I could improve performances on a web software without having to get my hands directly into the code.
I had this wordpress blog (the one you’re reading) on a non-optimized WordPress behing a non-optimized apache+mod_php, on a very little VPS (1VCore, 1GBram).
When I started this work, http://blog.brigato.fr was only handling 5 requests/sec. It now handles more than 6000 requests/sec.
By following this tutorial, you should be able to improve a fresh untouched Wordbress performances by a factor 1000, and an optimized (W3 Total Cache, APC Enabled…) WordPress by a factor 400.
The very Beginning
When things began, this was all I had :
- A 1Vcore/1GBRam VPS
- A slow and poor 20GB Virtual disk on a <80 I/Ops SATA Harddrive
- A not-so-fresh Debian “Squeeze” 6 x86_64 OS
- An untouched Apache2.2+mod_php5.3.6 with KeepAlive set a Off
- An untouched MySQL 5.5
- A non-optimized (no plugins) WordPress 3.3
Using Apache Benchmark tool, it resulted on a 5 requests/sec on the blog Index page.
ab -c 10 -n 100 http://blog.brigato.fr/
Also, the VPS was overloading and swaping immediately. The VPS needed a hard-reboot just after this very little benchmark.
I decided to go on with optimizations on 3 big points :
- WordPress Internal performances :
- Page static caching
- PHP’s Opcode caching
- Routing/Static content delivery performances :
- Stop the delivery of static content through Apache
- Reserve Apache only for code execution
- Frontend all request to a fast static delivering solution along with content-routing capacities
- Fast Caching frontend :
- Should RAM-cache every possible elements
- Should provide Connection Reuse Model to benefits from KeepAlive and unload both Routing and Apache frontend