Join the community today
Become a Member

Featured Added Profile Guided Optimizations To Boost PHP 7 Performance

Discussion in 'Centmin Mod News' started by eva2000, Oct 1, 2016.

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:
    2:37 AM
    Nginx 1.27.x
    MariaDB 10.x/11.4+

    Added Profile Guided Optimizations To Boost PHP 7 Performance



    Updated latest Centmin Mod 123.09beta01 with optional support for Profile Guided Optimized PHP 7 only builds which boost PHP performance by between 3-17% for Wordpress, MediaWiki and Drupal like PHP web applications and similar PHP execution patterns. However, due to PGO requiring to compile PHP twice, it will take longer to compile PHP 7. Details outlined here and on Intel's blog here. PGO is one of the performance configuration tips I listed in my guide at Insight Guide - How to boost Centmin Mod LEMP stack performance.

    When you recompile/compile PHP 7 via centmin.sh menu option 5 with PHP_PGO='y' set in persistent config file /etc/centminmod/custom_config.inc, the ending text for PHP 7 compile will read.
    Code (Text):
    ***************************************************
    * PHP upgraded and auto reinstalled PHP extensions
    * PHP_PGO='y' detected. PHP compiled with Profile Guided Optimizations
    * https://software.intel.com/en-us/blogs/2015/10/09/pgo-let-it-go-php
    ***************************************************


    The php log would also display at make stage the following
    Code (Text):
                   ____   _   _  ____       __  __         _      
                  |  _ \ | | | ||  _ \  _  |  \/  |  __ _ | | __ ___
                  | |_) || |_| || |_) |(_) | |\/| | / _` || |/ // _ \
                  |  __/ |  _  ||  __/  _  | |  | || (_| ||   <|  __/
                  |_|    |_| |_||_|    (_) |_|  |_| \__,_||_|\_\\___|
                                                                   
    make -j11 prof-gen
    CCACHE_DISABLE=1 make PROF_FLAGS=-fprofile-generate all
    


    PGO PHP 7 training phase for Wordpress, MediaWiki and Drupal like PHP usage loads will auto generate a MySQL database called pgo_train for this training and will have repeated output similar to below during PHP 7 compilation with PHP_PGO='y' set.
    Code (Text):
    
                    -=- init Database(s) -=-
    Database pgo_train succesfully dropped
    Database pgo_train created succesfully
    Created tables in pgo_train
    
                    -=- Existing Databases -=-
    information_schema
    mysql
    performance_schema
    pgo_train
    Content-type: text/html; charset=UTF-8
    
    Hash benchmark module loaded!
    MySQL benchmark module loaded!
    Date benchmark module loaded!
    String benchmark module loaded!
    Standard benchmark module loaded!
    Class benchmark module loaded!
    
    --------------------------------
    -   Benchmark timing results   -
    --------------------------------
    1.run_hash                 0.055
    2.run_hash                 0.055
    3.run_hash                 0.055
    4.run_hash                 0.055
    --------------------------------
    1.run_mysql_queries        0.020
    2.run_mysql_queries        0.018
    3.run_mysql_queries        0.019
    4.run_mysql_queries        0.018
    --------------------------------
    1.run_time                 0.002
    2.run_time                 0.002
    3.run_time                 0.002
    4.run_time                 0.002
    --------------------------------
    1.run_string               0.012
    2.run_string               0.012
    3.run_string               0.012
    4.run_string               0.012
    --------------------------------
    1.run_standard             0.016
    2.run_standard             0.016
    3.run_standard             0.016
    4.run_standard             0.016
    --------------------------------
    1.run_class                0.001
    2.run_class                0.001
    3.run_class                0.001
    4.run_class                0.001
    --------------------------------
    Total                      0.418
    



     
    Last edited: Oct 1, 2016
  2. eva2000

    eva2000 Administrator Staff Member

    54,106
    12,179
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +18,738
    Local Time:
    2:37 AM
    Nginx 1.27.x
    MariaDB 10.x/11.4+
  3. eva2000

    eva2000 Administrator Staff Member

    54,106
    12,179
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +18,738
    Local Time:
    2:37 AM
    Nginx 1.27.x
    MariaDB 10.x/11.4+
  4. eva2000

    eva2000 Administrator Staff Member

    54,106
    12,179
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +18,738
    Local Time:
    2:37 AM
    Nginx 1.27.x
    MariaDB 10.x/11.4+
    FYI, Centmin Mod 123.09beta01 was recently updated to only enable PHP_PGO='y' if there's more than 2 cpu threads on server due to extended compilation times for PHP which would be slower with only 1 cpu thread. When 1 cpu thread/core server is detected, Centmin Mod forces PHP_PGO='n' now.
     
  5. eva2000

    eva2000 Administrator Staff Member

    54,106
    12,179
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +18,738
    Local Time:
    2:37 AM
    Nginx 1.27.x
    MariaDB 10.x/11.4+
  6. eva2000

    eva2000 Administrator Staff Member

    54,106
    12,179
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +18,738
    Local Time:
    2:37 AM
    Nginx 1.27.x
    MariaDB 10.x/11.4+
Thread Status:
Not open for further replies.