Igor Sysoev is at
Sat Dec 23 10:52:52 MSK 2006

On Sat, 23 Dec 2006, Jason B wrote:

> On 22/12/2006, at 12:21 AM, Igor Sysoev wrote:
>>         location / {
>>             memcached_pass   name:11211;
>>             error_page       404  /fallback;
>>         }
>>         location = /fallback {
>>             proxy_pass       backend;
>>         }
> Thanks for the reply Igor
> Is it possible to ask Nginx to look in Memcached, but if not found to look on 
> the local filesystem before passing to the backend?
> That would make things more efficient?

Yes, it's possible, but it would not be more efficient.

Sending file from local file system is most efficient way if kernel VM
have cached that file: then sendfile() will be zero-copy operation:
you save memory and CPU.

Working with memcached or backend requires
1) copy operations to kernel by memcached or backend,
2) then copy operations from kernel by nginx,
2) then copy operations to kernel by nginx

If memcached or backend are on the same computer as nginx, then
all these operations involve context switches between nginx and memcached
or backend.

Igor Sysoev

More information about the nginx mailing list