Hacker News new | ask | show | jobs
by falcolas 4099 days ago
One quick note: Nginx does not serve any of its caches out of memory, it's served from disk. This is a difference without distinction when you have lots of memory, since Nginx will end up sendfile-ing the file from the disk cache, but it's worth noting.
1 comments

But if the nginx cache path is set to a tmpfs volume then it's stored in memory and being served from memory.
On a machine with enough memory, this is an unnecessary optimization. In most use cases, Nginx will be serving a number of static assets from disk in addition to the cached files, and allowing for more memory to be used on the OS' disk cache will make the entire site more responsive.