Skip to content

Commit

Permalink
add realpath_cache_ttl & opcache.preload with user
Browse files Browse the repository at this point in the history
  • Loading branch information
shakalandy committed Apr 26, 2024
1 parent 51684c4 commit c219025
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 0 deletions.
3 changes: 3 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -102,6 +102,7 @@ By default, all the extra defaults below are applied through the php.ini include
php_max_input_time: "60"
php_max_input_vars: "1000"
php_realpath_cache_size: "32K"
php_realpath_cache_ttl: "120"
php_file_uploads: "On"
php_upload_max_filesize: "64M"
php_max_file_uploads: "20"
Expand Down Expand Up @@ -142,6 +143,8 @@ The OpCache is included in PHP starting in version 5.5, and the following variab
php_opcache_revalidate_path: "0"
php_opcache_revalidate_freq: "2"
php_opcache_max_file_size: "0"
php_opcache_preload: ""
php_opcache_preload_user: ""

OpCache ini directives that are often customized on a system. Make sure you have enough memory and file slots allocated in the OpCache (`php_opcache_memory_consumption`, in MB, and `php_opcache_max_accelerated_files`) to contain all the PHP code you are running. If not, you may get less-than-optimal performance!

Expand Down
3 changes: 3 additions & 0 deletions defaults/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,8 @@ php_opcache_revalidate_path: "0"
php_opcache_revalidate_freq: "2"
php_opcache_max_file_size: "0"
php_opcache_blacklist_filename: ""
php_opcache_preload: ""
php_opcache_preload_user: ""

# APCu settings.
php_enable_apc: true
Expand All @@ -79,6 +81,7 @@ php_max_execution_time: "60"
php_max_input_time: "60"
php_max_input_vars: "1000"
php_realpath_cache_size: "32K"
php_realpath_cache_ttl: "120"

php_file_uploads: "On"
php_upload_max_filesize: "64M"
Expand Down
6 changes: 6 additions & 0 deletions templates/opcache.ini.j2
Original file line number Diff line number Diff line change
Expand Up @@ -12,3 +12,9 @@ opcache.max_file_size={{ php_opcache_max_file_size }}
{% if php_opcache_blacklist_filename != '' %}
opcache.blacklist_filename={{ php_opcache_blacklist_filename }}
{% endif %}
{% if php_opcache_preload != '' %}
opcache.preload={{ php_opcache_preload }}
{% endif %}
{% if php_opcache_preload_user != '' %}
opcache.preload_user={{ php_opcache_preload_user }}
{% endif %}
1 change: 1 addition & 0 deletions templates/php.ini.j2
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,7 @@ user_dir =
enable_dl = Off

realpath_cache_size = {{ php_realpath_cache_size }}
realpath_cache_ttl = {{ php_realpath_cache_ttl }}

;;;;;;;;;;;;;;;;
; File Uploads ;
Expand Down

0 comments on commit c219025

Please sign in to comment.