cache large static files in memory

Rush nginx-forum at
Fri Jun 26 02:48:36 MSD 2009

hua Wrote:
> It's noticed that Apache provides MMapFile directives in mod_file_cache, which allows you to have Apache
> map a static file's contents into memory at start time (using the mmap system call). 
> Apache will use the in-memory contents for all subsequent accesses to this file.
> Does NginX have similar module or configuration options?

mmap syscall doesn't mean file loaded into memory. It means that application can read/write file as memory, and two or more processes can share access to this file without allocating memory and load file into each other. eNGINeX doesn't need this feature, because it is FSM, and not read file at once, it read file piece by piece so fast as peer can receive. In this case best give OS to manage cache and files.

> > > Thanks! So is there any guidance about how to
> configure cache behavior
> > > of linux file systems to gain max
> performance?
This is offtopic, try google if you want to find answers :)

Posted at Nginx Forum:,3316,3398#msg-3398

More information about the nginx mailing list