|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
[2011-06-16 14:29 UTC] znbailey at gmail dot com
Description: ------------ This new feature would establish a middle ground between having apc.stat enabled and checking mtime of every file every time it is loaded versus having apc.stat disabled and never checking. It would add a new configuration option, apc.stat_interval that could ideally be set to a value such as "30s", "1m", "1h", etc. (but could just be standardized on a number of seconds like the other TTL values). This interval would specify a "blackout period" after which a file is stat'ed, it would not be stat'ed again. Most APC tuning documentation strongly encourages disabling apc.stat to eek out additional performance. However this makes deployment much more difficult because it puts the developer in the position of having to either gracefully restart apache (and warm the cache or re- introduce traffic slowly) or otherwise manage the cache entries manually by calling apc_compile_file for changed files. By adding this option I believe you get the best of both worlds - automatic code reloads but not doing a stat EVERY time a file is accessed. Patcheslazy_stat.patch (last revision 2013-02-10 12:43 UTC by lazy404 at gmail dot com)Pull RequestsHistoryAllCommentsChangesGit/SVN commits
|
|||||||||||||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Wed Nov 05 11:00:02 2025 UTC |
on apc.h the quick, incomplete, example is (line 315) if ( !wrapper->wops->url_stat_interval > apc_time()- time_since_last){ return -1; } Would need : -a config variable set up for url_stat_variable. (package xml update, loading, etc) - a persistent variable to keep the last stat timePerhaps taking this a step farther, would be to allow an apc_*() function to mark the current file stat cache as "dirty". So instead of re-stating all files at some interval, it would stat the file when it caches the opcode; later at some point you could call some function (say apc_clear_cache('stat')), and that tells APC "from this point on, don't trust current stat data -- instead, restat the files and recache the new file stat data, evicting the opcode cache if the new file stat shows the file has been modified" The problem with the stat interval is that if limits you to only receiving updates to the files within "n" minutes/seconds. But currently the only way to update files in cache when stat is disabled, is by calling apc_clear_cache('system'), which forces *all* opcode entries to be removed. If you're only modifying a handful of files, that makes the full cache clear unnecessary.