PHP Performance Benchmark (2024Q1) - PHP8/PHP7 Debian/Alpine nginx-php-fpm

Post Title Image (Image source: Photo by Jason Dent on Unsplash)

This PHP container was developed, adjusted, and maintained together with a friend and colleague. The original design purpose was to combine php-fpm with nginx, creating a simplified environment that facilitates the operation of Laravel in cloud-native environments, AWS Fargate, Amazon ECS, etc. We use it as a base for teaching and implementing various projects, comparative testing, including comparisons of x86/ARM computing architectures, and more.

With the update and release of new PHP versions, we plan to share the performance tests comparisons we’ve conducted every quarter (if not forgotten) with fellow PHP enthusiasts.

Preview



Our PHP Benchmarks

  • Machine
    • Apple M1, 16 GB
  • Variables
    • OS
      • Debian 11 bullseye, Debian 12 bookworm
      • alpine3.17, alpine3.18
    • PHP
      • 8.3.3, 8.3.2, 8.3.1, 8.3.0
      • 8.2.16, 8.2.15, 8.2.14, 8.2.13, 8.2.12, 8.2.11, 8.2.10, 8.2.9
      • 8.1.27, 8.1.26, 8.1.25, 8.1.24, 8.1.23, 8.1.22
      • 8.0.30, 8.0.29, 8.0.28, 8.0.27, 8.0.26
      • 7.4.33, 7.4.32, 7.4.30, 7.4.29, 7.4.28
      • 7.3.33, 7.3.32, 7.3.31, 7.3.30, 7.3.29
    • nginx
      • 1.24.0
      • 1.25.4
  • Test
    • 1 Thread
    • 1 Conn
    • 60s
    • Test 5 times of each variable combination (N = 5)

Organizing this kind of comparative data, from designing the environment, implementation, measurement, data collection, organization, chart making, to summarizing and inducing, is quite brain-intensive but also very interesting. If there’s anything in the content that can be adjusted or improved, or if you have suggestions for other measurement methods, please feel free to leave a comment or open an issue for us. We greatly appreciate it.


Test 01 phpinfo

RPS (phpinfo)

  • RPS = Requests per second. More is Better.

Latency (phpinfo)

  • Latency. Fewer is Better.

History


Reference

PHP 8.3

PHP 8.2

PHP 8.1

PHP 8.0

PHP 7.4

PHP 7.3

PHP 7.2

PHP 7.1

PHP 7.0

PHP 5.6

Loading comments…