<div>It&#39;s noticed that Apache provides MMapFile directives in mod_file_cache, which allows you to have Apache map a static file&#39;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.</div>
<div><br></div><div>Does NginX have similar module or configuration options?</div><br><div class="gmail_quote">On Wed, Jun 24, 2009 at 3:41 PM, Gabriel Ramuglia <span dir="ltr">&lt;<a href="mailto:gabe@vtunnel.com">gabe@vtunnel.com</a>&gt;</span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">I&#39;m not exactly sure. Generally it works pretty well if you&#39;ve got<br>
enough spare ram compared to the size of the files that need to be in<br>
the cache. There is a tendency to only buy as much ram for your server<br>
as you need to avoid swapping, but if you add a couple more gigs you<br>
can improve your i/o performance pretty significantly. That&#39;s also<br>
pretty cheap with ram prices so low these days.<br>
<div><div></div><div class="h5"><br>
On Tue, Jun 23, 2009 at 11:18 PM, Hua Su&lt;<a href="http://huas.su" target="_blank">huas.su</a>@<a href="http://gmail.com" target="_blank">gmail.com</a>&gt; wrote:<br>
&gt; Thanks! So is there any guidance about how to configure cache behavior<br>
&gt; of linux file systems to gain max performance?<br>
&gt;<br>
&gt; On Wed, Jun 24, 2009 at 1:53 PM, Gabriel Ramuglia &lt;<a href="mailto:gabe@vtunnel.com">gabe@vtunnel.com</a>&gt; wrote:<br>
&gt;&gt;<br>
&gt;&gt; The linux file system will cache recently or frequently used files in<br>
&gt;&gt; memory regardless, and the effect is similar in performance to an<br>
&gt;&gt; application level cache. A separate application level cache would not<br>
&gt;&gt; necessarily be desirable since the file system cache would largely<br>
&gt;&gt; have the same items in it anyway; storing them again in an application<br>
&gt;&gt; level memory cache would simply leave less total memory available to<br>
&gt;&gt; file caching or other uses.<br>
&gt;&gt;<br>
&gt;&gt; On Tue, Jun 23, 2009 at 10:00 PM, Hua Su&lt;<a href="http://huas.su" target="_blank">huas.su</a>@<a href="http://gmail.com" target="_blank">gmail.com</a>&gt; wrote:<br>
&gt;&gt; &gt; Hi all,<br>
&gt;&gt; &gt; Does nginx support to cache static files in memory if it finds several<br>
&gt;&gt; &gt; large<br>
&gt;&gt; &gt; files are requested frequently? If yes, how to control the cache? If<br>
&gt;&gt; &gt; not, is<br>
&gt;&gt; &gt; there any simple way to implement a similar function?<br>
&gt;&gt; &gt; --<br>
&gt;&gt; &gt; Hua Su<br>
&gt;&gt;<br>
&gt;<br>
&gt;<br>
<br>
</div></div></blockquote></div><br>