Skip to content

Commit e6281db

Browse files
MaxKellermanndevnexen
authored andcommitted
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 #10301 Closes GH-10336
1 parent 0752baa commit e6281db

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
@@ -1888,7 +1888,12 @@ ldap.max_links = -1
18881888
;opcache.file_cache_fallback=1
18891889

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

18941899
; Validate cached file permissions.

php.ini-production

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

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

18961901
; Validate cached file permissions.
18971902
;opcache.validate_permission=0

0 commit comments

Comments
 (0)