On 06/09/2016 11:15 AM, Per Jessen wrote:
Anton Aylward wrote:
On 06/09/2016 10:32 AM, Per Jessen wrote:
On my test-system, a plain office PC, but directly attached disk (vs. iSCSI), the 15000 lstat calls are done in about 500ms.
Still, the matter of why there are 15,000 lstat() calls is unresolved.
That is actually well explained in the bugreport and the link:
http://grokbase.com/t/php/php-internals/087f1t68mm/lstat-call-on-each-direct...
"well explained" = it sounds reasonable. I won't pretend to have familiarized myself with the php internals to that level.
Its doing something that, perhaps, Apache should be doing. I look at that
<?php $fp=fopen("/var/www/metacafe/test","r"); fclose($fp); ?>
When running with strace -e lstat I see this: lstat("/var", {st_mode=S_IFDIR|0755, st_size=4096, ...}) = 0 lstat("/var/www", {st_mode=S_IFDIR|0755, st_size=12288, ...}) = 0 lstat("/var/www/metacafe", {st_mode=S_IFDIR|0755, st_size=4096, ...}) =
lstat("/var/www/metacafe/test", 0x7fbfff9b10) = -1 ENOENT (No such file or directory)
and I think its doing
I want to get to "/var/www/metacafe/test". Can I access "/var"?
lstat("/var", {st_mode=S_IFDIR|0755, st_size=4096, ...}) = 0
Yes I can. Can I get to "/var/www"?
lstat("/var/www", {st_mode=S_IFDIR|0755 st_size=12288, ...}) = 0
Yes I can. Can I get to "/var/www/metacafe/test"?
lstat("/var/www/metacafe", {st_mode=S_IFDIR|0755, st_size=4096, ...}) =
lstat("/var/www/metacafe/test", 0x7fbfff9b10) = -1 ENOENT (No such file or directory)
No I can't. This doesn’t explain why it scans so many files, though. And yes, moving the base up makes sense. I have a number of applications installed in ... well on my system its "/srv/www/htdocs/:. As far as, in my case, "owncloud" goes, its base is set to "/srv/www/htdocs/owncloud/" to start with; that's its logical root. This should be taken care of by the vhost configuration. Yes, it means you are now down to one or two lstat() calls per file, but it still doesn’t explain why it needs to do the 4500 files. Quite apart from the caching that PHP may or may not be doing between HTTP invocations (probably not, this is a connectionless protocol remember) there should be inode and pathname caching done by the kernel. It won't be so effective in a shared environment, competing with other users opening and stating files. -- A: Yes. > Q: Are you sure? >> A: Because it reverses the logical flow of conversation. >>> Q: Why is top posting frowned upon? -- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org To contact the owner, e-mail: opensuse+owner@opensuse.org