Skip to content

Commit 9de32ea

Browse files
committed
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 php#10301 Closes phpGH-10336
1 parent 2fbca4b commit 9de32ea

File tree

2 files changed

+13
-3
lines changed

2 files changed

+13
-3
lines changed

php.ini-development

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1896,7 +1896,12 @@ ldap.max_links = -1
18961896
;opcache.file_cache_fallback=1
18971897

18981898
; Enables or disables copying of PHP code (text segment) into HUGE PAGES.
1899-
; This should improve performance, but requires appropriate OS configuration.
1899+
; Under certain circumstances (if only a single global PHP process is
1900+
; started from which all others fork), this can increase performance
1901+
; by a tiny amount because TLB misses are reduced. On the other hand, this
1902+
; delays PHP startup, increases memory usage and degrades performance
1903+
; under memory pressure - use with care.
1904+
; Requires appropriate OS configuration.
19001905
;opcache.huge_code_pages=0
19011906

19021907
; Validate cached file permissions.

php.ini-production

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1898,8 +1898,13 @@ ldap.max_links = -1
18981898
;opcache.file_cache_fallback=1
18991899

19001900
; Enables or disables copying of PHP code (text segment) into HUGE PAGES.
1901-
; This should improve performance, but requires appropriate OS configuration.
1902-
;opcache.huge_code_pages=1
1901+
; Under certain circumstances (if only a single global PHP process is
1902+
; started from which all others fork), this can increase performance
1903+
; by a tiny amount because TLB misses are reduced. On the other hand, this
1904+
; delays PHP startup, increases memory usage and degrades performance
1905+
; under memory pressure - use with care.
1906+
; Requires appropriate OS configuration.
1907+
;opcache.huge_code_pages=0
19031908

19041909
; Validate cached file permissions.
19051910
;opcache.validate_permission=0

0 commit comments

Comments
 (0)