Roland Mieslinger wrote:
> Hello,
> 
> we're managing a shared hosting environment with about 600 virtual
> servers. All content for the websites is stored on a NFS share.
> 
> We're suffering from a huge amount of lstat calls, and identified 
> open_basedir as the reason for that. strace shows that each call
> needs 40µs in average, this is due to NFS.
> 
> A lot of questions arises from that, but some answers are still missing.
> Maybe I can get them here.
> 
> Did open_basedir rely on realpathcache? I haven't found a definitive
> answer to that. We have changed realpath cache size, without any impact.
> So I assume the answer is no.
> 
>>From what I understand realpathcache is different from statcache. So
> using clearstatcache should not flush the realpathcache. Am I correct?

clearstatcache does flush the realpathcache in PHP 5.2.  This has been
turned off by default in 5.3 and is now an option on the
clearstatcache() call.

The realpathcache in 5.3 is also more efficient now in that it will
cache partial paths.  In 5.2 we relied on the system's realpath() call
and only cached complete results from it.  That also meant that there is
no negative caching going on, so if you have a bunch of include_path
misses, you are going to die a slow stat death in 5.2.

In 5.2 make sure your main include_path dir is the first path in the
order there.  Put "." at the end and always use include './foo.php' when
you include something relative to the script's directory.  That should
alleviate a lot of the stat issues.

-Rasmus

-- 
PHP Internals - PHP Runtime Development Mailing List
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to