Lots of fstat() calls in PHP 5.3
| From: | Olga Khenkin | Date: | Wed, 19 Aug 2009 08:11:12 +0000 |
| Subject: | Lots of fstat() calls in PHP 5.3 | ||
| References: | 1 2 3 4 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-296954@lists.php.net to get a copy of this message | ||
Hi,
We recently upgraded our web servers with PHP 5.3 and found out that
there are lots of fstat() calls. fstat() is called 3 times on each file
open. Do you know why this happens and how can these calls be reduced?
We're running Red Hat 3.4.6, Apache 2.0.59, PHP 5.3.0 with APC.
Here's strace example (I replaced full paths by [PATH]):
open("[PATH]/RecommendationsManager.php", O_RDONLY) = 19
fstat(19, {st_mode=S_IFREG|0777, st_size=16937, ...}) = 0
fstat(19, {st_mode=S_IFREG|0777, st_size=16937, ...}) = 0
fstat(19, {st_mode=S_IFREG|0777, st_size=16937, ...}) = 0
mmap(NULL, 16937, PROT_READ, MAP_SHARED, 19, 0) = 0x2a9f441000
stat[PATH]RecommendationsManager.php", {st_mode=S_IFREG|0777,
st_size=16937, ...}) = 0
munmap(0x2a9f441000, 16937) = 0
close(19) = 0
open[PATH]/Recommendations.php", O_RDONLY) = 19
fstat(19, {st_mode=S_IFREG|0777, st_size=10695, ...}) = 0
fstat(19, {st_mode=S_IFREG|0777, st_size=10695, ...}) = 0
fstat(19, {st_mode=S_IFREG|0777, st_size=10695, ...}) = 0
mmap(NULL, 10695, PROT_READ, MAP_SHARED, 19, 0) = 0x2a9f441000
stat([PATH]/Recommendations.php", {st_mode=S_IFREG|0777, st_size=10695,
...}) = 0
mmap(NULL, 266240, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1,
0) = 0x2a9f444000
munmap(0x2a9f441000, 10695) = 0
close(19) = 0
Thanks,
Olga.