How to serve images from memory?

Evan Miller emiller at imvu.com
Mon Jul 2 19:29:02 UTC 2007


Evan Weaver wrote:
> I think Nginx can serve requests directly from memcached.

Yes, although you have to put the files in memcached some other way 
(i.e. Nginx is not a proxy cache like Squid). Config reference:

http://wiki.codemongers.com/NginxMemcachedModule

It does need an external module to behave like other memcache clients 
w.r.t. serving from multiple memcached servers:

http://wiki.codemongers.com/NginxHttpUpstreamRequestHashModule

Evan

> 
> Evan
> 
> On 7/2/07, Andrew Miehs <andrew at 2sheds.de> wrote:
>> On 02/07/2007, at 6:48 PM, Steve Grimm wrote:
>>
>> > On 7/1/07 5:59 PM, "Cathy Murphy" <cathy at nachofoto.com> wrote:
>> > > In Apache, is there a way to serve images from memory instead of
>> > disk?
>> >
>> > The easiest way is to make sure your server has enough memory for
>> > all the images (which you'd obviously need anyway) then just let
>> > the OS's buffer cache keep all the files in memory. You can mount
>> > the image filesystem with the "noatime" option or equivalent (check
>> > your OS's docs to see what it's called in your environment) to
>> > prevent it from writing out the last access time when a file is read.
>>
>> We tried this with Linux 2.6.(15) (or something around that version).
>> The file system cache didn't seem very efficient with lots of small
>> files.
>> (We also set noatime)...
>>
>> In the end Squid caching in memory with Lighttpd was the quickest
>> solution we could find.
>> BTW: Squid caching to disk was slower than Lighttpd pulling the data
>> from disk.
>>
>> > It doesn't guarantee you no disk accesses, of course, but it's MUCH
>> > easier to set up than the alternatives and for most purposes should
>> > offer you about the same performance.
>>
>> I would like to try lighttpd with mod_mem_cache in the near future to
>> replace the squids...(nothing to do with memcached)
>>
>> Cheers
>>
>> Andrew
>>
> 
> 



More information about the memcached mailing list