32 private links
Speedy Sites: Nginx and PHP
20
FEB
In the previous article in this series, we looked at using Apache with mod_pagespeed to perform on-the-fly enhancements to decrease page load times. Getting an optimised page is only half the battle however; we need to ensure that our backend is doing as little work as possible in order to be highly scalable. In this article, we look at how we can achieve this while improving performance – all with nginx.
What is nginx?
For those unfamiliar with nginx, it describes itself as “a free, open-source, high-performance HTTP server and reverse proxy”, first released publicly in 2004, and becoming one of the most successful webservers in the past few years – their wiki has an impressive list of sites powered by it. The biggest advantage it has over the tried-and-tested Apache webserver is that it uses an event-driven, asynchronous architecture – so it doesn’t rely on threads to handle requests. What does this mean in real terms? Well, apart from predictable increases in memory usage under load, the key point for us at the moment is that it can serve static content fast. Really fast.