Use Memcached as the Django cache

This commit is contained in:
Aurélien Bompard 2013-12-06 16:56:38 +00:00
parent 1e07f9075f
commit 1e0dda64d1
4 changed files with 32 additions and 1 deletions

View file

@ -0,0 +1,5 @@
PORT="11211"
USER="memcached"
MAXCONN="1024"
CACHESIZE="256"
OPTIONS=""

View file

@ -8,3 +8,5 @@
- name: reload apache
action: service name=httpd state=reloaded
- name: restart memcached
action: service name=memcached state=restarted

View file

@ -27,6 +27,9 @@
- name: allow Apache to remotely connect to Mailman
seboolean: name=httpd_can_network_connect state=yes persistent=yes
- name: allow Apache to remotely connect to Memcached
seboolean: name=httpd_can_network_memcache state=yes persistent=yes
#
# Packages
@ -42,6 +45,8 @@
- hyperkitty
- hyperkitty-selinux
- postorius
- memcached
- python-pylibmc
- yum-plugin-post-transaction-actions
- mailman3-fedmsg-plugin
tags:
@ -226,7 +231,16 @@
- name: set the postfix conffile
copy: src=postfix-main.cf dest=/etc/postfix/main.cf
notify:
- restart postfix
- restart postfix
- name: create the postfix aliases
command: mailman3 aliases
# Memcached
- name: set the memcached sysconfig file
copy: src=memcached.sysconfig dest=/etc/sysconfig/memcached
notify:
- restart memcached
- name: start memcached
service: state=started enabled=yes name=memcached

View file

@ -299,6 +299,16 @@ LOGGING = {
},
}
# Cache: use the local memcached server
CACHES = {
'default': {
'BACKEND': 'django.core.cache.backends.memcached.PyLibMCCache',
'LOCATION': '127.0.0.1:11211',
}
}
#
# HyperKitty-specific
#