Weird timeouts, not sure if I've set the right threshholds

Igor Sysoev is at rambler-co.ru
Sat May 3 10:04:37 MSD 2008


On Fri, May 02, 2008 at 04:44:21PM -0400, Denis S. Filimonov wrote:

> Can anyone explain the prejudice against NFS?
> 
> Specifically, why would additional proxy hop be faster than serving files from 
> NFS? 
> I can see two points in favor of NFS:
> - NFS client caches files while Nginx doesn't (yet)
> - Nginx doesn't support keepalive connections to upstream, hence additional 
> latencies and traffic for TCP handshake/finalization. NFS doesn't have this 
> issue since it typically works over UDP.
> 
> I do have a couple boxes serving a lot of traffic (mostly PHP) from NFS. It 
> works just fine, though it did take some NFS tuning.

All filesystems read operations are blocking operations, i.e. if file page
is not in VM cache, a process must wait for it. The only exception are
aio_read(), but it has its own drawbacks. Local filesystem with non-faulty
disks has constant blocking time: about 10-20ms, seek time. NFS may block
longer.

And blocked nginx worker can not handle other its connections, those
can be handled fast from VM cache/etc. You do not see it in PHP case,
because each PHP process handles the single connection at the same time.


-- 
Igor Sysoev
http://sysoev.ru/en/





More information about the nginx mailing list