Re: PHP causing high number of NFS getattr operations?

From: Date: Mon, 18 Feb 2013 20:35:20 +0000
Subject: Re: PHP causing high number of NFS getattr operations?
References: 1  Groups: php.internals 
Request: Send a blank email to [email protected] to get a copy of this message
On 02/18/2013 12:26 PM, Brendon Colby wrote:

> Rasmus said:
> 
> "Just because you see an open() syscall doesn't mean the cache isn't
> used. The open() is there because PHP by default does open+fstat for
> performance reasons. If you look carefully you will see there is just
> an open() and no read() calls. So it opens the file, uses the stat
> struct from the open fd to get the inode and fetches the op_array from
> the opcode cache. This can be made more efficient, but this report is
> incorrect in assuming the cache isn't being used."
> 
> This is exactly what I'm seeing when I strace an httpd process -
> mostly open() and fstat() calls w/o any read() calls. This makes sense
> to me, however, the problem with this is as far as I understand it,
> that an open() on an NFS file system causes an automatic gettattr()
> call to the server. Doing this completely bypasses the NFS attribute
> cache, which is why we're seeing so many getattr requests to our NFS
> server despite having an attribute cache timeout of 60 seconds. For
> those familiar with NFS, we could just as well disable our attribute
> cache at this point, which is almost never recommended because of
> performance reasons.

Wow, people are still serving web files over NFS? Sounds painful.

But, this is what APC's apc.include_once_override setting tries to
address. Try turning that on.

-Rasmus


Thread (33 messages)

« previous php.internals (#65909) next »