Skip to content

Commit

Permalink
feat(php): update opcache with empiric values for memory consumption …
Browse files Browse the repository at this point in the history
…and max_accelerated_files
  • Loading branch information
damienwebdev committed Sep 23, 2020
1 parent 74ca35b commit 755df5e
Show file tree
Hide file tree
Showing 3 changed files with 36 additions and 9 deletions.
15 changes: 12 additions & 3 deletions php/7.2/alpine/conf/php.ini
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,9 @@ opcache.enable = 1
; The actual value used will be the first number in the set of prime numbers { 223, 463, 983, 1979, 3907, 7963, 16229, 32531, 65407, 130987, 262237, 524521, 1048793 }
; that is greater than or equal to the configured value. The minimum value is 200.
; The maximum value is 1000000. Values outside of this range are clamped to the permissible range.
opcache.max_accelerated_files = 500000
;
; After running some tests on Magento 2 instances, the typical file count is around 30000. We use double, just in case.
opcache.max_accelerated_files = 65407

; When enabled, the opcode cache will be checked for whether a file has already been cached when file_exists(), is_file() and is_readable() are called.
; This may increase performance in applications that check the existence and readability of PHP scripts, but risks returning stale data if opcache.validate_timestamps is disabled.
Expand All @@ -49,10 +51,17 @@ opcache.enable_file_override = 1
opcache.interned_strings_buffer = 32

; The size of the shared memory storage used by OPcache, in megabytes. The minimum permissible value is "8", which is enforced if a smaller value is set.
opcache.memory_consumption = 256
opcache.memory_consumption = 200

; How often to check script timestamps for updates, in seconds. 0 will result in OPcache checking for updates on every request.
opcache.revalidate_freq = 30
; This configuration directive is ignored if opcache.validate_timestamps is disabled.

; If enabled, OPcache will check for updated scripts every opcache.revalidate_freq seconds. When this directive is disabled, you must reset OPcache manually via opcache_reset(),
; opcache_invalidate() or by restarting the Web server for changes to the filesystem to take effect.
;
; Since we're using a dockerized environment, we're assuming that the final environment is immutable, and therefore validating timestamps
; is unnecessary.
opcache.validate_timestamps = 0

; If disabled, all documentation comments will be discarded from the opcode cache to reduce the size of the optimised code.
; Disabling this configuration directive may break applications and frameworks that rely on comment parsing for annotations,
Expand Down
15 changes: 12 additions & 3 deletions php/7.3/alpine/conf/php.ini
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,9 @@ opcache.enable = 1
; The actual value used will be the first number in the set of prime numbers { 223, 463, 983, 1979, 3907, 7963, 16229, 32531, 65407, 130987, 262237, 524521, 1048793 }
; that is greater than or equal to the configured value. The minimum value is 200.
; The maximum value is 1000000. Values outside of this range are clamped to the permissible range.
opcache.max_accelerated_files = 500000
;
; After running some tests on Magento 2 instances, the typical file count is around 30000. We use double, just in case.
opcache.max_accelerated_files = 65407

; When enabled, the opcode cache will be checked for whether a file has already been cached when file_exists(), is_file() and is_readable() are called.
; This may increase performance in applications that check the existence and readability of PHP scripts, but risks returning stale data if opcache.validate_timestamps is disabled.
Expand All @@ -49,10 +51,17 @@ opcache.enable_file_override = 1
opcache.interned_strings_buffer = 32

; The size of the shared memory storage used by OPcache, in megabytes. The minimum permissible value is "8", which is enforced if a smaller value is set.
opcache.memory_consumption = 256
opcache.memory_consumption = 200

; How often to check script timestamps for updates, in seconds. 0 will result in OPcache checking for updates on every request.
opcache.revalidate_freq = 30
; This configuration directive is ignored if opcache.validate_timestamps is disabled.

; If enabled, OPcache will check for updated scripts every opcache.revalidate_freq seconds. When this directive is disabled, you must reset OPcache manually via opcache_reset(),
; opcache_invalidate() or by restarting the Web server for changes to the filesystem to take effect.
;
; Since we're using a dockerized environment, we're assuming that the final environment is immutable, and therefore validating timestamps
; is unnecessary.
opcache.validate_timestamps = 0

; If disabled, all documentation comments will be discarded from the opcode cache to reduce the size of the optimised code.
; Disabling this configuration directive may break applications and frameworks that rely on comment parsing for annotations,
Expand Down
15 changes: 12 additions & 3 deletions php/7.4/alpine/conf/php.ini
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,9 @@ opcache.enable = 1
; The actual value used will be the first number in the set of prime numbers { 223, 463, 983, 1979, 3907, 7963, 16229, 32531, 65407, 130987, 262237, 524521, 1048793 }
; that is greater than or equal to the configured value. The minimum value is 200.
; The maximum value is 1000000. Values outside of this range are clamped to the permissible range.
opcache.max_accelerated_files = 500000
;
; After running some tests on Magento 2 instances, the typical file count is around 30000. We use double, just in case.
opcache.max_accelerated_files = 65407

; When enabled, the opcode cache will be checked for whether a file has already been cached when file_exists(), is_file() and is_readable() are called.
; This may increase performance in applications that check the existence and readability of PHP scripts, but risks returning stale data if opcache.validate_timestamps is disabled.
Expand All @@ -49,10 +51,17 @@ opcache.enable_file_override = 1
opcache.interned_strings_buffer = 32

; The size of the shared memory storage used by OPcache, in megabytes. The minimum permissible value is "8", which is enforced if a smaller value is set.
opcache.memory_consumption = 256
opcache.memory_consumption = 200

; How often to check script timestamps for updates, in seconds. 0 will result in OPcache checking for updates on every request.
opcache.revalidate_freq = 30
; This configuration directive is ignored if opcache.validate_timestamps is disabled.

; If enabled, OPcache will check for updated scripts every opcache.revalidate_freq seconds. When this directive is disabled, you must reset OPcache manually via opcache_reset(),
; opcache_invalidate() or by restarting the Web server for changes to the filesystem to take effect.
;
; Since we're using a dockerized environment, we're assuming that the final environment is immutable, and therefore validating timestamps
; is unnecessary.
opcache.validate_timestamps = 0

; If disabled, all documentation comments will be discarded from the opcode cache to reduce the size of the optimised code.
; Disabling this configuration directive may break applications and frameworks that rely on comment parsing for annotations,
Expand Down

0 comments on commit 755df5e

Please sign in to comment.