Hi moodlers!
I have a general question concerning opcache revalidate frequency. From the opcache article in moodle docs http://docs.moodle.org/27/en/OPcache :
opcache.revalidate_freq = 60
From the PHP docs http://www.php.net/manual/en/opcache.configuration.php#ini.opcache.revalidate-freq
How often to check script timestamps for updates, in seconds. 0 will result in OPcache checking for updates on every request.
So, in attempting to achieve a balance between caching PHP code for performance, but not having to restart the webserver each time some PHP code is edited/generated, a recommendation of 60 seconds is given. I'm curious on what the justification for this value is (and why this is needed at all). If I assume that PHP code changes to the webserver are controlled properly, a process of update / run opcache_reset() would suffice. Perhaps resetting the cache for the entire codebase is a bit heavy handed, when by revalidating timestamps after 60 seconds, small code changes can be deployed quickly enough?
The answer might also be in dynamically generated PHP code (Even when the file creation date is greater than the cache timestamp). Perhaps the cache folder in moodledata for example, config.php? This could be accounted for by invalidating the file after it is generated, or by the use of opcache.blacklist_filename.
Does anyone have any thoughts on this? Is anyone aware of the coverage of dynamically generated PHP files in moodle core (and add-on plugins). Is there any other justification for the recommended setting that I haven't thought of?
Cheers,
-David