Skip to content

Commit b655f2d

Browse files
staabmkrakjoe
authored andcommitted
set more suitable defaults for opcache in ini and code
1 parent 8dd523a commit b655f2d

File tree

3 files changed

+11
-11
lines changed

3 files changed

+11
-11
lines changed

ext/opcache/zend_accelerator_module.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -285,9 +285,9 @@ ZEND_INI_BEGIN()
285285
STD_PHP_INI_BOOLEAN("opcache.revalidate_path" , "0", PHP_INI_ALL , OnUpdateBool, accel_directives.revalidate_path , zend_accel_globals, accel_globals)
286286

287287
STD_PHP_INI_ENTRY("opcache.log_verbosity_level" , "1" , PHP_INI_SYSTEM, OnUpdateLong, accel_directives.log_verbosity_level, zend_accel_globals, accel_globals)
288-
STD_PHP_INI_ENTRY("opcache.memory_consumption" , "64" , PHP_INI_SYSTEM, OnUpdateMemoryConsumption, accel_directives.memory_consumption, zend_accel_globals, accel_globals)
289-
STD_PHP_INI_ENTRY("opcache.interned_strings_buffer", "4" , PHP_INI_SYSTEM, OnUpdateLong, accel_directives.interned_strings_buffer, zend_accel_globals, accel_globals)
290-
STD_PHP_INI_ENTRY("opcache.max_accelerated_files" , "2000", PHP_INI_SYSTEM, OnUpdateMaxAcceleratedFiles, accel_directives.max_accelerated_files, zend_accel_globals, accel_globals)
288+
STD_PHP_INI_ENTRY("opcache.memory_consumption" , "128" , PHP_INI_SYSTEM, OnUpdateMemoryConsumption, accel_directives.memory_consumption, zend_accel_globals, accel_globals)
289+
STD_PHP_INI_ENTRY("opcache.interned_strings_buffer", "8" , PHP_INI_SYSTEM, OnUpdateLong, accel_directives.interned_strings_buffer, zend_accel_globals, accel_globals)
290+
STD_PHP_INI_ENTRY("opcache.max_accelerated_files" , "10000", PHP_INI_SYSTEM, OnUpdateMaxAcceleratedFiles, accel_directives.max_accelerated_files, zend_accel_globals, accel_globals)
291291
STD_PHP_INI_ENTRY("opcache.max_wasted_percentage" , "5" , PHP_INI_SYSTEM, OnUpdateMaxWastedPercentage, accel_directives.max_wasted_percentage, zend_accel_globals, accel_globals)
292292
STD_PHP_INI_ENTRY("opcache.consistency_checks" , "0" , PHP_INI_ALL , OnUpdateLong, accel_directives.consistency_checks, zend_accel_globals, accel_globals)
293293
STD_PHP_INI_ENTRY("opcache.force_restart_timeout" , "180" , PHP_INI_SYSTEM, OnUpdateLong, accel_directives.force_restart_timeout, zend_accel_globals, accel_globals)

php.ini-development

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1764,20 +1764,20 @@ ldap.max_links = -1
17641764

17651765
[opcache]
17661766
; Determines if Zend OPCache is enabled
1767-
;opcache.enable=0
1767+
;opcache.enable=1
17681768

17691769
; Determines if Zend OPCache is enabled for the CLI version of PHP
17701770
;opcache.enable_cli=0
17711771

17721772
; The OPcache shared memory storage size.
1773-
;opcache.memory_consumption=64
1773+
;opcache.memory_consumption=128
17741774

17751775
; The amount of memory for interned strings in Mbytes.
1776-
;opcache.interned_strings_buffer=4
1776+
;opcache.interned_strings_buffer=8
17771777

17781778
; The maximum number of keys (scripts) in the OPcache hash table.
17791779
; Only numbers between 200 and 100000 are allowed.
1780-
;opcache.max_accelerated_files=2000
1780+
;opcache.max_accelerated_files=10000
17811781

17821782
; The maximum percentage of "wasted" memory until a restart is scheduled.
17831783
;opcache.max_wasted_percentage=5

php.ini-production

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1764,20 +1764,20 @@ ldap.max_links = -1
17641764

17651765
[opcache]
17661766
; Determines if Zend OPCache is enabled
1767-
;opcache.enable=0
1767+
;opcache.enable=1
17681768

17691769
; Determines if Zend OPCache is enabled for the CLI version of PHP
17701770
;opcache.enable_cli=0
17711771

17721772
; The OPcache shared memory storage size.
1773-
;opcache.memory_consumption=64
1773+
;opcache.memory_consumption=128
17741774

17751775
; The amount of memory for interned strings in Mbytes.
1776-
;opcache.interned_strings_buffer=4
1776+
;opcache.interned_strings_buffer=8
17771777

17781778
; The maximum number of keys (scripts) in the OPcache hash table.
17791779
; Only numbers between 200 and 100000 are allowed.
1780-
;opcache.max_accelerated_files=2000
1780+
;opcache.max_accelerated_files=10000
17811781

17821782
; The maximum percentage of "wasted" memory until a restart is scheduled.
17831783
;opcache.max_wasted_percentage=5

0 commit comments

Comments
 (0)