Learn about Centmin Mod LEMP Stack today
Become a Member

PHP PHP Benchmarks 7.4 vs 7.3 vs 7.2 vs 7.1 vs 7.0 (php-fpm)

Discussion in 'Nginx and PHP-FPM news & discussions' started by eva2000, Nov 28, 2019.

Thread Status:
Not open for further replies.
  1. eva2000

    eva2000 Administrator Staff Member

    54,106
    12,179
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +18,738
    Local Time:
    11:52 PM
    Nginx 1.27.x
    MariaDB 10.x/11.4+
    PHP 7.4.0 GA stable release was made on November 28, 2019. Below are PHP 7.4.0 vs 7.3.12 vs 7.2.25 vs 7.1.33 vs 7.0.33 PHP (php-fpm) benchmarks on latest updated Centmin Mod 123.09beta01 LEMP stack based dedicated server running CentOS 7.7 64bit. Just like I did for PHP 7.2 benchmarks and PHP 7.3 benchmarks. Reminder, if you find Centmin Mod LEMP stack useful, please support Centmin Mod in keeping the project alive, Ways you can support Centmin Mod.


    Test System Info

    System:
    • OVH MC-32 Intel Core i7 4790K
    • 32GB Memory
    • 2x240GB SSD
    • 250Mbit Network Bandwidth
    • CentOS 7.7 64bit
    • Centmin Mod 123.09beta01 LEMP stack - Nginx 1.17.6, MariaDB 10.1.43 MySQL, + CSF Firewall
    • BHS, Canada
    PHP 7.4 vs 7.3 vs 7.2 vs 7.1 vs 7.0 Benchmarks

    Tests use following scripts
    Notes:
    • Tested Remi YUM repo SCL based PHP versions versus Centmin Mod built PHP versions with and without Profile Guided Optimisations.
    • PGO = Profile Guided Optimisations (for Wordpress, MediaWiki and Drupal like PHP web applications and similar PHP execution patterns.)
    • Centmin Mod defaults to non-PGO PHP-FPM builds for PHP 7 by default. PGO built PHP might be faster for some specific PHP code but slower for others so choose PGO wisely.
    • Latest tests are with Kernel updates for meltdown/spectre vulnerability patches which can reduce PHP performance compared to benchmarks done prior to November 28, 2019
    • Linux Kernel 3.10.0-1062.4.3.el7.x86_64 was used
    PHP Benchmark Charts
    • The charts' bars are colour coded for PHP build type - Remi Yum vs Centmin Mod vs Centmin Mod + PGO.
    • The charts' data labels are colour coded for PHP version tested for easier comparison between PHP build types.
    Times are in seconds where lower is faster

    detailed-benchmark-phpbenchmarks-chart-01.png
    bench-phpbenchmarks-chart-01.png
    micro-bench-phpbenchmarks-chart-01.png

    PHP 7.4.0 Benchmarks Tables



    Tabulated summary of results below

    detailed-benchmark-phpbenchmarks-table-01.png
    bench-phpbenchmarks-table-01.png
    micro-bench-phpbenchmarks-table-01.png

    If you're looking for PHP 5.6 benchmarks, I did those previously here.
     
    Last edited: Nov 28, 2019
  2. eva2000

    eva2000 Administrator Staff Member

    54,106
    12,179
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +18,738
    Local Time:
    11:52 PM
    Nginx 1.27.x
    MariaDB 10.x/11.4+

    PHP 8.0 vs 7.4 vs 7.3 vs 7.2 vs 7.1 vs 7.0



    Next PHP version after 7.4 will be PHP 8.0 which is in development. So was curious how PHP 8.0 dev master branch performed on Centmin Mod 123.09beta01 LEMP stack which was just updated to support PHP 8.0 dev master branch builds - including support for Profile Guided Optimizations. PHP 8.0.0 dev built definitely is faster in all tests. Though there was a slight regression for PHP 8.0.0 + PGO enabled bench.php test compared to PHP 8.0.0 non-PGO bench.php test but it was still faster than PHP 7.4.0 !
    Code (Text):
    php -v
    PHP 8.0.0-dev (cli) (built: Nov 30 2019 14:51:53) ( NTS )
    Copyright (c) The PHP Group
    Zend Engine v4.0.0-dev, Copyright (c) Zend Technologies
       with Zend OPcache v8.0.0-dev, Copyright (c), by Zend Technologies
    

    Only php extensions not supported by PHP 8.0.0 dev were geoip, mcrypt and imagick right now.
    Code (Text):
    php-config
    Usage: /usr/local/bin/php-config [OPTION]
    Options:
      --prefix            [/usr/local]
      --includes          [-I/usr/local/include/php -I/usr/local/include/php/main -I/usr/local/include/php/TSRM -I/usr/local/include/php/Zend -I/usr/local/include/php/ext -I/usr/local/include/php/ext/date/lib]
      --ldflags           [ -L/usr/local/lib64]
      --libs              [-lcrypt  -lc-client  -ltidy -largon2 -lresolv -lcrypt -lncurses -laspell -lpspell -lrt -lldap -llber -lstdc++ -lcrypt -lpam -lgmp -lbz2 -lrt -lm -ldl  -lsystemd -lxml2 -lgssapi_krb5 -lkrb5 -lk5crypto -lcom_err -lssl -lcrypto -lsqlite3 -lz -lcurl -lxml2 -lenchant -lgmodule-2.0 -lglib-2.0 -lffi -lssl -lcrypto -lz -lpng15 -lwebp -ljpeg -lXpm -lX11 -lfreetype -lgssapi_krb5 -lkrb5 -lk5crypto -lcom_err -lssl -lcrypto -licuio -licui18n -licuuc -licudata -lonig -lsqlite3 -ledit -ltinfo -lxml2 -lnetsnmp -lssl -lssl -lcrypto -lm -lxml2 -lsodium -lcrypt -largon2 -lxml2 -lxml2 -lxml2 -lxml2 -lxslt -lm -lxml2 -lexslt -lxslt -lm -lgcrypt -ldl -lgpg-error -lxml2 -lzip -lssl -lcrypto -lcrypt ]
      --extension-dir     [/usr/local/lib/php/extensions/no-debug-non-zts-20190128]
      --include-dir       [/usr/local/include/php]
      --man-dir           [/usr/local/php/man]
      --php-binary        [/usr/local/bin/php]
      --php-sapis         [ cli embed fpm phpdbg cgi]
      --ini-path          [/usr/local/lib]
      --ini-dir           [/etc/centminmod/php.d]
      --configure-options [--enable-fpm --enable-opcache --enable-intl --enable-pcntl --with-mcrypt --with-snmp --enable-embed=shared --with-mhash --with-zlib --with-gettext --enable-exif --with-zip --with-libzip --with-bz2 --enable-soap --enable-sockets --enable-sysvmsg --enable-sysvsem --enable-sysvshm --with-mysql-sock=/var/lib/mysql/mysql.sock --with-curl --enable-gd --with-xmlrpc --enable-bcmath --enable-calendar --enable-ftp --enable-gd-native-ttf --with-freetype --with-jpeg --with-png-dir=/usr --with-xpm --with-webp --with-t1lib=/usr --enable-shmop --with-pear --enable-mbstring --with-openssl --with-mysql=mysqlnd --with-libdir=lib64 --with-mysqli=mysqlnd --enable-pdo --with-pdo-sqlite --with-pdo-mysql=mysqlnd --enable-inline-optimization --with-imap --with-imap-ssl --with-kerberos --with-readline --with-libedit --with-gmp --with-pspell --with-tidy --with-enchant --with-fpm-user=nginx --with-fpm-group=nginx --with-ldap --with-ldap-sasl --with-password-argon2=/usr/local --with-sodium=/usr/local --with-config-file-scan-dir=/etc/centminmod/php.d --with-fpm-systemd --with-ffi --with-xsl LIBSODIUM_CFLAGS=-I/usr/local/include LIBSODIUM_LIBS=-L/usr/local/lib64 -lsodium LIBZIP_CFLAGS=-I/usr/local/include LIBZIP_LIBS=-L/usr/local/lib64 -lzip]
      --version           [8.0.0-dev]
      --vernum            [80000]


    PHP 8.0.0 dev benchmarks below also include PHP 8.0.0 dev with new performance feature, PHP JIT enabled. PHP 8 JIT setting for opcache.jit was set to 1235 where default is 1205 consisting of 4 decimal digits - CRTO.
    php8-jit-detailed-benchmark-phpbenchmarks-chart-01.png
    php8-jit-bench-phpbenchmarks-chart-01.png
    php8-jit-micro-bench-phpbenchmarks-chart-01.png

    Added percentage comparison tables against Centmin Mod PHP 7.3.12, 7.4.0, 8.0, 8.0 JIT with and without PGO.

    For example for detailed_benchmark.php reading the 1st row of results for PHP 8.0.0 dev JIT Centmin Mod PHP-FPM with PGO enabled has a time of 1.2377 seconds which is:
    • 32.3% faster than Centmin Mod PHP 7.3.12
    • 23.5% faster than Centmin Mod PHP 7.4.0
    • 20.4% faster than Centmin Mod PHP 8.0
    • 13.5% faster than Centmin Mod PHP 8.0 JIT
    • 20.3% faster than Centmin Mod PHP 7.3.12 + PGO
    • 12.9% faster than Centmin Mod PHP 7.4.0 + PGO
    • 9.5% faster than Centmin Mod PHP 8.0 + PGO
    • 0% faster = even than Centmin Mod PHP 8.0 JIT + PGO
    For detailed_benchmark.php reading the PHP 7.4.0 Remi YUM repo binary has a time of 1.8263 seconds which is:
    • 0.1% faster than Centmin Mod PHP 7.3.12
    • 12.9% slower than Centmin Mod PHP 7.4.0
    • 27.7% slower than Centmin Mod PHP 8.0
    • 32.8% slower than Centmin Mod PHP 8.0 JIT
    • 17.7% slower than Centmin Mod PHP 7.3.12 + PGO
    • 28.5% slower than Centmin Mod PHP 7.4.0 + PGO
    • 33.5% slower than Centmin Mod PHP 8.0 + PGO
    • 47.6% slower than Centmin Mod PHP 8.0 JIT + PGO
    compare-detailed-benchmark-phpbenchmarks-01.png
    compare-bench-phpbenchmarks-01.png
    compare-micro-bench-phpbenchmarks-01.png
     
    Last edited: Dec 2, 2019
Thread Status:
Not open for further replies.