PHP 8.6 versus 8.5: twelve per cent faster, 40 MiB more memory
For anyone running PHP on FrankenPHP in worker mode who wants to know what PHP 8.6 brings in performance. I ran the same application once on PHP 8.5 and once on PHP 8.6. Code, data and server were the same; only the runtime image differed. The test subject was this blog, a TYPO3 installation with eleven typical pages. It is a small comparison with few requests, not a load test. This post shows response times, CPU and memory, how the numbers came about and where not to trust them.
01 — How the comparison was set up
Measuring production would have been imprecise. Visitors, bots and the edge cache change every number there. So the comparison ran on a copy in the same cluster. It had its own database from the nightly dump, a copy of the media and keys of its own. From outside it sat behind Basic-Auth and was closed to search engines.
For both versions:
- Same artefact: the same application code, signed and pinned to the same digest.
- Same environment: one app pod, the same node, the same database and the same cache.
- One difference: the runtime image with FrankenPHP in worker mode, once with PHP 8.5.13, once with PHP 8.6.0.
The hardware and the container's limits:
| Component | Specification |
|---|---|
| Server | AWS EC2 m8g.xlarge: 4 vCPU (Graviton4, ARM64, 2.8 GHz), 16 GiB RAM |
| System | Amazon Linux 2023, Kubernetes (k3s) |
| App container | guaranteed 0.3 CPU and 384 MiB RAM, limit 2 CPU and 1 GiB RAM |
| PHP server | FrankenPHP in worker mode, workers restart after 500 requests |
| Database | MariaDB 11.8 in its own pod on the same server |
| Cache | Valkey in its own pod |
| Application | TYPO3 14, two websites with two languages each |
The server was not exclusive. Other applications of the platform ran on it too. That explains part of the spread between rounds.
A functional test came before the numbers. Eleven typical pages returned the same status code, title, links, navigation and images on both versions. The installation's code needed no change for 8.6.
02 — The method
I measured in rounds. Each round first cleared the TYPO3 caches with cache:flush. A script then requested the eleven pages one after another, once cold and once warm. Cold means TYPO3 renders every page afresh. Warm means the page comes from the TYPO3 cache. Five rounds per version gave 55 cold and 55 warm values.
The time comes from the log of the reverse proxy directly in front of PHP, so network and browser drop out. A Cache-Control: no-cache on the request bypassed the edge cache. Two seconds passed between requests. What is measured is the response time of a single request.
This is a small test, not a load test. Each version saw 110 requests, only ever one at a time. These numbers say nothing about how 8.6 behaves under many parallel requests.
CPU and memory came from a second run on the same pattern. Before and after each phase, a script read the cgroup counters of the app container: cpu.stat for CPU time, memory.stat for memory. The baseline the container uses when idle was subtracted from the CPU time. Prometheus was too coarse for this. A measuring window of just under 30 seconds is hardly longer than a scrape interval.
03 — Two traps in measuring
The first comparison ran with a Python script and showed odd values. The pages send an interim 103 Early Hints response first, and Python's standard library does not handle it cleanly. With curl the outliers disappeared. If you measure yourself, check the tool first.
The second trap came from my own automation. The dependency bot updated the 8.6 image twelve times that day, and GitOps rolled out every new version at once. One such rollout replaced the image I had set by hand, in the middle of the 8.5 run. That made two rounds worthless. I discarded them and measured two new ones.
04 — Response times
| Metric | PHP 8.5.13 | PHP 8.6.0 |
|---|---|---|
| Cold, median | 179 ms | 157 ms |
| Cold, mean | 212 ms | 177 ms |
| Cold, p90 | 354 ms | 335 ms |
| Cold, maximum | 638 ms | 396 ms |
| Warm, median | 34 ms | 32 ms |
| Warm, p90 | 87 ms | 45 ms |
| Warm, maximum | 130 ms | 83 ms |
Cold, PHP 8.6 is 12 per cent faster in the median and 17 per cent in the mean. The slow cases shrink the most. The slowest cold request fell from 638 to 396 milliseconds. Warm, both versions are equally fast in the median, but 8.6 has hardly any outliers left.
Per page, 8.6 is faster cold on eight of eleven pages. Long articles with many content elements gain the most, one of them from 407 to 305 milliseconds. Level or slightly behind are the home page, an article heavy on code and the glossary with its many entries.
The rounds scatter. Their cold medians ranged from 149 to 232 milliseconds on 8.5 and from 122 to 187 on 8.6. The direction is clear; the exact percentage is not.
05 — CPU and memory
| Metric | PHP 8.5.13 | PHP 8.6.0 |
|---|---|---|
| CPU per page, cold (median) | 136 ms | 115 ms |
| CPU per page, warm (median) | 33 ms | 19 ms |
| Idle baseline | 10 ms/s | 12 ms/s |
| Memory, anonymous | 232 MiB | 271 MiB |
The CPU figures explain the response times. About three quarters of a cold render is computing time in the PHP process; the rest is waiting for database and cache. If 8.6 saves 15 per cent there, the page gets faster accordingly. Warm, 8.6 needs only a little over half the CPU time.
In return the container takes about 40 MiB more memory. The value stayed constant over all rounds, so it is not a leak. For a single website it hardly matters. On a node with many pods and tight memory it adds up. On top comes a slightly higher idle baseline, two milliseconds of CPU per second.
06 — Where the difference may come from
An honest caveat: the comparison measures two images, not just two PHP versions. Both sit on openSUSE Tumbleweed, but they are built differently. PHP 8.5 comes as the distribution's package, with the extensions as separate modules and an embed SAPI for FrankenPHP built on its own. PHP 8.6 I build from a spec of my own. There every extension is compiled in, and FrankenPHP links against the libphp from the same build.
Compiled-in code can be faster than modules loaded as shared libraries. It can also take more memory, because every extension is loaded rather than only the installed ones. Both fit the numbers. How much of the lead comes from the build and how much from the language itself, this measurement cannot separate. That would take two builds from the same spec.
For operations this is secondary. What was measured is what is actually delivered.
07 — Switching production
The numbers were enough for a decision. The same afternoon, production of this blog moved to PHP 8.6, as a pilot ahead of the platform's other PHP installations. The switch was one change in GitOps: a different runtime image for this one tenant. After one rollout, frontend, backend and background worker ran on 8.6. The log then showed neither errors nor deprecation notices. The second website of the same installation also delivered cleanly, although the copy had not tested it.
One price remains. The 8.6 image depends on more inputs than the old one and is therefore rebuilt more often. Every new version means one more rollout. With a pod start of twelve seconds that is bearable. The other tenants follow once 8.6 has run here for a few weeks without findings. The copy has since been taken down.
Frequently asked questions
Should I move to PHP 8.6 now?+
Not blindly. The application ran without errors in my test, but every installation has its own dependencies. A test on a copy with real data takes a day and shows whether your libraries and extensions play along. The way back to 8.5 should be ready before production switches.
Why no load test?+
Because the question was a different one: does a single page get faster? Under load, throughput and the number of workers count, and both depend heavily on the environment. The lower CPU time per page suggests that 8.6 also handles more under load. I have not measured it.
Where do the 40 MiB of extra memory come from?+
I cannot say for certain. The build is the obvious suspect: in the 8.6 image every extension is compiled in, in the 8.5 image only the needed ones are installed. If you plan memory tightly, count on the higher value until this is settled.
Conclusion
PHP 8.6 makes this application measurably faster without any change to the code. Cold pages take about an eighth less time and a seventh less CPU. Warm pages manage with a little over half the CPU. In return every pod costs about 40 MiB more memory.
The second lesson is about measuring. Two of the biggest sources of error came not from PHP but from the tool and from my own automation. A comparison only holds once both sides really differ in the one point you want to measure.
Is your PHP application on PHP 8.6 yet?
I test your application on a copy with real data: whether it and its dependencies run on PHP 8.6, what changes in response time and resources, and what the way back looks like.
About the author

Kai Ole Hartwig
Programming since 2002 – self-taught, set up my own business with KO-Web in 2012. Over 100 projects, with a focus on security, performance, automation and quality. Today freelance: DevSecOps consulting, training and software development.