<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
  <meta content="text/html;charset=ISO-8859-1" http-equiv="Content-Type">
</head>
<body bgcolor="#ffffff" text="#000000">
When I tested using memcached vs files on the filesystem, there wasn't
much difference between them, and sometimes using memcached fared worse
than directly sending the files from the filesystem (this would
probably vary quite a bit, depending on the system).<br>
<br>
The reason for this is that the overhead of creating a request to a
memcached server, sending the request, waiting for the response (which
is done asynchronously so as not to block the server), then handling
the response is 'relatively' high.<br>
<br>
If the memory cache was instead integrated into Nginx, rather than
using an external process like memcached, then it would almost
certainly be quite a bit quicker.&nbsp; As far as I know, there isn't an
internal memory-cache module for Nginx yet (I'm not sure if ncache has
included memory caching yet, or if they intend on doing so).<br>
<br>
As Atif says, there is little benefit to using memcache for serving
static files, but there definitely is for dynamically-generated files.<br>
<br>
As for Perl, I believe the current implementation is still blocking
(i.e. you can't currently generate Perl in the background whilst still
serving static files, you can either do one or the other). This would
kill the performance terribly.<br>
<br>
For populating the cache, have you looked at the error_file directive.&nbsp;
You can set the error file to script which could be passed to an FCGI
process, so that on a cache-miss the script is called to generate the
page, which could in the process put the file into the memcached
cache.&nbsp; This of course only really makes sense for dynamically-generate
content.<br>
<br>
Marcus.<br>
&nbsp;<br>
<br>
Atif Ghaffar wrote:
<blockquote
 cite="mid:f240b640903050242j7bf50243w9676fabbd240e78f@mail.gmail.com"
 type="cite">Daniel, <br>
  <br>
I see now your other posts, <br>
  <br>
I do not think that you will get any benifit of using memcached with
static files.<br>
Nginx is already very optimized at serving static files.<br>
  <br>
  <br>
  <div class="gmail_quote">On Wed, Mar 4, 2009 at 11:17 PM, Daniel
Rhoden <span dir="ltr">&lt;<a moz-do-not-send="true"
 href="mailto:drhoden@iiwinc.com">drhoden@iiwinc.com</a>&gt;</span>
wrote:<br>
  <blockquote class="gmail_quote"
 style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">This
is purely speculative, so please don't think I know how to do this.
&nbsp;I'm throwing this out so hopefully, if a good idea, the right people
can create the example.<br>
    <br>
Memcached has a good assortment of Perl clients.<br>
    <br>
Nginx has a means of embedding Perl into the configuration.<br>
    <br>
Couldn't there be a way of combining these to immediately populate the
cache when the cache returns missing?<br>
    <br>
By the way, I'm looking at this as a means of improving I/O for static
pages (on SliceHost). &nbsp;Ideally nginx's Memcached Module would have the
ability to do this when the requested filename exists on the hard drive:<br>
(-f $request_filename/index.html)<br>
    <font color="#888888"><br>
    <br>
Daniel Rhoden<br>
Director of Information Technology<br>
Interactive Internet Websites, Inc.<br>
3854 - 2 Killearn Court<br>
Tallahassee, Florida 32309<br>
Voice: (256) 878-5554<br>
E-Mail: <a moz-do-not-send="true" href="mailto:drhoden@iiwinc.com"
 target="_blank">drhoden@iiwinc.com</a><br>
Website: <a moz-do-not-send="true" href="http://iiwinc.com"
 target="_blank">iiwinc.com</a><br>
    <br>
    <br>
    </font></blockquote>
  </div>
  <br>
  <br clear="all">
  <br>
-- <br>
best regards<br>
Atif Ghaffar<br>
</blockquote>
<br>
</body>
</html>