docker icon indicating copy to clipboard operation
docker copied to clipboard

Increased performance by 10% with enabling opcache file caching

Open choward420 opened this issue 2 years ago • 4 comments

Not sure how to approach this but was hoping you could include in the build.

Changed /etc/php81/conf.d/opcache.ini

FROM: opcache.enable=1 opcache.enable_cli=1 opcache.fast_shutdown=1 opcache.memory_consumption=256 opcache.interned_strings_buffer=16 opcache.max_accelerated_files=10000 opcache.revalidate_freq=60

TO: opcache.enable=1 opcache.enable_cli=1 opcache.fast_shutdown=1 opcache.file_cache="/tmp/cache/" opcache.file_cache_only=0 opcache.file_cache_consistency_checks=1 opcache.memory_consumption=256 opcache.interned_strings_buffer=16 opcache.max_accelerated_files=10000 opcache.revalidate_freq=60

Ran the following based off of librenms performance recommendations: mkdir -p /tmp/cache && chmod 775 /tmp/cache && chown -R librenms /tmp/cache

choward420 avatar Apr 21 '23 15:04 choward420

opcache.revalidate_freq=60 should be removed and opcache.validate_timestamps=false should be added.

Jellyfrog avatar Apr 21 '23 15:04 Jellyfrog

Correction to my statement above, sudo is not installed in the docker so I ran the following: mkdir -p /tmp/cache && chmod 775 /tmp/cache && chown -R librenms /tmp/cache

choward420 avatar Apr 24 '23 13:04 choward420

10%

Can you post your benchmarks affirming this supposed percentage?

crazy-max avatar Jul 21 '23 22:07 crazy-max

80+ pollers running on different platforms, some virtualized, some containers, some virtualized running containers, etc. all experienced a ~10% decrease in devices polled when I upgraded to PHP8. After making the above changes, everything went back to the way it was. This wasn't an enhancement from the way it was, it just got me back to ground zero.

choward420 avatar Jul 26 '23 15:07 choward420