Skip to content

Commit

Permalink
add PHP_PGO_ALWAYS='n' variable in 123.09beta01
Browse files Browse the repository at this point in the history
for PHP 7+ installs, setting PHP_PGO='y' will enable Profile Guided Optimizations for 5-25% better PHP performance but it takes longer for PHP to compile so by default PHP_PGO only enables if you have more than 2 cpu threads on server detected. If your server has 1 cpu core, then PHP_PGO is auto disabled even if you try to enable it. But this update adds a variable PHP_PGO_ALWAYS='n' by default which when set to PHP_PGO_ALWAYS='y' in persistent config file /etc/centminmod/custom_config.inc will override and enable PHP_PGO enable when PHP_PGO='y' set for 1 cpu thread servers too. PHP compiles times can be between 60-90% slower on 1 cpu core servers as PHP compile times depend on how many cpu cores and clock speed of those cpu cores. More cpu cores that are high cpu clock speed = faster PHP compile times.
  • Loading branch information
centminmod committed Apr 4, 2019
1 parent 9979d45 commit b67d33a
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 1 deletion.
3 changes: 2 additions & 1 deletion centmin.sh
Expand Up @@ -27,7 +27,7 @@ DT=$(date +"%d%m%y-%H%M%S")
branchname='123.09beta01'
SCRIPT_MAJORVER='1.2.3'
SCRIPT_MINORVER='09'
SCRIPT_INCREMENTVER='124'
SCRIPT_INCREMENTVER='125'
SCRIPT_VERSIONSHORT="${branchname}"
SCRIPT_VERSION="${SCRIPT_VERSIONSHORT}.b${SCRIPT_INCREMENTVER}"
SCRIPT_DATE='31/03/2019'
Expand Down Expand Up @@ -426,6 +426,7 @@ CLANG_APC='n' # APC Cache
CLANG_MEMCACHED='n' # Memcached menu option 10 routine
GCCINTEL_PHP='y' # enable PHP-FPM GCC compiler with Intel cpu optimizations
PHP_PGO='n' # Profile Guided Optimization https://software.intel.com/en-us/blogs/2015/10/09/pgo-let-it-go-php
PHP_PGO_ALWAYS='n' # override for PHP_PGO enable for 1 cpu thread servers too
PHP_PGO_TRAINRUNS='80' # number of runs done during PGO PHP 7 training runs
PHP_PGO_CENTOSSIX='n' # CentOS 6 may need GCC >4.4.7 fpr PGO so use devtoolset-4 GCC 5.3
DEVTOOLSET_PHP='n' # use devtoolset GCC for GCCINTEL_PHP='y'
Expand Down
1 change: 1 addition & 0 deletions example/custom_config.inc
Expand Up @@ -47,6 +47,7 @@ CLANG_APC='n' # APC Cache
CLANG_MEMCACHED='n' # Memcached menu option 10 routine
GCCINTEL_PHP='y' # enable PHP-FPM GCC compiler with Intel cpu optimizations
PHP_PGO='n' # Profile Guided Optimization https://software.intel.com/en-us/blogs/2015/10/09/pgo-let-it-go-php
PHP_PGO_ALWAYS='n' # override for PHP_PGO enable for 1 cpu thread servers too
PHP_PGO_TRAINRUNS='80' # number of runs done during PGO PHP 7 training runs
PHP_PGO_CENTOSSIX='n' # CentOS 6 may need GCC >4.4.7 fpr PGO so use devtoolset-4 GCC 5.3
DEVTOOLSET_PHP='n' # use devtoolset GCC for GCCINTEL_PHP='y'
Expand Down
6 changes: 6 additions & 0 deletions inc/php_configure.inc
Expand Up @@ -835,6 +835,12 @@ elif [[ "$PHPMVER" = '7.3' || "$PHPMUVER" = '7.3' || "$PHPMVER" = '7.4' || "$PHP
# detected due to being very very slow for php compile times
GCCINTEL_PHP='y'
fi
if [[ "$PHP_PGO_ALWAYS" = [yY] ]]; then
# override above greater than 2 cpu only PHP PGO enabling
# so when PHP_PGO_ALWAYS='y' set, you can even do PHP PGO
# compilations when you have 1 cpu detected
PHP_PGO='y'
fi

if [[ "$CLANG_PHP" = [yY] ]]; then
if [[ "$CENTOS_SIX" = '6' && ! -f /usr/bin/clang ]] || [[ "$CENTOS_SEVEN" = '7' && ! -f /bin/clang ]]; then
Expand Down
6 changes: 6 additions & 0 deletions inc/php_upgrade.inc
Expand Up @@ -577,6 +577,12 @@ if [[ "$(grep -c "processor" /proc/cpuinfo)" -lt '2' ]]; then
# Disable PGO if less than 2 cpu threads
PHP_PGO='n'
fi
if [[ "$PHP_PGO_ALWAYS" = [yY] ]]; then
# override above greater than 2 cpu only PHP PGO enabling
# so when PHP_PGO_ALWAYS='y' set, you can even do PHP PGO
# compilations when you have 1 cpu detected
PHP_PGO='y'
fi

if [ -f "$(which figlet)" ]; then
figlet -ckf standard "PHP: Make"
Expand Down

0 comments on commit b67d33a

Please sign in to comment.