When APC cache is full, it hangs Apache. Apache responds to requests, however waits forever for APC cache to free some resources, but this will never happen.
I run every 10 minutes CRON job with my own small expunge script, which deletes expired entries from APC. Ok, I could add more memory to APC and/or I could run the expunge script more often. But that's not real solution, I am looking for some new way how to deal with issue.
I find that setting a ttl changes APC's behavior when cache is full. By default, if the ttl is 0, APC has to empty the cache when it gets full. From the manual:
In the event of a cache running out of available memory,the cache will be completely expunged if ttl is equal to 0. Otherwise, if the ttl is greater than 0, APC will attempt to remove expired entries.
It's not really the final solution, but I have written small PHP APC expunge script that I had proposed in my question. This script is run by CRON every 10 minutes and it manually removes expired items. It's far not perfect solution, but at least it helps a lot.
I am though still looking for final solution.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With