Skip to content

Commit

Permalink
php.ini-production: disable opcache.huge_code_pages by default
Browse files Browse the repository at this point in the history
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
  • Loading branch information
MaxKellermann authored and devnexen committed Feb 7, 2023
1 parent 0752baa commit e6281db
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 3 deletions.
7 changes: 6 additions & 1 deletion php.ini-development
Expand Up @@ -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.
Expand Down
9 changes: 7 additions & 2 deletions php.ini-production
Expand Up @@ -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
Expand Down

0 comments on commit e6281db

Please sign in to comment.