|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
[2020-12-01 10:57 UTC] 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.
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
|
|||||||||||||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Tue Nov 04 20:00:01 2025 UTC |
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"