cache large static files in memory

Hua Su huas.su at gmail.com
Wed Jun 24 14:54:14 MSD 2009


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?

On Wed, Jun 24, 2009 at 3:41 PM, Gabriel Ramuglia <gabe at vtunnel.com> wrote:

> I'm not exactly sure. Generally it works pretty well if you've got
> enough spare ram compared to the size of the files that need to be in
> the cache. There is a tendency to only buy as much ram for your server
> as you need to avoid swapping, but if you add a couple more gigs you
> can improve your i/o performance pretty significantly. That's also
> pretty cheap with ram prices so low these days.
>
> On Tue, Jun 23, 2009 at 11:18 PM, Hua Su<huas.su at gmail.com> wrote:
> > Thanks! So is there any guidance about how to configure cache behavior
> > of linux file systems to gain max performance?
> >
> > On Wed, Jun 24, 2009 at 1:53 PM, Gabriel Ramuglia <gabe at vtunnel.com>
> wrote:
> >>
> >> The linux file system will cache recently or frequently used files in
> >> memory regardless, and the effect is similar in performance to an
> >> application level cache. A separate application level cache would not
> >> necessarily be desirable since the file system cache would largely
> >> have the same items in it anyway; storing them again in an application
> >> level memory cache would simply leave less total memory available to
> >> file caching or other uses.
> >>
> >> On Tue, Jun 23, 2009 at 10:00 PM, Hua Su<huas.su at gmail.com> wrote:
> >> > Hi all,
> >> > Does nginx support to cache static files in memory if it finds several
> >> > large
> >> > files are requested frequently? If yes, how to control the cache? If
> >> > not, is
> >> > there any simple way to implement a similar function?
> >> > --
> >> > Hua Su
> >>
> >
> >
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://nginx.org/pipermail/nginx/attachments/20090624/2dfe647d/attachment.html>


More information about the nginx mailing list