#Php frameworks for php 5.2 upgrade
Enabling OPCache Preloading yielding better results than an upgrade from PHP 7.4 to 8.0. For throughput there seems to be no change in concurrency 10 to 100, but PHP 8.0 with JIT is curiously less performant as low concurrency but comes alive and edges past 7.4 with OPCache Preloading from at 25+ concurrency onwards.įor response times the story is similar as for throughput. On average PHP 7.4 is slightly more performant, but not by a significant margin. With throughput both PHP 7.4 and 8.0 benefit significantly from enabling OPCache Preloading. The app does not connect to remote services like databases. The load balancing was ran using hey and I report the numbers for throughput (req/s) and response time (ms).
Opcache.preload=/var/# only when JIT was enabled The OPCache config the same used for the post benchmarking OPCache Preloading: PHP 8.0 with OPCache Preloading and JIT enabled.I ran the load test with five concurrencies (1, 10, 25, 50, 100) three times for each configuration and used the average number for the report.Ī total of five configurations were tested using a PHP-FPM and Nginx setup: The action spits out a snippet of HTML with a random number between 100 and 999. The application was a bare-bones Symfony 5.2 application with the lucky number controller action at the root. The OS was Ubuntu 20.20 with PHP installed from the packages from Ondřej Surý. The execution environment was Hetzner Helsinki datacenter with a Virtual Server CCX11 (2 dedicated vCPU, 8GB RAM) doing the serving, and another to run the benchmarks. Both are not final versions, but late release candidates that could be very close to the final releases. The benchmarks were done on PHP 8.0-RC5 and Symfony 5.2-RC2.
It's a pure hello world scenario, and should be taken as such. This is a quick round of benchmarks done on the latest release of both projects. The PHP 8.0 is scheduled to be released on November 26 2020, soon to be followed by the latest version of the Symfony framework 5.2.