Re: [PHP-DEV] lstat call on each directory level

2008-07-16 Thread Rasmus Lerdorf
Arvids Godjuks wrote: Yesterday I made some tests on my site with strace to see how much lstat I have and how can I optimize them. Well, I managed to get rid of them almost at all, but now I have some questions about include_path and including files based on current dir. I have such structire of

Re: [PHP-DEV] lstat call on each directory level

2008-07-16 Thread Arvids Godjuks
Yesterday I made some tests on my site with strace to see how much lstat I have and how can I optimize them. Well, I managed to get rid of them almost at all, but now I have some questions about include_path and including files based on current dir. I have such structire of files /home/file/www (

Re: [PHP-DEV] lstat call on each directory level

2008-07-16 Thread Rasmus Lerdorf
Amir Hardon wrote: On Wed, 2008-07-16 at 06:45 -0700, Rasmus Lerdorf wrote: Arvids Godjuks wrote: > Hello. > > I think this should be optimized. > I'm not an expert ofcourse, but as I understood there is only one case > witch need a special treatment - require/include _one when a file with >

Re: [PHP-DEV] lstat call on each directory level

2008-07-16 Thread Amir Hardon
On Wed, 2008-07-16 at 06:45 -0700, Rasmus Lerdorf wrote: > Arvids Godjuks wrote: > > Hello. > > > > I think this should be optimized. > > I'm not an expert ofcourse, but as I understood there is only one case > > witch need a special treatment - require/include _one when a file with > > equal cont

Re: [PHP-DEV] lstat call on each directory level

2008-07-16 Thread Rasmus Lerdorf
Arvids Godjuks wrote: Hello. I think this should be optimized. I'm not an expert ofcourse, but as I understood there is only one case witch need a special treatment - require/include _one when a file with equal contents is included from different directories. You can make a switch witch controls

Re: [PHP-DEV] lstat call on each directory level

2008-07-16 Thread Arvids Godjuks
Hello. I think this should be optimized. I'm not an expert ofcourse, but as I understood there is only one case witch need a special treatment - require/include _one when a file with equal contents is included from different directories. You can make a switch witch controls if lstat is made or not

Re: [PHP-DEV] lstat call on each directory level

2008-07-15 Thread Oleg Grenrus
There is apc.include_once_override Optimize include_once() and require_once() calls and avoid the expensive system calls used. and apc.stat Be careful if you change this setting. The default is for this to be On which means that APC will stat (check) the script on each request to see if it has b

Re: [PHP-DEV] lstat call on each directory level

2008-07-15 Thread Rasmus Lerdorf
Lars Strojny wrote: Hi Rasmus, Am Dienstag, den 15.07.2008, 11:40 -0700 schrieb Rasmus Lerdorf: [...] That's a realpath() call and it should be getting cached by the realpath cache, so if you are seeing these on every request, try increasing your realpath_cache size in your .ini. Without chec

Re: [PHP-DEV] lstat call on each directory level

2008-07-15 Thread Lars Strojny
Hi Rasmus, Am Dienstag, den 15.07.2008, 11:40 -0700 schrieb Rasmus Lerdorf: [...] > That's a realpath() call and it should be getting cached by the realpath > cache, so if you are seeing these on every request, try increasing your > realpath_cache size in your .ini. Without checking the realpat

Re: [PHP-DEV] lstat call on each directory level

2008-07-15 Thread Derick Rethans
On Tue, 15 Jul 2008, Amir Hardon wrote: > About the issue with the _once, did the patch Derick offered handles > it (I haven't examined it yet). If not, I just need to make sure that > the same file isn't being referenced by two paths and I'm safe right? It does not do any real path checks, so

Re: [PHP-DEV] lstat call on each directory level

2008-07-15 Thread Travis Swicegood
On Jul 15, 2008, at 2:25 PM, Rasmus Lerdorf wrote: Well, it is used in other places too, like in figuring out _once paths. Including the same file using different paths still needs to be caught. Are you calling clearstatcache() manually anywhere? That blows away the entire realpath cach

Re: [PHP-DEV] lstat call on each directory level

2008-07-15 Thread Amir Hardon
On Tue, 2008-07-15 at 12:25 -0700, Rasmus Lerdorf wrote: > Amir Hardon wrote: > > On Tue, 2008-07-15 at 11:40 -0700, Rasmus Lerdorf wrote: > >> Amir Hardon wrote: > >> > I've noticed a weird behavior when doing file access from PHP: > >> > PHP seems to make an lstat call on each of the parent dire

Re: [PHP-DEV] lstat call on each directory level

2008-07-15 Thread Rasmus Lerdorf
Amir Hardon wrote: On Tue, 2008-07-15 at 11:40 -0700, Rasmus Lerdorf wrote: Amir Hardon wrote: > I've noticed a weird behavior when doing file access from PHP: > PHP seems to make an lstat call on each of the parent directories of the > accessed file, for example see this script: > > > $fp=fop

Re: [PHP-DEV] lstat call on each directory level

2008-07-15 Thread Derick Rethans
On Tue, 15 Jul 2008, Amir Hardon wrote: > On Tue, 2008-07-15 at 11:40 -0700, Rasmus Lerdorf wrote: > > > That's a realpath() call and it should be getting cached by the > > realpath cache, so if you are seeing these on every request, try > > increasing your realpath_cache size in your .ini. Wi

Re: [PHP-DEV] lstat call on each directory level

2008-07-15 Thread Amir Hardon
On Tue, 2008-07-15 at 11:40 -0700, Rasmus Lerdorf wrote: > Amir Hardon wrote: > > I've noticed a weird behavior when doing file access from PHP: > > PHP seems to make an lstat call on each of the parent directories of the > > accessed file, for example see this script: > > > > > $fp=fopen("/var/

Re: [PHP-DEV] lstat call on each directory level

2008-07-15 Thread Rasmus Lerdorf
Amir Hardon wrote: I've noticed a weird behavior when doing file access from PHP: PHP seems to make an lstat call on each of the parent directories of the accessed file, for example see this script: When running with strace -e lstat I see this: lstat("/var", {st_mode=S_IFDIR|0755, st_size=4096

[PHP-DEV] lstat call on each directory level

2008-07-15 Thread Amir Hardon
Hi, I've noticed a weird behavior when doing file access from PHP: PHP seems to make an lstat call on each of the parent directories of the accessed file, for example see this script: When running with strace -e lstat I see this: lstat("/var", {st_mode=S_IFDIR|0755, st_size=4096, ...}) = 0 lsta