[arch-dev-public] APC cache tweaks

Dan McGee dpmcgee at gmail.com
Mon Dec 8 21:47:41 EST 2008

I gave the APC PHP Cache (go go repitition) some tweaks tonight. The
change was setting the "apc.stat" configuration option to 0, which
means we will no longer stat PHP files each time access is attempted.
This means if you change a piece of PHP running on gerolde, it won't
get updated once it has been cached, which is the first time it is

The benefits of this change- an even smoother running server. Plz ./
us. We spent a surprisingly large amount of time waiting on the stat()
system call in httpd, and this removes almost all of the system CPU
time on our machine, leaving only user CPU time.

The drawbacks? If you have local PHP files that you edit and redeploy,
you will have problems as the cached version will constantly be used.
There are also issues with templating on the wiki and other fun
things. This is *really* easy to get around, however- simply clear the
APC cache and everything gets reread and reloaded. Go go PHP security,
just drop this in your public_html and run it:


Because of the way PunBB does "caching" of bans and such, I added this
cache invalidation stuff to the locations where it writes things out
in its PHP cache directory. If there are other services that need the
same tweaking, let me know.


More information about the arch-dev-public mailing list