Much like an E34 M5, this website and it’s underlying hosting components were assembled by hand. You might be thinking, “It looks like any other website!” My response would be, “Just like an E34 M5 is kind of a subdued sports car!”
This website is built on an open source content management system called WordPress. There are millions of sites built on WordPress. This one, however, is built on a highly tuned and fast stack which is served from two minimalist Ubuntu 14.04 servers running in the cloud at Digital Ocean. The stack consists of:
Front End Servers
- 3 NGINX geographically placed micro cache proxies.
- Geo-aware DNS with 30s global fail over detection.
- True front end caching protection against 502’s and hard 500 errors.
- Custom security inspector (Marcellus) implemented as a Nginx module (written in C)
Back End Server
- NGINX Reverse proxy static object web server with upstream management and W3 Total Cache rewrites.
- Forced HTTPS Traffic featuring the SPDY multiplexing protocol.
- PHP served by Facebook’s Hip Hop Virtual Machine with PHP-FPM failback.
- Origin page caching through W3 Total Cache.
- Tuned MySQL Database.
Much like fuel injection revolutionized automotive performance, event driven software has revolutionized web servers. Their are two event driven server components in this stack that have revolutionized processing web traffic.
Making its debut in 2005, the NGINX web server is one of the most efficient, high performance web servers on the worldwide web. It is an efficient web server, reverse proxy, upstream load balancer, and micro-caching server that can handle high loads of traffic with minimal resource requirements.
The second component is a product of Facebook’s development team that was recently open sourced as “The Hip Hop Virtual Machine” or HHVM. WordPress sites are composed of a server side scripting language called PHP. Every call that is made to a website requires the server to interpret tens of thousands of lines of PHP code. HHVM is a just in time compiler that renders PHP as byte code and removes the layers of interpretation. The result is 20x to 30X performance gains. (HHVM does show some stability issues so I run NGINX in upstream mode to fail over to PHP-FPM when HHVM becomes unstable. A quick thanks to the guys at RT Camp who presented this idea at the 2014 Nginx Conference.)
Another notable component of this configuration is the WordPress Plugin W3 Total Cache which is produced by W3 Edge. W3 Total Cache is a performance framework for WordPress that is genius. I use it for origin page caching, web browser caching directives, and APC based fragment caching for the various widgets on my site.
A big shout out to the NGINX web server project, the HHVM project, the dedicated employees at Canonical, Frederick Townes and his team at W3 Edge, and my friends at Digital Ocean. Without their work performance results like THIS wouldn’t be possible!
Presentation for Dallas SEO/SEM Meetup can be downloaded here.