Bug #66999 [Opn->Csd]: Unnecessary system calls when opcache.validate_timestamps is disabled

From: Date: Tue, 21 Oct 2014 13:49:58 +0000
Subject: Bug #66999 [Opn->Csd]: Unnecessary system calls when opcache.validate_timestamps is disabled
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-188226@lists.php.net to get a copy of this message
Edit report at https://bugs.php.net/bug.php?id=66999&edit=1

 ID:                 66999
 Updated by:         jpauli@php.net
 Reported by:        leonid at komarovsky dot info
 Summary:            Unnecessary system calls when
                     opcache.validate_timestamps is disabled
-Status:             Open
+Status:             Closed
 Type:               Bug
 Package:            opcache
 Operating System:   Amazon Linux AMI release 2014.03
 PHP Version:        5.5.10
-Assigned To:        
+Assigned To:        jpauli
 Block user comment: N
 Private report:     N

 New Comment:

Sorry, but your problem does not imply a bug in PHP itself.  For a
list of more appropriate places to ask for help using PHP, please
visit http://www.php.net/support.php as this bug system
is not the
appropriate forum for asking support questions.  Due to the volume
of reports we can not explain in detail here why your report is not
a bug.  The support channels will be able to provide an explanation
for you.

Thank you for your interest in PHP.

Hello,

Unfortunately, OPcache does not permit this.
Before OPcache comes to play, PHP already has checked for every file you ask it to run, and even
more : it has open()ed them, thus generating system calls to at least check that the file exists
(F_OK), and even more depending on libc's implementation.

Only after the file has been successfully opened, and a file descriptor has been obtained, then the
flow is passed to OPCache for furter work.


Previous Comments:
------------------------------------------------------------------------
[2014-04-01 12:48:29] leonid at komarovsky dot info

Description:
------------
When opcache.validate_timestamps is disabled, there are still access/stat calls for files that are
already in cache.


Expected result:
----------------
No stat/access calls for cached files

Actual result:
--------------
Below is an example of the strace output for the second time the page is requested

25780 access("/var/www/html/test/app/cache/prod/jms_serializer", W_OK) = 0
25780
access("/var/www/html/test/vendor/jms/serializer/src/JMS/Serializer/Naming/IdenticalPropertyNamingStrategy.php",
F_OK) = 0
25780
access("/var/www/html/test/vendor/jms/serializer/src/JMS/Serializer/Naming/PropertyNamingStrategyInterface.php",
F_OK) = 0
25780
access("/var/www/html/test/vendor/nelmio/api-doc-bundle/Nelmio/ApiDocBundle/Formatter/HtmlFormatter.php",
F_OK) = 0
25780
access("/var/www/html/test/vendor/nelmio/api-doc-bundle/Nelmio/ApiDocBundle/Formatter/AbstractFormatter.php",
F_OK) = 0
25780
access("/var/www/html/test/vendor/nelmio/api-doc-bundle/Nelmio/ApiDocBundle/Formatter/FormatterInterface.php",
F_OK) = 0
25780
access("/var/www/html/test/vendor/symfony/symfony/src/Symfony/Bundle/FrameworkBundle/Templating/DelegatingEngine.php",
F_OK) = 0
25780
access("/var/www/html/test/vendor/symfony/symfony/src/Symfony/Component/Templating/DelegatingEngine.php",
F_OK) = 0
25780
access("/var/www/html/test/vendor/symfony/symfony/src/Symfony/Component/Templating/StreamingEngineInterface.php",
F_OK) = 0
25780
access("/var/www/html/test/vendor/symfony/symfony/src/Symfony/Bundle/TwigBundle/TwigEngine.php",
F_OK) = 0
25780
access("/var/www/html/test/vendor/symfony/symfony/src/Symfony/Bridge/Twig/TwigEngine.php",
F_OK) = 0
25780
access("/var/www/html/test/vendor/symfony/symfony/src/Symfony/Bundle/TwigBundle/Loader/FilesystemLoader.php",
F_OK) = 0
25780 access("/var/www/html/test/vendor/twig/twig/lib/Twig/Loader/Filesystem.php", F_OK) =
0
25780 access("/var/www/html/test/vendor/twig/twig/lib/Twig/ExistsLoaderInterface.php",
F_OK) = 0
25780 stat("/var/www/html/test/app/cache/prod/templates.php", {st_mode=S_IFREG|0775,
st_size=18992, ...}) = 0
25780
stat("/var/www/html/test/active_release/vendor/symfony/symfony/src/Symfony/Bundle/FrameworkBundle/Resources/views",
{st_mode=S_IFDIR|S_ISGID|0775, st_size=4096, ...}) = 0
25780
stat("/var/www/html/test/active_release/vendor/symfony/symfony/src/Symfony/Bundle/TwigBundle/Resources/views",
{st_mode=S_IFDIR|S_ISGID|0775, st_size=4096, ...}) = 0
25780
stat("/var/www/html/test/active_release/vendor/doctrine/doctrine-bundle/Doctrine/Bundle/DoctrineBundle/Resources/views",
{st_mode=S_IFDIR|S_ISGID|0775, st_size=4096, ...}) = 0
25780 stat("/var/www/html/test/active_release/app/Resources/NelmioApiDocBundle/views",
{st_mode=S_IFDIR|S_ISGID|0775, st_size=4096, ...}) = 0
25780
stat("/var/www/html/test/active_release/vendor/nelmio/api-doc-bundle/Nelmio/ApiDocBundle/Resources/views",
{st_mode=S_IFDIR|S_ISGID|0775,


------------------------------------------------------------------------



--
Edit this bug report at https://bugs.php.net/bug.php?id=66999&edit=1


Thread (2 messages)

« previous php.bugs (#188226) next »