APC/APCu better management

pull/5/head
Emilien Mantel 2015-07-23 18:10:17 +02:00
parent 7b7e3bb4f4
commit 19a1a84c8f
11 changed files with 59 additions and 56 deletions

View File

@ -12,7 +12,7 @@ php_ini:
- key: 'memory_limit' - key: 'memory_limit'
value: '256M' value: '256M'
# OpCache settings (useful for PHP >=5.5). # OpCache settings (PHP >= 5.5)
php_opcache_enable: "1" php_opcache_enable: "1"
php_opcache_enable_cli: "0" php_opcache_enable_cli: "0"
php_opcache_memory_consumption: "96" php_opcache_memory_consumption: "96"
@ -23,7 +23,7 @@ php_opcache_validate_timestamps: "1"
php_opcache_revalidate_freq: "2" php_opcache_revalidate_freq: "2"
php_opcache_max_file_size: "0" php_opcache_max_file_size: "0"
# APC settings (useful for PHP <5.5). # APC/APCu settings
php_apc_enable: "1" php_apc_enable: "1"
php_apc_enable_cli: "0" php_apc_enable_cli: "0"
php_apc_shm_size: "32M" php_apc_shm_size: "32M"
@ -36,7 +36,6 @@ php_apc_slam_defense: "0"
php_apc_stat_ctime: "1" php_apc_stat_ctime: "1"
# PHP-FPM # PHP-FPM
php_fpm_poold: php_fpm_poold:
- pool_name: 'www' - pool_name: 'www'

View File

@ -4,5 +4,5 @@
apt: pkg=php-apc state=latest apt: pkg=php-apc state=latest
- name: TEMPLATE | Configure APC - name: TEMPLATE | Configure APC
template: src=etc/php5/mods-available/apc.j2 dest=/etc/php5/mods-available/apc.ini template: src=etc/php5/mods-available/apcu.ini.j2 dest=/etc/php5/mods-available/apc.ini
notify: restart php-fpm notify: restart php-fpm

View File

@ -4,7 +4,7 @@
apt: pkg=php5-apcu state=latest apt: pkg=php5-apcu state=latest
- name: TEMPLATE | Configure Opcache / APCu - name: TEMPLATE | Configure Opcache / APCu
template: src=etc/php5/mods-available/{{ item }}.j2 dest=/etc/php5/mods-available/{{ item }} template: src=etc/php5/mods-available/{{ item }}.ini.j2 dest=/etc/php5/mods-available/{{ item }}.ini
with_items: with_items:
- apcu - apcu
- opcache - opcache

View File

@ -1,16 +0,0 @@
;
; {{ ansible_managed }}
;
extension=apc.so
apc.enable_cli={{ php_apc_enable_cli }}
apc.shm_size={{ php_apc_shm_size }}
apc.enable={{ php_apc_enable }}
apc.num_files_hint={{ php_apc_num_files_hint }}
apc.user_entries_hint={{ php_apc_user_entries_hint }}
apc.user_ttl={{ php_apc_user_ttl }}
apc.ttl={{ php_apc_ttl }}
apc.file_update_protection={{ php_apc_file_update_protection }}
apc.slam_defense={{ php_apc_slam_defense }}
apc.stat_ctime={{ php_apc_stat_ctime }}

View File

@ -0,0 +1,25 @@
;
; {{ ansible_managed }}
;
extension=apc.so
; apc.enabled can be set to 0 to disable APC
apc.enable={{ php_apc_enable }}
; Mostly for testing and debugging.
apc.enable_cli={{ php_apc_enable_cli }}
; The size of each shared memory segment in MB
apc.shm_size={{ php_apc_shm_size }}
; A "hint" about the number of distinct source files that will be included or requested on your web server. Set to zero or omit if unsure; this setting is mainly useful for sites that have many thousands of source files.
apc.num_files_hint={{ php_apc_num_files_hint }}
; Just like apc.num_files_hint, a "hint" about the number of distinct user cache variables to store. Set to zero or omit if not sure.
apc.user_entries_hint={{ php_apc_user_entries_hint }}
; The number of seconds a cache entry is allowed to idle in a slot in case this cache entry slot is needed by another entry
apc.user_ttl={{ php_apc_user_ttl }}
apc.ttl={{ php_apc_ttl }}
; rsync = 0 | tar/cp = 2
apc.file_update_protection={{ php_apc_file_update_protection }}
; This option sets the percentage of processes that will skip trying to cache an uncached file
apc.slam_defense={{ php_apc_slam_defense }}
; Verification with ctime will avoid problems caused by programs such as svn or rsync by making sure inodes haven't changed since the last stat
apc.stat_ctime={{ php_apc_stat_ctime }}

View File

@ -1,5 +0,0 @@
;
; {{ ansible_managed }}
;
extension=apcu.so