I’ve been curious about how Redis compares to plain filesystem as page cache for WordPress running behind Nginx. Bottom line: the filesystem along with Linux file cache is way faster.
Benchmarks have been conducted on a random KVM and WordPress. The latter’s plugins do not matter, because pages are only generated once and then cached.
The first blog, the one using a plain filesystem as cache, has been run with WP Super Cache plus on EXT4.
The second one utilized my plugin CDN Linker; see the caching branch for its source code. Nginx has been 1.1.12-r2 with HttpRedis 0.3.5; Redis 2.4.5.
Tests have been conducted by:
/usr/sbin/ab2 -n 50000 -c 5 -H 'Accept-Encoding: gzip' -k [url]
- filesystem – 17000 – 19000 requests per second, about 50-60 ns per request
- Redis – 5000 – 5200 requests per second, about 194 ns per request
- Redis w/o keepalive connection from Nginx – 1700-1900 rps, ~500 ns per request
I suspect that even if I connected Redis to Nginx through unix sockets (and not the usual TCP sockets) requests per second would only double, still significantly falling behind filesystem as cache. Nanoseconds per request would drop, though, but I do not believe that I will see anything near a three- or five-fold increase.