summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGuilhem Moulin <guilhem@fripost.org>2017-05-14 15:09:25 +0200
committerGuilhem Moulin <guilhem@fripost.org>2017-05-14 15:09:36 +0200
commit32508606f6bac9d0b5e0eedbbaa5074d2200251b (patch)
tree97fc2577624f078b9fa83bc47e28ba1c74c252c0
parent6b556b399a3285711c993ad24b7cce155f05a28e (diff)
webmail: use Zend opcache and configure APCu.
-rw-r--r--roles/webmail/files/etc/php5/mods-available/apcu.ini5
-rw-r--r--roles/webmail/handlers/main.yml3
-rw-r--r--roles/webmail/tasks/roundcube.yml27
3 files changed, 34 insertions, 1 deletions
diff --git a/roles/webmail/files/etc/php5/mods-available/apcu.ini b/roles/webmail/files/etc/php5/mods-available/apcu.ini
new file mode 100644
index 0000000..9268c08
--- /dev/null
+++ b/roles/webmail/files/etc/php5/mods-available/apcu.ini
@@ -0,0 +1,5 @@
+extension=apcu.so
+apc.shm_segments = 1
+apc.shm_size = 128M
+apc.ttl = 3600
+apc.gc_ttl = 300
diff --git a/roles/webmail/handlers/main.yml b/roles/webmail/handlers/main.yml
index d02cdda..aef74f7 100644
--- a/roles/webmail/handlers/main.yml
+++ b/roles/webmail/handlers/main.yml
@@ -2,5 +2,8 @@
- name: Restart stunnel@ldap
service: name=stunnel4@ldap state=restarted
+- name: Restart php5
+ service: name=php5-fpm state=restarted
+
- name: Restart Nginx
service: name=nginx state=restarted
diff --git a/roles/webmail/tasks/roundcube.yml b/roles/webmail/tasks/roundcube.yml
index b5e81d6..4c7ac8d 100644
--- a/roles/webmail/tasks/roundcube.yml
+++ b/roles/webmail/tasks/roundcube.yml
@@ -4,10 +4,35 @@
- php5-fpm
- php5-ldap
- php5-gd
- - php5-xcache
+ - php5-apcu
# spell-checking
- php5-enchant
+- name: Configure PHP5 APCu
+ copy: src=etc/php5/mods-available/apcu.ini
+ dest=/etc/php5/mods-available/apcu.ini
+ owner=root group=root
+ mode=0644
+ notify:
+ - Restart php5
+
+- name: Configure PHP5 Zend opcache
+ lineinfile: dest=/etc/php5/fpm/php.ini
+ regexp='^;?{{ item.var }}\\s*='
+ line="{{ item.var }} = {{ item.value }}"
+ owner=root group=root
+ mode=0644
+ with_items:
+ - { var: opcache.enable, value: 1 }
+ - { var: opcache.enable_cli, value: 1 }
+ - { var: opcache.memory_consumption, value: 128 }
+ - { var: opcache.interned_strings_buffer, value: 8 }
+ - { var: opcache.max_accelerated_files, value: 2048 }
+ - { var: opcache.revalidate_freq, value: 60 }
+ - { var: opcache.fast_shutdown, value: 1 }
+ notify:
+ - Restart php5
+
- name: Install GNU Aspell and some dictionaries
apt: pkg={{ item }}
with_items: