I'm working to optimize APCu configuration on a set of busy servers. Last week we encountered a problem with APC, with these errors in our PHP logs
apc_add(): GC cache entry '....:' was on gc-list for 3601 seconds' of severity 2 in /.../index.php on line 55
I found this related SO thread, which has me considering setting our gc_ttl = 0
. Currently the value is gc_ttl = 3600
.
My guess is we have keys in the cache that are stale, but not getting entirely removed and thus available for reallocation by apc_store
calls. I'm unsure how to determine if this assumption is true though, any ideas? Will setting gc_ttl = 0
help to free slots for reallocation?
I find the graph of our memory usage interesting.
Below the pie graph it reads
Free: 264.9 MBytes (66.2%)
However the green section of the pie chart indicates only 161.4 MBytes is available.
Our current apcu configuration
; Enable apcu extension module
extension=apcu.so
apc.enable_cli=1
apc.enabled=1
apc.mmap_file_mask=/tmp/apc.XXXXXX
apc.shm_size=400M
apc.ttl=7200
apc.entries_hint=28000
It means that outdated value is still referenced and this message was changed from warning to debug long time ago https://github.com/krakjoe/apcu/pull/45/files with this PR https://github.com/krakjoe/apcu/pull/45.
Which means you must be on old APC version and it is better to upgrade. Anyway, it seems you can just ignore these warnings.