Skip to content

Commit

Permalink
Merge pull request #943 from freephile/featureOptimizeOpcache
Browse files Browse the repository at this point in the history
Feature optimize opcache
  • Loading branch information
jamesmontalvo3 committed Sep 15, 2018
2 parents a562894 + aef9d71 commit e3ddd50
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 4 deletions.
5 changes: 5 additions & 0 deletions config/core/defaults.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,11 @@
m_install: /opt
m_meza: /opt/meza

# meza mode (development or production)
# production being as performant and secure as possible
# development being less secure and providing optional features useful for dev
m_mode: production

# config dir
m_config_core: /opt/meza/config/core
m_local_secret: /opt/conf-meza/secret
Expand Down
19 changes: 15 additions & 4 deletions src/roles/apache-php/templates/php.ini.j2
Original file line number Diff line number Diff line change
Expand Up @@ -1858,11 +1858,11 @@ opcache.enable_cli=1
opcache.memory_consumption=256

; The amount of memory for interned strings in Mbytes
opcache.interned_strings_buffer=4
opcache.interned_strings_buffer=16

; The maximum number of keys (scripts) in the OPcache hash table
; Only numbers between 200 and 100000 are allowed
opcache.max_accelerated_files=20000
opcache.max_accelerated_files=7963

; The maximum percentage of "wasted" memory until a restart is scheduled
;opcache.max_wasted_percentage=5
Expand All @@ -1875,12 +1875,19 @@ opcache.max_accelerated_files=20000

; When disabled, you must reset the OPcache manually or restart the
; webserver for changes to the filesystem to take effect
; In other words,
; IF YOU EDIT LIVE ON PRODUCTION, APACHE WON'T EVEN SEE YOUR CHANGES
; unless you restart the webserver. Rogue admins foiled! Do it right!
{% if m_mode == "production" %}
opcache.validate_timestamps=0
{% else %}
opcache.validate_timestamps=1
{% endif %}

; How often (in seconds) to check file timestamps for changes to the shared
; memory storage allocation. ("1" means validate once per second, but only
; once per request. "0" means always validate)
opcache.revalidate_freq=30
opcache.revalidate_freq=0

; Enables or disables file search in include_path optimization
;opcache.revalidate_path=0
Expand All @@ -1895,7 +1902,7 @@ opcache.revalidate_freq=30
;opcache.load_comments=1

; If enabled, a fast shutdown sequence is used for the accelerated code
;opcache.fast_shutdown=0
opcache.fast_shutdown=1

; Allow file existence override (file_exists, etc.) performance feature.
;opcache.enable_file_override=0
Expand Down Expand Up @@ -1936,7 +1943,11 @@ opcache.error_log=/opt/data-meza/logs/opcache_error.log
; By default, only fatal errors (level 0) or errors (level 1) are logged.
; You can also enable warnings (level 2), info messages (level 3) or
; debug messages (level 4).
{% if m_mode == "production" %}
opcache.log_verbosity_level=1
{% else %}
opcache.log_verbosity_level=2
{% endif %}

; Preferred Shared Memory back-end. Leave empty and let the system decide.
;opcache.preferred_memory_model=
Expand Down

0 comments on commit e3ddd50

Please sign in to comment.