Repository navigation
perf(php): stop OPcache timestamp checks and size it for Symfony apps - #59
Merged
Merged
Conversation
opcache.validate_timestamps is now driven by PHP_OPCACHE_VALIDATE_TIMESTAMPS, 0 by default in the Apache and FrankenPHP images: with revalidate_freq = 0, PHP was stat()ing every included file on every request. Set it to 1 when the sources are mounted and edited in place. The cache is also sized for a Symfony app and its vendors: max_accelerated_files 10000 -> 20000, interned_strings_buffer 8 -> 16 MB, memory_consumption 128 -> 256 MB. On a symfony/skeleton app in prod (2,300 PHP files, ab -c 8 inside the container, 2 CPUs), 8.5-symfony goes from ~3,000 to ~4,800 requests/s.
guillaume-sainthillier
enabled auto-merge
October 12, 2026 13:13
guillaume-sainthillier
added a commit
that referenced
this pull request
Oct 12, 2026
Same changes as #58 (Apache logs on stdout/stderr, php.ini-production, X-Forwarded-Proto, no health check in the CI image, Composer through install-php-extensions) and #59 (OPcache timestamps and sizing), so the 8.6 folders match 8.5 apart from the base image. conf/ is copied from _shared/ as it will be once both are merged; until then, running update.sh on this branch alone would revert it.
guillaume-sainthillier
added a commit
that referenced
this pull request
Oct 12, 2026
* feat: add PHP 8.6 release candidate images Add the 8.6, 8.6-ci and 8.6-symfony variants, copied from 8.5 and built from the upstream php:8.6-rc-apache / php:8.6-rc-alpine images (8.6.0RC3 today). They are published as silarhi/php-apache:8.6* and listed in the CI matrix and the Makefile; latest stays on 8.5 until 8.6.0 is released. FrankenPHP variants are not added yet: dunglas/frankenphp has no PHP 8.6 tag so far. * fix: apply the image and OPcache fixes to the PHP 8.6 images Same changes as #58 (Apache logs on stdout/stderr, php.ini-production, X-Forwarded-Proto, no health check in the CI image, Composer through install-php-extensions) and #59 (OPcache timestamps and sizing), so the 8.6 folders match 8.5 apart from the base image. conf/ is copied from _shared/ as it will be once both are merged; until then, running update.sh on this branch alone would revert it.
This was referenced Oct 12, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
OPcache no longer checks file timestamps by default (Apache and FrankenPHP images).
opcache.validate_timestampsnow readsPHP_OPCACHE_VALIDATE_TIMESTAMPS, set to0in the Dockerfiles. Before,revalidate_freq = 0made PHPstat()every included file on every request. SetPHP_OPCACHE_VALIDATE_TIMESTAMPS=1for bind-mounted sources edited in place (documented in a new README Configuration section).Cache sized for a Symfony app with its vendors:
max_accelerated_files10000 → 20000,interned_strings_buffer8 → 16 MB,memory_consumption128 → 256 MB.Benchmark
symfony/skeletonin prod (one route returningok, ~2,300 PHP files, classmap-authoritative, cache warmed), copied into the image,ab -n 4000 -c 8run inside the container,--cpus=2, 3 runs each:8.5-symfonyPHP_OPCACHE_VALIDATE_TIMESTAMPS=1The new sizes alone don't change this small app (it fits in the old limits); they prevent cache eviction on larger ones.
Notes
cache:clearon a live container, mounted sources) needsPHP_OPCACHE_VALIDATE_TIMESTAMPS=1.php.inithroughupdate.shbut noENV; an unset variable also reads as off. They aren't rebuilt by CI.conf/php.iniand are unchanged.