Nginx Fastcgi_cache performance - Disk cached VS tmpfs cached VS static file Nginx Fastcgi_cache performance - Disk cached VS tmpfs cached VS static file wordpress wordpress

Nginx Fastcgi_cache performance - Disk cached VS tmpfs cached VS static file


Here are short summary of investigation in nginx mailing list (see the thread here):

First of all, numbers reported are very low. They should be much bigger, and answering original question ("why difference") doesn't really make sense. Correct question would be "why so slow". Even a ec2 small instance should do better.

During the investigation host was found to be CPU bound, with gzip filter and pagespeed module being most CPU hungry.

Basic recommendations are:

  1. Use gzip_static for static files. It allows to serve a precompressed version and saves CPU at runtime.
  2. Avoid using high gzip compression levels (gzip_comp_level). High compression levels require a lot more CPU than the default (1), while size difference is small.
  3. Try switching off pagespeed to see if it helps.

With gzip off; pagespeed off; 30x speedup was reported.