Bug #77862 [NEW]: opcache.huge_code_pages can not be disabled
| From: | hawu at fast-mail dot one | Date: | Sun, 07 Apr 2019 01:21:49 +0000 |
| Subject: | Bug #77862 [NEW]: opcache.huge_code_pages can not be disabled | ||
| Groups: | php.bugs | ||
| Request: | Send a blank email to php-bugs+get-220340@lists.php.net to get a copy of this message | ||
From: hawu at fast-mail dot one
Operating system: Debian 9
PHP version: 7.3Git-2019-04-07 (snap)
Package: PHP options/info functions
Bug Type: Bug
Bug description:opcache.huge_code_pages can not be disabled
Description:
------------
php --version
PHP 7.3.3-1+0~20190307202245.32+stretch~1.gbp32ebb2 (cli) (built: Mar 7
2019 20:22:46) ( NTS )
Copyright (c) 1997-2018 The PHP Group
Zend Engine v3.3.3, Copyright (c) 1998-2018 Zend Technologies
with Zend OPcache v7.3.3-1+0~20190307202245.32+stretch~1.gbp32ebb2,
Copyright (c) 1999-2018, by Zend Technologies
Using Debian 9 with 1GB hugepages configured as such:
"transparent_hugepage=never default_hugepagesz=1GB hugepagesz=1GB
hugepages=4"
Setting opcache.huge_code_pages=0 will NOT disable usage of huge pages.
# cat /etc/php/7.3/fpm/php.ini | grep opcache.
[opcache]
opcache.enable=1
;opcache.enable_cli=0
opcache.memory_consumption=256
;opcache.interned_strings_buffer=8
;opcache.max_accelerated_files=10000
;opcache.max_wasted_percentage=5
;opcache.use_cwd=1
;opcache.validate_timestamps=1
;opcache.revalidate_freq=2
;opcache.revalidate_path=0
;opcache.save_comments=1
;opcache.enable_file_override=0
;opcache.optimization_level=0x7FFFBFFF
;opcache.dups_fix=0
;opcache.blacklist_filename=
;opcache.max_file_size=0
;opcache.consistency_checks=0
;opcache.force_restart_timeout=180
;opcache.error_log=
;opcache.log_verbosity_level=1
;opcache.preferred_memory_model=
;opcache.protect_memory=0
;opcache.restrict_api=
;opcache.mmap_base=
;opcache.file_cache=
;opcache.file_cache_only=0
;opcache.file_cache_consistency_checks=1
;opcache.file_cache_fallback=1
opcache.huge_code_pages=0
;opcache.validate_permission=0
;opcache.validate_root=0
;opcache.opt_debug_level=0
# cat /proc/meminfo | grep HugePages_
HugePages_Total: 4
HugePages_Free: 3
HugePages_Rsvd: 0
HugePages_Surp: 0
# service php7.3-fpm stop
# cat /proc/meminfo | grep HugePages_
HugePages_Total: 4
HugePages_Free: 4
HugePages_Rsvd: 0
HugePages_Surp: 0
However setting opcache.enabled=0 (or stopping php7.3-fpm) will result
in huge pages not being used.
Changing opcache.memory_consumption DOES have an effect of huge pages
(setting it to 1500 will reserve an additional 1 GB huge page)
cat /proc/meminfo | grep HugePages_
HugePages_Total: 4
HugePages_Free: 3
HugePages_Rsvd: 1
HugePages_Surp: 0
There does not seem to be a way to use opcache without using huge pages.
The only way to not use huge pages is to disable cache completely via
opcache.enabled=0.
Also, looking at the output of "print_r(opcache_get_configuration())"
does not mention opcache.huge_code_pages regardless of how it is
configured (it does show status of opcache.enabled,
opcache.memory_consumption and others).
--
Edit bug report at https://bugs.php.net/bug.php?id=77862&edit=1
--
Try a snapshot (PHP 5.4): https://bugs.php.net/fix.php?id=77862&r=trysnapshot54
Try a snapshot (PHP 5.5): https://bugs.php.net/fix.php?id=77862&r=trysnapshot55
Try a snapshot (trunk): https://bugs.php.net/fix.php?id=77862&r=trysnapshottrunk
Fixed in SVN: https://bugs.php.net/fix.php?id=77862&r=fixed
Fixed in release: https://bugs.php.net/fix.php?id=77862&r=alreadyfixed
Need backtrace: https://bugs.php.net/fix.php?id=77862&r=needtrace
Need Reproduce Script: https://bugs.php.net/fix.php?id=77862&r=needscript
Try newer version: https://bugs.php.net/fix.php?id=77862&r=oldversion
Not developer issue: https://bugs.php.net/fix.php?id=77862&r=support
Expected behavior: https://bugs.php.net/fix.php?id=77862&r=notwrong
Not enough info: https://bugs.php.net/fix.php?id=77862&r=notenoughinfo
Submitted twice: https://bugs.php.net/fix.php?id=77862&r=submittedtwice
register_globals: https://bugs.php.net/fix.php?id=77862&r=globals
PHP 4 support discontinued: https://bugs.php.net/fix.php?id=77862&r=php4
Daylight Savings: https://bugs.php.net/fix.php?id=77862&r=dst
IIS Stability: https://bugs.php.net/fix.php?id=77862&r=isapi
Install GNU Sed: https://bugs.php.net/fix.php?id=77862&r=gnused
Floating point limitations: https://bugs.php.net/fix.php?id=77862&r=float
No Zend Extensions: https://bugs.php.net/fix.php?id=77862&r=nozend
MySQL Configuration Error: https://bugs.php.net/fix.php?id=77862&r=mysqlcfg