Nginx FastCGI_Cache Vs PHP Caching

Nginx is really good at concurrency (PHP not so much) so you should try a bit more than 180 requests per second. Maybe 500, or 1000 depending on your server resources and network throughput.

The fastcgi_cache is served directly from ram. Wp-super-cache uses php
to read a static file from the SSD so I see why it should be faster so
why isn’t it?

It depends. First of all, whether fastcgi_cache is served from memory or not depends on your fastcgi_cache_path. If it’s set to a tmpfs mount, then yes, it will be in memory. If it’s set to a regular non-tmpfs directory, then it will be served from disk.

But disk doesn’t always mean the actual disk 🙂

When you access a file from disk, Linux will cache it in memory, so the next time you access the same file, it will be served from memory. This is why most tests with loader.io, apache-bench and other tools that “hammer” the same page are flawed. They all cause your stack to access and serve the same files available in memory. This is why your WP-Super-Cache PHP option is likely not causing significantly more disk IO than Nginx and thus seems just as fast with low concurrency.

Leave a Comment