Prevent unnecessarily frequent default expunge operations
A full cache wipe is now performed if too little SHM has been freed by removing expired entries during the default expunge operation. This is intended to prevent unnecessarily frequent calls of the default expunge operation, which should reduce cpu load in some cases. The new configuration setting apc.expunge_threshold defaults to 5 (0.5%) and specifies the thousandth of SHM that must be available after expired entries have been removed during the default expunge operation. Since apc.expunge_threshold replaces apc.smart, apc.smart has been removed.
This is my suggestion for reducing high CPU usage caused by frequently executed default expunge operations.
In my tests, this seemed effective. The number of cleanups and defragmentations decreased, while the number of expunges remained constant.
Even if it works well with 1 %, it would also be reasonable to use thousendth instead of percent. If the general concept is ok, i could do some additional testing + tuning with values lower than 1 %.
@nikic Friendly ping.
We should take care of this PR first, as it affects the test results of #589. If this is merged, I'd like to do some more testing / fine-tuning with #589 before it is merged.
Fixed. Yes, that's a good idea. It's easier to understand and more flexible.
I wonder whether it would make sense to create a release from the current master branch before merging this.
I wonder whether it would make sense to create a release from the current master branch before merging this.
I agree. It probably wouldn't hurt, but this is the safer approach.
But please take a look at #606 before creating a release.
@nikic I just saw that you released version 5.1.28 on pecl, but the release isn't available on GitHub yet…
@nikic I just saw that you released version 5.1.28 on pecl, but the release isn't available on GitHub yet…
Oops, fixed.