From e6281db857b567eccc27ed856ab94efcf1a0f769 Mon Sep 17 00:00:00 2001 From: Max Kellermann Date: Mon, 16 Jan 2023 09:42:03 +0100 Subject: [PATCH] php.ini-production: disable opcache.huge_code_pages by default There are only very narrow circumstances under which this option has been reported to provide 1% performance gain due to reduction of TLB misses. In many setups, this option only increases memory usage, and will actually decrease performance. To avoid this, let's leave it disabled by default, and let it be an explicit decision to enable it. For a discussion, see https://github.com/php/php-src/pull/10301 Closes GH-10336 --- php.ini-development | 7 ++++++- php.ini-production | 9 +++++++-- 2 files changed, 13 insertions(+), 3 deletions(-) diff --git a/php.ini-development b/php.ini-development index a963e0d62ec..e61f19b87ca 100644 --- a/php.ini-development +++ b/php.ini-development @@ -1888,7 +1888,12 @@ ldap.max_links = -1 ;opcache.file_cache_fallback=1 ; Enables or disables copying of PHP code (text segment) into HUGE PAGES. -; This should improve performance, but requires appropriate OS configuration. +; Under certain circumstances (if only a single global PHP process is +; started from which all others fork), this can increase performance +; by a tiny amount because TLB misses are reduced. On the other hand, this +; delays PHP startup, increases memory usage and degrades performance +; under memory pressure - use with care. +; Requires appropriate OS configuration. ;opcache.huge_code_pages=0 ; Validate cached file permissions. diff --git a/php.ini-production b/php.ini-production index 0864b40c604..73a4db3c31b 100644 --- a/php.ini-production +++ b/php.ini-production @@ -1890,8 +1890,13 @@ ldap.max_links = -1 ;opcache.file_cache_fallback=1 ; Enables or disables copying of PHP code (text segment) into HUGE PAGES. -; This should improve performance, but requires appropriate OS configuration. -;opcache.huge_code_pages=1 +; Under certain circumstances (if only a single global PHP process is +; started from which all others fork), this can increase performance +; by a tiny amount because TLB misses are reduced. On the other hand, this +; delays PHP startup, increases memory usage and degrades performance +; under memory pressure - use with care. +; Requires appropriate OS configuration. +;opcache.huge_code_pages=0 ; Validate cached file permissions. ;opcache.validate_permission=0