Join the community today
Register Now

Featured PHP PHP 7.3 vs 7.2 vs 7.1 vs 7.0 (PHP-FPM) Benchmarks

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

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

    eva2000 Administrator Staff Member

    37,261
    8,141
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +12,533
    Local Time:
    9:55 AM
    Nginx 1.15.x
    MariaDB 5.5/10.x
    Like I did for PHP 7.2 benchmarks, starting some PHP 7.3 comparison benchmarks as PHP 7.3.0 GA Stable is coming on December 3, 2018 and currently PHP 7.3.0RC6 is latest.
    Notes

    PHP 7.3 Configuration Setup Info



    Centmin Mod 123.09beta01 native PHP 7.3.0RC6
    Code (Text):
    php -v
    PHP 7.3.0RC6 (cli) (built: Nov 24 2018 20:17:11) ( NTS )
    Copyright (c) 1997-2018 The PHP Group
    Zend Engine v3.3.0-dev, Copyright (c) 1998-2018 Zend Technologies
        with Zend OPcache v7.3.0RC6, Copyright (c) 1999-2018, by Zend Technologies
    

    PHP Argon2 support
    Code (Text):
    php -r 'print_r(get_defined_constants());' | grep -i argon
        [PASSWORD_ARGON2I] => 2
        [PASSWORD_ARGON2ID] => 3
        [PASSWORD_ARGON2_DEFAULT_MEMORY_COST] => 1024
        [PASSWORD_ARGON2_DEFAULT_TIME_COST] => 2
        [PASSWORD_ARGON2_DEFAULT_THREADS] => 2
        [SODIUM_CRYPTO_PWHASH_ALG_ARGON2I13] => 1
        [SODIUM_CRYPTO_PWHASH_ALG_ARGON2ID13] => 2
        [SODIUM_CRYPTO_PWHASH_STRPREFIX] => $argon2id$
    

    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/zlib-cf/lib64 -L/usr/local/lib64]
      --libs              [-lcrypt  -lc-client  -lzip -lzip -lz -lexslt -ltidy -largon2 -lresolv -lcrypt -lsodium -ledit -lncurses -laspell -lpspell -lrt -lldap -llber -lstdc++ -lcrypt -lpam -lgmp -lX11 -lXpm -lpng -lz -ljpeg -lwebp -lenchant -lbz2 -lz -lrt -lm -ldl -lnsl  -lxml2 -lz -llzma -lm -ldl -lgssapi_krb5 -lkrb5 -lk5crypto -lcom_err -lssl -lcrypto -lcurl -lxml2 -lz -llzma -lm -ldl -lssl -lcrypto -lfreetype -lgssapi_krb5 -lkrb5 -lk5crypto -lcom_err -lssl -lcrypto -ldl -lm -licui18n -licuuc -licudata -ldl -lm -licuio -lxml2 -lz -llzma -lm -ldl -lnetsnmp -lssl -lssl -lcrypto -lm -lxml2 -lz -llzma -lm -ldl -lcrypt -largon2 -lxml2 -lz -llzma -lm -ldl -lxml2 -lz -llzma -lm -ldl -lxml2 -lz -llzma -lm -ldl -lxml2 -lz -llzma -lm -ldl -lxslt -lxml2 -lm -lssl -lcrypto -lcrypt ]
      --extension-dir     [/usr/local/lib/php/extensions/no-debug-non-zts-20180731]
      --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]
      --configure-options [--enable-fpm --enable-opcache --enable-intl --enable-pcntl --with-mcrypt --with-snmp --enable-embed=shared --with-mhash --with-zlib-dir=/usr/local/zlib-cf --with-gettext --enable-exif --enable-zip --with-libzip --with-bz2 --enable-soap --enable-sockets --enable-sysvmsg --enable-sysvsem --enable-sysvshm --enable-shmop --with-pear --enable-mbstring --with-openssl --with-mysql=mysqlnd --with-libdir=lib64 --with-mysqli=mysqlnd --with-mysql-sock=/var/lib/mysql/mysql.sock --with-curl --with-gd --with-xmlrpc --enable-bcmath --enable-calendar --enable-ftp --enable-gd-native-ttf --with-freetype-dir=/usr --with-jpeg-dir=/usr --with-png-dir=/usr --with-xpm-dir=/usr --with-webp-dir=/usr --with-t1lib=/usr --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 --disable-fileinfo --with-ldap --with-ldap-sasl --with-password-argon2 --with-sodium --with-config-file-scan-dir=/etc/centminmod/php.d --with-xsl]
      --version           [7.3.0RC6]
      --vernum            [70300]
    

    Code (Text):
    php -m
    [PHP Modules]
    bcmath
    bz2
    calendar
    Core
    ctype
    curl
    date
    dom
    enchant
    exif
    filter
    ftp
    gd
    geoip
    gettext
    gmp
    hash
    iconv
    igbinary
    imagick
    imap
    intl
    json
    ldap
    libxml
    mbstring
    mcrypt
    memcached
    mysqli
    mysqlnd
    openssl
    pcntl
    pcre
    PDO
    pdo_mysql
    pdo_sqlite
    Phar
    posix
    pspell
    readline
    redis
    Reflection
    session
    shmop
    SimpleXML
    snmp
    soap
    sockets
    sodium
    SPL
    sqlite3
    standard
    sysvmsg
    sysvsem
    sysvshm
    tidy
    tokenizer
    xml
    xmlreader
    xmlrpc
    xmlwriter
    xsl
    Zend OPcache
    zip
    zlib
    
    [Zend Modules]
    Zend OPcache
    


    Remi SCL Yum PHP-FPM


    Code (Text):
    php73 -v
    PHP 7.3.0RC6 (cli) (built: Nov 20 2018 12:03:23) ( NTS )
    Copyright (c) 1997-2018 The PHP Group
    Zend Engine v3.3.0-dev, Copyright (c) 1998-2018 Zend Technologies
        with Zend OPcache v7.3.0RC6, Copyright (c) 1999-2018, by Zend Technologies
    

    PHP Argon2 support
    Code (Text):
    php73 -r 'print_r(get_defined_constants());' | grep -i argon
        [PASSWORD_ARGON2I] => 2
        [PASSWORD_ARGON2ID] => 3
        [PASSWORD_ARGON2_DEFAULT_MEMORY_COST] => 1024
        [PASSWORD_ARGON2_DEFAULT_TIME_COST] => 2
        [PASSWORD_ARGON2_DEFAULT_THREADS] => 2
        [SODIUM_CRYPTO_PWHASH_ALG_ARGON2I13] => 1
        [SODIUM_CRYPTO_PWHASH_ALG_ARGON2ID13] => 2
        [SODIUM_CRYPTO_PWHASH_STRPREFIX] => $argon2id$
    

    Code (Text):
    ./php73.sh phpconfig
    Usage: /opt/remi/php73/root/usr/bin/php-config [OPTION]
    Options:
      --prefix            [/opt/remi/php73/root/usr]
      --includes          [-I/opt/remi/php73/root/usr/include/php -I/opt/remi/php73/root/usr/include/php/main -I/opt/remi/php73/root/usr/include/php/TSRM -I/opt/remi/php73/root/usr/include/php/Zend -I/opt/remi/php73/root/usr/include/php/ext -I/opt/remi/php73/root/usr/include/php/ext/date/lib]
      --ldflags           []
      --libs              [-lcrypt   -largon2 -lresolv -lcrypt -ledit -lncurses -lstdc++ -lz -lrt -lm -ldl -lnsl  -lxml2 -lz -lm -ldl -lgssapi_krb5 -lkrb5 -lk5crypto -lcom_err -lssl -lcrypto -lcrypt -largon2 -lcrypt ]
      --extension-dir     [/opt/remi/php73/root/usr/lib64/php/modules]
      --include-dir       [/opt/remi/php73/root/usr/include/php]
      --man-dir           [/opt/remi/php73/root/usr/share/man]
      --php-binary        [/opt/remi/php73/root/usr/bin/php]
      --php-sapis         [apache2handler embed fpm  cli phpdbg cgi]
      --configure-options [--build=x86_64-redhat-linux-gnu --host=x86_64-redhat-linux-gnu --program-prefix= --disable-dependency-tracking --prefix=/opt/remi/php73/root/usr --exec-prefix=/opt/remi/php73/root/usr --bindir=/opt/remi/php73/root/usr/bin --sbindir=/opt/remi/php73/root/usr/sbin --sysconfdir=/etc/opt/remi/php73 --datadir=/opt/remi/php73/root/usr/share --includedir=/opt/remi/php73/root/usr/include --libdir=/opt/remi/php73/root/usr/lib64 --libexecdir=/opt/remi/php73/root/usr/libexec --localstatedir=/var/opt/remi/php73 --sharedstatedir=/var/opt/remi/php73/lib --mandir=/opt/remi/php73/root/usr/share/man --infodir=/opt/remi/php73/root/usr/share/info --cache-file=../config.cache --with-libdir=lib64 --with-config-file-path=/etc/opt/remi/php73 --with-config-file-scan-dir=/etc/opt/remi/php73/php.d --disable-debug --with-pic --disable-rpath --without-pear --with-exec-dir=/opt/remi/php73/root/usr/bin --with-freetype-dir=/usr --with-png-dir=/usr --with-xpm-dir=/usr --without-gdbm --with-jpeg-dir=/usr --with-openssl --with-system-ciphers --with-zlib --with-layout=GNU --with-kerberos --with-libxml-dir=/usr --with-system-tzdata --with-mhash --with-password-argon2 --enable-dtrace --libdir=/opt/remi/php73/root/usr/lib64/php --enable-pcntl --enable-opcache --enable-opcache-file --enable-phpdbg --with-imap=shared --with-imap-ssl --enable-mbstring=shared --enable-mbregex --with-gd=shared,/usr --with-gmp=shared --enable-calendar=shared --enable-bcmath=shared --with-bz2=shared --enable-ctype=shared --enable-dba=shared --with-db4=/usr --with-tcadb=/usr --with-lmdb=/usr --enable-exif=shared --enable-ftp=shared --with-gettext=shared --with-iconv=shared --enable-sockets=shared --enable-tokenizer=shared --with-xmlrpc=shared --with-ldap=shared --with-ldap-sasl --enable-mysqlnd=shared --with-mysqli=shared,mysqlnd --with-mysql-sock=/var/lib/mysql/mysql.sock --with-oci8=shared,instantclient,/usr/lib64/oracle/18.3/client64/lib,18.3 --with-pdo-oci=shared,instantclient,/usr/lib64/oracle/18.3/client64/lib,18.3 --with-interbase=shared --with-pdo-firebird=shared --enable-dom=shared --with-pgsql=shared --enable-simplexml=shared --enable-xml=shared --enable-wddx=shared --with-snmp=shared,/usr --enable-soap=shared --with-xsl=shared,/usr --enable-xmlreader=shared --enable-xmlwriter=shared --with-curl=shared,/usr --enable-pdo=shared --with-pdo-odbc=shared,unixODBC,/usr --with-pdo-mysql=shared,mysqlnd --with-pdo-pgsql=shared,/usr --with-pdo-sqlite=shared,/usr --with-sqlite3=shared,/usr --enable-json=shared --without-readline --with-libedit --with-pspell=shared --enable-phar=shared --with-tidy=shared,/usr --with-pdo-dblib=shared,/usr --enable-sysvmsg=shared --enable-sysvshm=shared --enable-sysvsem=shared --enable-shmop=shared --enable-posix=shared --with-unixODBC=shared,/usr --enable-intl=shared --with-icu-dir=/usr --with-enchant=shared,/usr --with-recode=shared,/usr --enable-fileinfo=shared --with-sodium=shared build_alias=x86_64-redhat-linux-gnu host_alias=x86_64-redhat-linux-gnu CFLAGS=-O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector-strong --param=ssp-buffer-size=4 -grecord-gcc-switches -specs=/usr/lib/rpm/redhat/redhat-hardened-cc1 -m64 -mtune=generic -fno-strict-aliasing -Wno-pointer-sign CXXFLAGS=-O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector-strong --param=ssp-buffer-size=4 -grecord-gcc-switches -specs=/usr/lib/rpm/redhat/redhat-hardened-cc1 -m64 -mtune=generic]
      --version           [7.3.0RC6]
      --vernum            [70300]
    

    Code (Text):
    php73 -m
    [PHP Modules]
    bcmath
    bz2
    calendar
    Core
    ctype
    curl
    date
    dom
    enchant
    exif
    fileinfo
    filter
    ftp
    gd
    geoip
    gettext
    gmp
    hash
    iconv
    igbinary
    imagick
    imap
    intl
    json
    json_post
    ldap
    libxml
    mbstring
    mcrypt
    memcache
    memcached
    msgpack
    mysql
    mysqli
    mysqlnd
    openssl
    pcntl
    pcre
    PDO
    pdo_dblib
    pdo_mysql
    pdo_sqlite
    Phar
    pspell
    readline
    redis
    Reflection
    session
    SimpleXML
    snmp
    soap
    sockets
    sodium
    SPL
    sqlite3
    standard
    tidy
    tokenizer
    wddx
    xml
    xmlreader
    xmlrpc
    xmlwriter
    xsl
    Zend OPcache
    zip
    zlib
    
    [Zend Modules]
    Zend OPcache
    


    Test System Info



    System:
    • OVH MC-32 Intel Core i7 4790K
    • 32GB Memory
    • 2x240GB SSD
    • 250Mbit Network Bandwidth
    • CentOS 7.5 64bit
    • Centmin Mod 123.09beta01 LEMP stack - Nginx 1.15.6, MariaDB 10.1.33 MySQL, + CSF Firewall
    • BHS, Canada

    PHP 7.3 vs 7.2 vs 7.1 vs 7.0 Benchmarks



    Tests use following scripts

    Notes:
    • 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 25, 2018
    • Linux Kernel 3.10.0-862.14.4.el7 and 3.10.0-862.3.2.el7 were used
    Times are in seconds where lower is faster

    PHP Version bench.php micro_bench.php detailed_benchmark.php total
    PHP 7.3.0RC6 centminmod php-fpm + PGO (3.10.0-862.14.4) 0.3873 1.9717 1.9923 4.3513
    PHP 7.3.0RC6 centminmod php-fpm + PGO (3.10.0-862.3.2) 0.3897 1.9333 2.0130 4.336
    PHP 7.3.0RC6 centminmod php-fpm + no PGO (3.10.0-862.14.4) 0.3940 1.9780 1.7563 4.1283
    PHP 7.3.0RC6 centminmod php-fpm + no PGO (3.10.0-862.3.2) 0.3817 1.9203 1.7037 4.0057
    PHP 7.2.12 centminmod php-fpm + PGO (3.10.0-862.14.4) 0.4163 2.0510 2.1243 4.5916
    PHP 7.2.12 centminmod php-fpm + PGO (3.10.0-862.3.2) 0.3957 2.0957 2.1783 4.6697
    PHP 7.2.12 centminmod php-fpm + no PGO (3.10.0-862.14.4) 0.4257 2.4257 1.8947 4.7461
    PHP 7.2.12 centminmod php-fpm + no PGO (3.10.0-862.3.2) 0.4173 2.3550 1.8613 4.6336
    PHP 7.1.24 centminmod php-fpm + PGO (3.10.0-862.14.4) 0.4177 2.3393 2.3260 5.083
    PHP 7.1.24 centminmod php-fpm + PGO (3.10.0-862.3.2) 0.4143 2.4223 2.3073 5.1439
    PHP 7.1.24 centminmod php-fpm + no PGO (3.10.0-862.14.4) 0.4337 2.3550 2.0503 4.839
    PHP 7.1.24 centminmod php-fpm + no PGO (3.10.0-862.3.2) 0.4310 2.3460 2.0493 4.8263
    PHP 7.0.32 centminmod php-fpm + PGO (3.10.0-862.14.4) 0.4293 2.3343 2.4027 5.1663
    PHP 7.0.32 centminmod php-fpm + PGO (3.10.0-862.3.2) 0.4320 2.3327 2.4067 5.1714
    PHP 7.0.32 centminmod php-fpm + no PGO (3.10.0-862.14.4) 0.4573 2.3747 2.0973 4.9293
    PHP 7.0.32 centminmod php-fpm + no PGO (3.10.0-862.3.2) 0.4603 2.3727 2.1070 4.94
    PHP 7.3.0RC6 remi scl php-fpm (3.10.0-862.14.4) 0.3873 2.0250 1.9090 4.3213
    PHP 7.3.0RC6 remi scl php-fpm (3.10.0-862.3.2) 0.3907 2.0170 1.9153 4.323
    PHP 7.2.13RC1 remi scl php-fpm (3.10.0-862.14.4) 0.4017 2.3210 2.0050 4.7277
    PHP 7.2.13RC1 remi scl php-fpm (3.10.0-862.3.2) 0.4063 2.2530 2.0160 4.6753
    PHP 7.1.25RC1 remi scl php-fpm (3.10.0-862.14.4) 0.4237 2.5137 2.1347 5.0721
    PHP 7.1.25RC1 remi scl php-fpm (3.10.0-862.3.2) 0.4267 2.4033 2.1490 4.979
    PHP 7.0.32 remi scl php-fpm (3.10.0-862.14.4) 0.4517 2.4390 2.1940 5.0847
    PHP 7.0.32 remi scl php-fpm (3.10.0-862.3.2) 0.4580 2.3997 2.2053 5.063


    Charted PHP comparisons for Linux 3.10.0-862.14.4.el7 Kernel tests only
    • Centmin Mod PHP-FPM 7.3.0RC6 PGO is ~5.23% faster than Centmin Mod PHP-FPM 7.2.12 PGO (4.3513 vs 4.5916) and is ~0.69% slower than Remi SCL PHP-FPM 7.3.0RC6 (4.3513 vs 4.3213)
    • Centmin Mod PHP-FPM 7.3.0RC6 non-PGO is ~13.01% faster than Centmin Mod PHP-FPM 7.2.12 non-PGO (4.1283 vs 4.7461) and is ~4.47% faster than Remi SCL PHP-FPM 7.3.0RC6 (4.1283 vs 4.3213)
    • Remi SCL PHP-FPM 7.3.0RC6 is ~9.4% faster than Remi SCL PHP-FPM 7.2.13RC1 (4.3213 vs 4.7277) and is ~17.37% faster than Remi SCL PHP-FPM 7.1.25RC1 (4.3213 vs 5.0721) and is ~17.67% faster than Remi SCL PHP-FPM 7.0.32 (4.3213 vs 5.0847)
    php7.3.0rc6-251118-chart1-02.png
     
    Last edited: Nov 25, 2018
    • Informative Informative x 2
  2. eva2000

    eva2000 Administrator Staff Member

    37,261
    8,141
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +12,533
    Local Time:
    9:55 AM
    Nginx 1.15.x
    MariaDB 5.5/10.x

    Centmin Mod PHP 7 Profile Guided Optimizations (PGO) Retuned



    The above Profile Guided Optimizations (PGO) for PHP 7 versions seems to have somewhat regressed since last time I tested and for detailed_benchmark.php script the PGO runs are slower than non-PGO runs. So updated Centmin Mod 123.09beta01 PHP 7 PGO routines to fine tune them some more. I improved the micro_bench.php average run time under PHP 7.3.0RC6 PGO runs by ~6.5%.

    PHP 7 PGO Custom Training

    Centmin Mod 123.09beta01 also supports end user control to add additional variable = PHPPGO_INDEXPATH to specify additional PHP script paths which can be added to PGO training phase to optimise for those specific PHP code paths as well. So to add detailed_benchmark.php and it's tested PHP code/functions to PGO training phase and achieved ~25% faster detailed_benchmark.php run times on average !

    Note that as part of PGO training during PHP compilation process, the detailed_benchmark.php script will be run 100x times to gather enough data to pass to PHP compile process for building a better optimised PHP binary. This adds to the PHP compile time. On my Intel Core i7 4790K each run of the script took ~2.9 seconds to run x 100 = ~290 extra seconds for PHP compile process. Small price to pay for ~25% faster performance for detailed_benchmark.php script and it's tested PHP code/functions which will translate the performance benefits to other PHP scripts which use similar PHP code/functions too. However, on slower VPS servers the detailed_benchmark.php script can take ~10 seconds per run x 100 = 1000 extra seconds or 16.67 minutes added to PHP compilation times ! Though it's usually compile once so for that extra up to 10-25% performance improvement might be worth it for some folks.

    I set the variable PHPPGO_INDEXPATH to /FULL/PATH/TO/scripts/detailed_benchmark.php where the script is located on my server and then in persistent config file /etc/centminmod/custom_config.inc prior to centmin.sh menu option 5 PHP recompiles for PHP 7.3.0RC6.
    Code (Text):
    PHPPGO_INDEXPATH='/FULL/PATH/TO/scripts/detailed_benchmark.php'
    


    Then run centmin.sh menu option 5 to recompile PHP 7.3.0RC6
    Code (Text):
    --------------------------------------------------------
         Centmin Mod Menu 123.09beta01 centminmod.com
    --------------------------------------------------------
    1).  Centmin Install
    2).  Add Nginx vhost domain
    3).  NSD setup domain name DNS
    4).  Nginx Upgrade / Downgrade
    5).  PHP Upgrade / Downgrade
    6).  XCache Re-install
    7).  APC Cache Re-install
    8).  XCache Install
    9).  APC Cache Install
    10). Memcached Server Re-install
    11). MariaDB MySQL Upgrade & Management
    12). Zend OpCache Install/Re-install
    13). Install/Reinstall Redis PHP Extension
    14). SELinux disable
    15). Install/Reinstall ImagicK PHP Extension
    16). Change SSHD Port Number
    17). Multi-thread compression: pigz,pbzip2,lbzip2...
    18). Suhosin PHP Extension install
    19). Install FFMPEG and FFMPEG PHP Extension
    20). NSD Install/Re-Install
    21). Update - Nginx + PHP-FPM + Siege
    22). Add Wordpress Nginx vhost + Cache Plugin
    23). Update Centmin Mod Code Base
    24). Exit
    --------------------------------------------------------
    Enter option [ 1 - 24 ] 5
    --------------------------------------------------------
    

    Code (Text):
    Do you want to run YUM install checks ?  [y/n]
    
    This will increase your upgrade duration time wise.
    Check the change log centminmod.com/changelog.html
    to see if any Nginx or PHP related new additions
    which require checking YUM prequisites are met.
    If no new additions made, you can skip the
    YUM install check to speed up upgrade time.
    
     [y/n]: n
    
    PHP Upgrade/Downgrade - Would you like to continue? [y/n] y
    
    ----------------------------------------------------------------
    Install which version of PHP? (version i.e. 5.6.38, 7.0.30, NGDEBUG)
    PHP 7.x/7.1.x/7.2.x is GA Stable but still may have broken PHP extensions.
    NGDEBUG is PHP 7.3.0 dev builds minus incompatible PHP extensions
    ----------------------------------------------------------------
    Enter PHP Version number you want to upgrade/downgrade to: 7.3.0RC6
    ----------------------------------------------------------------
    existing php.ini will be backed up at /usr/local/lib/php.ini-oldversion_251118-230847
    ----------------------------------------------------------------
    Downloading PHP 7.3.0RC6 from https://downloads.php.net/~cmb/
    Download php-7.3.0RC6.tar.xz ...
    wget -4cnv https://downloads.php.net/~cmb/php-7.3.0RC6.tar.xz --tries=3
    2018-11-25 23:09:03 URL:https://downloads.php.net/~cmb/php-7.3.0RC6.tar.xz [11918172/11918172] -> "php-7.3.0RC6.tar.xz" [1]
    Download done.
    php-7.3.0RC6.tar.xz valid file.
    

    Code (Text):
    -----------------------------------------------------------------------------------------
    Detected PHP 7.3 branch.
    You can compile Zend OPcache (Zend Optimizer Plus+) support
    as an alternative to using APC Cache or Xcache cache.
    But Zend OPcache only provides PHP opcode cache and
    DOESN'T do data caching, so if your web apps such as Wordpress,
    Drupal or vBulletin require data caching to APC or Xcache,
    it won't work with Zend OPcache.
    
    -----------------------------------------------------------------------------------------
    Do you want to use Zend OPcache [y/n] ? y
    
    *************************************************
    * Zend Optimizer Plus OPcache configured
    *************************************************
    
    PHP 7+ detected which uses newer mysqlnd
    or PDO MySQL extensions and removed the
    legacy mysql extension. You can optionally
    re-add the removed legacy mysql extension
    to PHP 7+ by answering yes to next question
    Only answer yes if you know for sure you
    have very old web scripts which need mysql
    legacy extension re-added. Otherwise answer
    no which is recommended for best stability
    
    Re-add legacy mysql extension to PHP 7+ [y/n] ? n
    



    End result is detailed_benchmark.php runtimes dropped from ~1.9923s to ~1.488s on average or ~25% faster when PHP 7.3.0RC6 was compiled with Profile Guided Optimization (PGO) training specifically for detailed_benchmark.php :D When combined with optimised PGO runtine improving micro_bench.php performance (1.9717 vs 1.8467), the combined effect is improving PHP 7.3.0RC6 PGO performance from total time of 4.3513 seconds down to 3.7287 seconds or ~14.31% faster now :D

    Then I also recompiled PHP 7.2.12 with PGO tuned and detailed_benchmark.php PGO trained run to see how it would improve PHP 7.2.12 PGO performance. End result is detailed_benchmark.php runtimes dropped from 2.1243s to 1.6017s on average or ~24.6% faster when PHP 7.2.12 was compiled with Profile Guided Optimization (PGO) training specifically for detailed_benchmark.php. When combined with optimised PGO runtime was slightly slower micro_bench.php performance (2.0907 vs 2.0510), the combined effect is improving PHP 7.2.12 PGO performance from total time of 4.5916 seconds down to 4.0961 seconds or ~10.8% faster now ! That makes PHP 7.2.12 PGO tuned runs as fast as PHP 7.3.0RC6 non-PGO run times :cool:

    Did the same for PHP 7.1.24 PGO tuned and detailed_benchmark.php PGO trained run and result was slower micro_bench.php performance (2.4050 vs 2.3393) and 23.6% faster for detailed_benchmark.php PGO trained run (1.7750 vs 2.3260). End result is total time improved for PHP 7.1.24 PGO run times from 5.083s down 4.5983 or ~9.5% faster. That makes PHP 7.1.24 PGO tuned runs as fast as PHP 7.2.12 non-PGO run times

    Did the same for PHP 7.0.32 PGO tuned and detailed_benchmark.php PGO trained run and result was slower micro_bench.php performance (2.3350 vs 2.3343) and 23.8% faster for detailed_benchmark.php PGO trained run (1.8310 vs 2.4027). End result is total time improved for PHP 7.0.32 PGO run times from 5.1663s down 4.5957 or ~11% faster. That makes PHP 7.0.32 PGO tuned runs ~6% faster than PHP 7.1.24 non-PGO run times

    PHP Version bench.php micro_bench.php detailed_benchmark.php total
    PHP 7.3.0RC6 centminmod php-fpm + PGO tuned (3.10.0-862.14.4) 0.3933 1.8467 1.4887 3.7287
    PHP 7.3.0RC6 centminmod php-fpm + PGO (3.10.0-862.14.4) 0.3873 1.9717 1.9923 4.3513
    PHP 7.3.0RC6 centminmod php-fpm + PGO (3.10.0-862.3.2) 0.3897 1.9333 2.0130 4.336
    PHP 7.3.0RC6 centminmod php-fpm + no PGO (3.10.0-862.14.4) 0.3940 1.9780 1.7563 4.1283
    PHP 7.3.0RC6 centminmod php-fpm + no PGO (3.10.0-862.3.2) 0.3817 1.9203 1.7037 4.0057
    PHP 7.2.12 centminmod php-fpm + PGO tuned (3.10.0-862.14.4) 0.4037 2.0907 1.6017 4.0961
    PHP 7.2.12 centminmod php-fpm + PGO (3.10.0-862.14.4) 0.4163 2.0510 2.1243 4.5916
    PHP 7.2.12 centminmod php-fpm + PGO (3.10.0-862.3.2) 0.3957 2.0957 2.1783 4.6697
    PHP 7.2.12 centminmod php-fpm + no PGO (3.10.0-862.14.4) 0.4257 2.4257 1.8947 4.7461
    PHP 7.2.12 centminmod php-fpm + no PGO (3.10.0-862.3.2) 0.4173 2.3550 1.8613 4.6336
    PHP 7.1.24 centminmod php-fpm + PGO tuned (3.10.0-862.14.4) 0.4183 2.4050 1.7750 4.5983
    PHP 7.1.24 centminmod php-fpm + PGO (3.10.0-862.14.4) 0.4177 2.3393 2.3260 5.083
    PHP 7.1.24 centminmod php-fpm + PGO (3.10.0-862.3.2) 0.4143 2.4223 2.3073 5.1439
    PHP 7.1.24 centminmod php-fpm + no PGO (3.10.0-862.14.4) 0.4337 2.3550 2.0503 4.839
    PHP 7.1.24 centminmod php-fpm + no PGO (3.10.0-862.3.2) 0.4310 2.3460 2.0493 4.8263
    PHP 7.0.32 centminmod php-fpm + PGO tuned (3.10.0-862.14.4) 0.4297 2.3350 1.8310 4.5957
    PHP 7.0.32 centminmod php-fpm + PGO (3.10.0-862.14.4) 0.4293 2.3343 2.4027 5.1663
    PHP 7.0.32 centminmod php-fpm + PGO (3.10.0-862.3.2) 0.4320 2.3327 2.4067 5.1714
    PHP 7.0.32 centminmod php-fpm + no PGO (3.10.0-862.14.4) 0.4573 2.3747 2.0973 4.9293
    PHP 7.0.32 centminmod php-fpm + no PGO (3.10.0-862.3.2) 0.4603 2.3727 2.1070 4.94
    PHP 7.3.0RC6 remi scl php-fpm (3.10.0-862.14.4) 0.3873 2.0250 1.9090 4.3213
    PHP 7.3.0RC6 remi scl php-fpm (3.10.0-862.3.2) 0.3907 2.0170 1.9153 4.323
    PHP 7.2.13RC1 remi scl php-fpm (3.10.0-862.14.4) 0.4017 2.3210 2.0050 4.7277
    PHP 7.2.13RC1 remi scl php-fpm (3.10.0-862.3.2) 0.4063 2.2530 2.0160 4.6753
    PHP 7.1.25RC1 remi scl php-fpm (3.10.0-862.14.4) 0.4237 2.5137 2.1347 5.0721
    PHP 7.1.25RC1 remi scl php-fpm (3.10.0-862.3.2) 0.4267 2.4033 2.1490 4.979
    PHP 7.0.32 remi scl php-fpm (3.10.0-862.14.4) 0.4517 2.4390 2.1940 5.0847
    PHP 7.0.32 remi scl php-fpm (3.10.0-862.3.2) 0.4580 2.3997 2.2053 5.063


    Updated chart with PGO tuned training for detailed_benchmarks.php runs for PHP 7.3.0RC6, 7.2.12, 7.1.24 and 7.0.32

    php7.3.0rc6-pgo-tuned-261118-chart1-02.png
     
    Last edited: Nov 26, 2018
    • Informative Informative x 2
  3. eva2000

    eva2000 Administrator Staff Member

    37,261
    8,141
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +12,533
    Local Time:
    9:55 AM
    Nginx 1.15.x
    MariaDB 5.5/10.x

    PHP 7.3 Wordpress 5.0 RC1 Profile Guided Optimization Trained Benchmarks



    Next I installed Wordpress 5.0 RC1 manually via WPCLI command line and not via Centmin Mod 123.09beta01 centmin.sh 22 Wordpress installer so that I can get a stock Wordpress 5.0 RC1 install and run PHP 7 benchmarks against it with both Profile Guided Optimizations (PGO) training specifically for Wordpress 5.0 RC1 index.php page and PGO tuned training for detailed_benchmarks.php script.

    Code (Text):
    \wp core version --extra --allow-root
    WordPress version: 5.0-RC1
    Database revision: 43764
    TinyMCE version:   4.800 (4800-20180716)
    Package language:  en_US
    

    Code (Text):
    \wp plugin status --allow-root
    1 installed plugin:
      I akismet 4.1
    
    Legend: I = Inactive
    


    PHP 7 Wordpress 5.0 RC1 PGO Custom Training

    Centmin Mod 123.09beta01 also supports end user control to add additional variable = PHPPGO_INDEXPATH to specify additional PHP script paths which can be added to PGO training phase to optimise for those specific PHP code paths as well.

    I set the variable PHPPGO_INDEXPATH to /FULL/PATH/TO/scripts/detailed_benchmark.php where the script is located on my server and then in persistent config file /etc/centminmod/custom_config.inc prior to centmin.sh menu option 5 PHP recompiles for PHP 7.3.0RC6.

    PGO Tuned
    Code (Text):
    PHPPGO_INDEXPATH='/FULL/PATH/TO/scripts/detailed_benchmark.php'
    

    Wordpress PGO Trained via setting PHPPGO_INDEXPATH_TWO variable
    Code (Text):
    PHPPGO_INDEXPATH='/root/tools/php71/scripts/detailed_benchmark.php'
    PHPPGO_INDEXPATH_TWO='/home/nginx/domains/wp5.domain.com/public/index.php'
    


    Then run centmin.sh menu option 5 to recompile PHP 7.3.0RC6 and did same for PHP 7.2.12, 7.1.24 and 7.0.32
    Code (Text):
    --------------------------------------------------------
         Centmin Mod Menu 123.09beta01 centminmod.com
    --------------------------------------------------------
    1).  Centmin Install
    2).  Add Nginx vhost domain
    3).  NSD setup domain name DNS
    4).  Nginx Upgrade / Downgrade
    5).  PHP Upgrade / Downgrade
    6).  XCache Re-install
    7).  APC Cache Re-install
    8).  XCache Install
    9).  APC Cache Install
    10). Memcached Server Re-install
    11). MariaDB MySQL Upgrade & Management
    12). Zend OpCache Install/Re-install
    13). Install/Reinstall Redis PHP Extension
    14). SELinux disable
    15). Install/Reinstall ImagicK PHP Extension
    16). Change SSHD Port Number
    17). Multi-thread compression: pigz,pbzip2,lbzip2...
    18). Suhosin PHP Extension install
    19). Install FFMPEG and FFMPEG PHP Extension
    20). NSD Install/Re-Install
    21). Update - Nginx + PHP-FPM + Siege
    22). Add Wordpress Nginx vhost + Cache Plugin
    23). Update Centmin Mod Code Base
    24). Exit
    --------------------------------------------------------
    Enter option [ 1 - 24 ] 5
    --------------------------------------------------------
    

    Code (Text):
    Do you want to run YUM install checks ?  [y/n]
    
    This will increase your upgrade duration time wise.
    Check the change log centminmod.com/changelog.html
    to see if any Nginx or PHP related new additions
    which require checking YUM prequisites are met.
    If no new additions made, you can skip the
    YUM install check to speed up upgrade time.
    
     [y/n]: n
    
    PHP Upgrade/Downgrade - Would you like to continue? [y/n] y
    
    ----------------------------------------------------------------
    Install which version of PHP? (version i.e. 5.6.38, 7.0.30, NGDEBUG)
    PHP 7.x/7.1.x/7.2.x is GA Stable but still may have broken PHP extensions.
    NGDEBUG is PHP 7.3.0 dev builds minus incompatible PHP extensions
    ----------------------------------------------------------------
    Enter PHP Version number you want to upgrade/downgrade to: 7.3.0RC6
    ----------------------------------------------------------------
    existing php.ini will be backed up at /usr/local/lib/php.ini-oldversion_251118-230847
    ----------------------------------------------------------------
    Downloading PHP 7.3.0RC6 from https://downloads.php.net/~cmb/
    Download php-7.3.0RC6.tar.xz ...
    wget -4cnv https://downloads.php.net/~cmb/php-7.3.0RC6.tar.xz --tries=3
    2018-11-25 23:09:03 URL:https://downloads.php.net/~cmb/php-7.3.0RC6.tar.xz [11918172/11918172] -> "php-7.3.0RC6.tar.xz" [1]
    Download done.
    php-7.3.0RC6.tar.xz valid file.
    

    Code (Text):
    -----------------------------------------------------------------------------------------
    Detected PHP 7.3 branch.
    You can compile Zend OPcache (Zend Optimizer Plus+) support
    as an alternative to using APC Cache or Xcache cache.
    But Zend OPcache only provides PHP opcode cache and
    DOESN'T do data caching, so if your web apps such as Wordpress,
    Drupal or vBulletin require data caching to APC or Xcache,
    it won't work with Zend OPcache.
    
    -----------------------------------------------------------------------------------------
    Do you want to use Zend OPcache [y/n] ? y
    
    *************************************************
    * Zend Optimizer Plus OPcache configured
    *************************************************
    
    PHP 7+ detected which uses newer mysqlnd
    or PDO MySQL extensions and removed the
    legacy mysql extension. You can optionally
    re-add the removed legacy mysql extension
    to PHP 7+ by answering yes to next question
    Only answer yes if you know for sure you
    have very old web scripts which need mysql
    legacy extension re-added. Otherwise answer
    no which is recommended for best stability
    
    Re-add legacy mysql extension to PHP 7+ [y/n] ? n
    


    Wordpress 5.0 RC1 PHP 7 wrk-cmm Benchmarks



    I ran benchmarks using my custom forked version of wrk, wrk-cmm
    Code (Text):
    git clone -b centminmod https://github.com/centminmod/wrk wrk-cmm
    cd wrk-cmm
    make
    \cp -af wrk /usr/local/bin/wrk-cmm
    

    Code (Text):
    wrk-cmm --help
    Usage: wrk <options> <url>                       
      Options:                                       
        -c, --connections <N>  Connections to keep open
        -d, --duration    <T>  Duration of test       
        -t, --threads     <N>  Number of threads to use
                                                     
        -b, --bind-ip     <S>  Source IP (or CIDR mask)
                                                     
        -s, --script      <S>  Load Lua script file   
        -H, --header      <H>  Add header to request 
            --latency          Print latency statistics
            --breakout         Print breakout statistics
            --timeout     <T>  Socket/request timeout 
        -v, --version          Print version details 
                                                     
      Numeric arguments may include a SI unit (1k, 1M, 1G)
      Time arguments may include a time unit (2s, 2m, 2h)
    

    Using following wrk-cmm test paramters
    Code (Text):
    wrk-cmm -t1 -c100 -d15s --breakout http://wp5.domain.com
    


    System:
    • OVH MC-32 Intel Core i7 4790K
    • 32GB Memory
    • 2x240GB SSD
    • 250Mbit Network Bandwidth
    • CentOS 7.5 64bit
    • Centmin Mod 123.09beta01 LEMP stack - Nginx 1.15.6, MariaDB 10.1.33 MySQL, + CSF Firewall
    • BHS, Canada
    Notes:
    • As expected specific Wordpress PGO trained PHP 7 versions were the fastest within each major PHP 7.3, 7.2, 7.1, 7.0 branches for Centmin Mod 123.09beta01 built PHP-FPM versions.
    • Each version with WP PGO training allowed it to be almost as fast as the next faster major version. So Centmin Mod 123.09beta01 built PHP-FPM 7.0.32 and 7.1.24 with WP PGO training was nearly as fast as Remi SCL built PHP 7.2.13RC1 and Centmin Mod 123.09beta01 built PHP-FPM 7.2.12 with WP PGO training was nearly as fast as Remi SCL built PHP 7.3.0RC6
    • You can find the raw wrk-cmm benchmark numbers here.
    • 3 charts below for average requests/s (higher = faster) and avg Time To First Byte (TTFB) and max TTFB metrics measured in milliseconds (lower = faster).
    wordpress-5.0-rc1-benchmarks-php73-01.png wordpress-5.0-rc1-benchmarks-php73-02.png wordpress-5.0-rc1-benchmarks-php73-03.png

    Wordpress 5.0 RC1

    wordpress-5.0-rc1-admin-01.png

    wordpress-5.0-rc1-01.png
     
  4. eva2000

    eva2000 Administrator Staff Member

    37,261
    8,141
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +12,533
    Local Time:
    9:55 AM
    Nginx 1.15.x
    MariaDB 5.5/10.x

    PHP 7.3.0 GA Release Benchmarks



    PHP 7.3.0 GA release is out now so retested my benchmarks outlined here with latest PHP 7.2.13, 7.1.24 and 7.0.33 final releases as comparison. For Centmin Mod 123.09beta01 PHP-FPM, I tested with and without PGO Wordpress trained profiles.

    System:
    • OVH MC-32 Intel Core i7 4790K
    • 32GB Memory
    • 2x240GB SSD
    • 250Mbit Network Bandwidth
    • CentOS 7.5 64bit
    • Centmin Mod 123.09beta01 LEMP stack - Nginx 1.15.6, MariaDB 10.1.33 MySQL, + CSF Firewall
    • BHS, Canada
    Tests use following scripts

    Notes:
    • 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 25, 2018
    • Linux Kernel 3.10.0-862.14.4.el7 used
    Times are in seconds where lower is faster

    php7.3.0-ga-wp-pgo-tuned-081218-table1-02.png
    php7.3.0-ga-wp-pgo-tuned-081218-chart1-01.png
     
..
Thread Status:
Not open for further replies.