Bug #80450 [Com]: JIT config in PHP-FPM
Edit report at https://bugs.php.net/bug.php?id=80450&edit=1
ID: 80450
Comment by: stefan dot heitmueller at root360 dot de
Reported by: vagiz at kaifas dot lt
Summary: JIT config in PHP-FPM
Status: Open
Type: Bug
Package: *Configuration Issues
Operating System: CentOS 8
PHP Version: 8.0.1
Block user comment: N
Private report: N
New Comment:
Just tried by activating it globally in /etc/php/8.0/fpm/conf.d/10-opcache.ini (which works) and
then selectively disabling it in a pool config using php_admin_value[opcache.jit_buffer_size] = 0,
which does not work.
Previous Comments:
------------------------------------------------------------------------
[2021-05-12 09:02:10] stefan dot heitmueller at root360 dot de
Hi!
Just discovered the same while trying to setup opcache jit per fpm pool config.
Setting values from fpm config seems to work, it just looks like the module does not get activated.
------------------------------------------------------------------------
[2021-01-16 01:08:47] vagiz at kaifas dot lt
I decided to re-tested and summarize it again:
php -v returns:
PHP 8.0.1 (cli) (built: Jan 5 2021 13:54:54) ( NTS gcc x86_64 )
Copyright (c) The PHP Group
Zend Engine v4.0.1, Copyright (c) Zend Technologies
with Zend OPcache v8.0.1, Copyright (c), by Zend Technologies
CONFIGURATION #1:
opcache part from phpinfo():
opcache.blacklist_filename /etc/opt/remi/php80/php.d/opcache*.blacklist /etc/opt/remi/php80/php.d/opcache*.blacklist
opcache.consistency_checks 0 0
opcache.dups_fix Off Off
opcache.enable On On
opcache.enable_cli On On
opcache.enable_file_override Off Off
opcache.error_log no value no value
opcache.file_cache no value no value
opcache.file_cache_consistency_checks On On
opcache.file_cache_only Off Off
opcache.file_update_protection 2 2
opcache.force_restart_timeout 180 180
opcache.huge_code_pages On On
opcache.interned_strings_buffer 16 16
opcache.jit 1255 1255
opcache.jit_bisect_limit 0 0
opcache.jit_blacklist_root_trace 16 16
opcache.jit_blacklist_side_trace 8 8
opcache.jit_buffer_size 240M 240M
opcache.jit_debug 0 0
opcache.jit_hot_func 127 127
opcache.jit_hot_loop 64 64
opcache.jit_hot_return 8 8
opcache.jit_hot_side_exit 8 8
opcache.jit_max_exit_counters 8192 8192
opcache.jit_max_loop_unrolls 8 8
opcache.jit_max_polymorphic_calls 2 2
opcache.jit_max_recursive_calls 2 2
opcache.jit_max_recursive_returns 2 2
opcache.jit_max_root_traces 1024 1024
opcache.jit_max_side_traces 128 128
opcache.jit_prof_threshold 0.005 0.005
opcache.lockfile_path /tmp /tmp
opcache.log_verbosity_level 1 1
opcache.max_accelerated_files 40000 40000
opcache.max_file_size 0 0
opcache.max_wasted_percentage 5 5
opcache.memory_consumption 64 64
opcache.opt_debug_level 0 0
opcache.optimization_level 0x7FFEBFFF 0x7FFEBFFF
opcache.preferred_memory_model no value no value
opcache.preload no value no value
opcache.preload_user no value no value
opcache.protect_memory Off Off
opcache.record_warnings Off Off
opcache.restrict_api no value no value
opcache.revalidate_freq 60 60
opcache.revalidate_path Off Off
opcache.save_comments On On
opcache.use_cwd On On
opcache.validate_permission On On
opcache.validate_root On On
opcache.validate_timestamps Off Off
var_dump(opcache_get_status()['jit']) returns:
array(7) {
["enabled"]=>
bool(true)
["on"]=>
bool(true)
["kind"]=>
int(5)
["opt_level"]=>
int(5)
["opt_flags"]=>
int(6)
["buffer_size"]=>
int(268435440)
["buffer_free"]=>
int(268396912)
}
"cat /etc/opt/remi/php80/php.d/10-opcache.ini |grep jit" returns:
opcache.jit_buffer_size=256M
opcache.jit=1255
"cat /etc/php-fpm.d/domains/*|grep jit" returns:
php_value[opcache.jit] = 1255
php_value[opcache.jit_buffer_size] = 240M
CONFIGURATION #2:
opcache part from phpinfo():
opcache.blacklist_filename /etc/opt/remi/php80/php.d/opcache*.blacklist /etc/opt/remi/php80/php.d/opcache*.blacklist
opcache.consistency_checks 0 0
opcache.dups_fix Off Off
opcache.enable On On
opcache.enable_cli On On
opcache.enable_file_override Off Off
opcache.error_log no value no value
opcache.file_cache no value no value
opcache.file_cache_consistency_checks On On
opcache.file_cache_only Off Off
opcache.file_update_protection 2 2
opcache.force_restart_timeout 180 180
opcache.huge_code_pages On On
opcache.interned_strings_buffer 16 16
opcache.jit tracing tracing
opcache.jit_bisect_limit 0 0
opcache.jit_blacklist_root_trace 16 16
opcache.jit_blacklist_side_trace 8 8
opcache.jit_buffer_size 240M 240M
opcache.jit_debug 0 0
opcache.jit_hot_func 127 127
opcache.jit_hot_loop 64 64
opcache.jit_hot_return 8 8
opcache.jit_hot_side_exit 8 8
opcache.jit_max_exit_counters 8192 8192
opcache.jit_max_loop_unrolls 8 8
opcache.jit_max_polymorphic_calls 2 2
opcache.jit_max_recursive_calls 2 2
opcache.jit_max_recursive_returns 2 2
opcache.jit_max_root_traces 1024 1024
opcache.jit_max_side_traces 128 128
opcache.jit_prof_threshold 0.005 0.005
opcache.lockfile_path /tmp /tmp
opcache.log_verbosity_level 1 1
opcache.max_accelerated_files 40000 40000
opcache.max_file_size 0 0
opcache.max_wasted_percentage 5 5
opcache.memory_consumption 64 64
opcache.opt_debug_level 0 0
opcache.optimization_level 0x7FFEBFFF 0x7FFEBFFF
opcache.preferred_memory_model no value no value
opcache.preload no value no value
opcache.preload_user no value no value
opcache.protect_memory Off Off
opcache.record_warnings Off Off
opcache.restrict_api no value no value
opcache.revalidate_freq 60 60
opcache.revalidate_path Off Off
opcache.save_comments On On
opcache.use_cwd On On
opcache.validate_permission On On
opcache.validate_root On On
opcache.validate_timestamps Off Off
var_dump(opcache_get_status()['jit']) returns:
array(7) {
["enabled"]=>
bool(false)
["on"]=>
bool(false)
["kind"]=>
int(5)
["opt_level"]=>
int(4)
["opt_flags"]=>
int(6)
["buffer_size"]=>
int(0)
["buffer_free"]=>
int(0)
}
"cat /etc/opt/remi/php80/php.d/10-opcache.ini |grep jit" returns:
;opcache.jit_buffer_size=256M
;opcache.jit=1255
"cat /etc/php-fpm.d/domains/*|grep jit" returns :
php_value[opcache.jit] = 1255
php_value[opcache.jit_buffer_size] = 240M
I'm using multi-master-multi-version setup.
Or in other words, every user can have multi-version php-fpm and own opcache at the same time.
However, I'm not able to enable/disable JIT via php-fpm config (only via opcache.ini,
globally).
question: is there a way to do that via fpm config?
CONFIGURATION #1:
"opcache.jit_buffer_size=256M" is set in opcache.ini file,
"php_value[opcache.jit_buffer_size] = 240M" is set in FPM config.
Function call to opcache_get_status() ['jit'] returns 268435440 as
"buffer_size".
phpinfo() returns "opcache.jit_buffer_size 240M 240M"
CONFIGURATION #2:
"php_value[opcache.jit_buffer_size] = 240M" is set in FPM config.
Function call to opcache_get_status(), ['jit'] returns 0 as "buffer_size",
however the opcache part from phpinfo() displays "opcache.jit_buffer_size 240M 240M"
------------------------------------------------------------------------
[2020-12-01 11:28:30] cmb@php.net
This *might* be related to bug #80419.
------------------------------------------------------------------------
[2020-12-01 11:00:10] vagiz at kaifas dot lt
copy paste mistake:
in the first message <..>Case 2:
Case 1:<..>
should be "Case 2:" only
------------------------------------------------------------------------
[2020-12-01 10:57:25] vagiz at kaifas dot lt
Description:
------------
Case 1:
file 10-opcache.ini has additional lines:
opcache.jit_buffer_size=256M
opcache.jit=1255
PHP-FPM has additional lines:
php_value[opcache.jit] = 1255
php_value[opcache.jit_buffer_size] = 105M
phpinfo() output:
JIT On
opcache.jit 1255 1255
opcache.jit_bisect_limit 0 0
opcache.jit_blacklist_root_trace 16 16
opcache.jit_blacklist_side_trace 8 8
opcache.jit_buffer_size 105M 105M
opcache.jit_debug 0 0
opcache.jit_hot_func 127 127
opcache.jit_hot_loop 64 64
opcache.jit_hot_return 8 8
opcache.jit_hot_side_exit 8 8
opcache.jit_max_exit_counters 8192 8192
opcache.jit_max_loop_unrolls 8 8
opcache.jit_max_polymorphic_calls 2 2
opcache.jit_max_recursive_calls 2 2
opcache.jit_max_recursive_returns 2 2
opcache.jit_max_root_traces 1024 1024
opcache.jit_max_side_traces 128 128
opcache.jit_prof_threshold 0.005 0.005
var_dump(opcache_get_status()['jit']) output:
array(7) {
["enabled"]=>
bool(true)
["on"]=>
bool(true)
["kind"]=>
int(5)
["opt_level"]=>
int(5)
["opt_flags"]=>
int(6)
["buffer_size"]=>
int(268435440)
["buffer_free"]=>
int(268431584)
}
Looks like opcache.jit_buffer_size is different.
Case 2:
Case 1:
file 10-opcache.ini has no any additional variables.
PHP-FPM has additional lines:
php_value[opcache.jit] = 1255
php_value[opcache.jit_buffer_size] = 105M
var_dump(opcache_get_status()['jit']) output:
array(7) {
["enabled"]=>
bool(false)
["on"]=>
bool(false)
["kind"]=>
int(5)
["opt_level"]=>
int(4)
["opt_flags"]=>
int(6)
["buffer_size"]=>
int(0)
["buffer_free"]=>
int(0)
}
phpinfo() output:
JIT Disabled
opcache.enable On
opcache.jit tracing tracing
opcache.jit_bisect_limit 0 0
opcache.jit_blacklist_root_trace 16 16
opcache.jit_blacklist_side_trace 8 8
opcache.jit_buffer_size 105M 105M
opcache.jit_debug 0 0
opcache.jit_hot_func 127 127
opcache.jit_hot_loop 64 64
opcache.jit_hot_return 8 8
opcache.jit_hot_side_exit 8 8
opcache.jit_max_exit_counters 8192 8192
opcache.jit_max_loop_unrolls 8 8
opcache.jit_max_polymorphic_calls 2 2
opcache.jit_max_recursive_calls 2 2
opcache.jit_max_recursive_returns 2 2
opcache.jit_max_root_traces 1024 1024
opcache.jit_max_side_traces 128 128
opcache.jit_prof_threshold 0.005 0.005
It leads me to confusion.
I've been following https://stitcher.io/blog/php-8-jit-setup guide.
I'm using https://rpms.remirepo.net/ , the latest
version:
PHP -v:
PHP 8.0.0 (cli) (built: Nov 24 2020 17:04:03) ( NTS gcc x86_64 )
Copyright (c) The PHP Group
Zend Engine v4.0.0-dev, Copyright (c) Zend Technologies
with Zend OPcache v8.0.0, Copyright (c), by Zend Technologies
Is it possible to enable jit via FPM?
p.s. I'm happy to provide full details/files on this case.
------------------------------------------------------------------------
--
Edit this bug report at https://bugs.php.net/bug.php?id=80450&edit=1
Thread (8 messages)