Use Memcached as the Django cache
This commit is contained in:
parent
1e07f9075f
commit
1e0dda64d1
4 changed files with 32 additions and 1 deletions
5
roles/mailman/files/memcached.sysconfig
Normal file
5
roles/mailman/files/memcached.sysconfig
Normal file
|
@ -0,0 +1,5 @@
|
||||||
|
PORT="11211"
|
||||||
|
USER="memcached"
|
||||||
|
MAXCONN="1024"
|
||||||
|
CACHESIZE="256"
|
||||||
|
OPTIONS=""
|
|
@ -8,3 +8,5 @@
|
||||||
- name: reload apache
|
- name: reload apache
|
||||||
action: service name=httpd state=reloaded
|
action: service name=httpd state=reloaded
|
||||||
|
|
||||||
|
- name: restart memcached
|
||||||
|
action: service name=memcached state=restarted
|
||||||
|
|
|
@ -27,6 +27,9 @@
|
||||||
- name: allow Apache to remotely connect to Mailman
|
- name: allow Apache to remotely connect to Mailman
|
||||||
seboolean: name=httpd_can_network_connect state=yes persistent=yes
|
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
|
# Packages
|
||||||
|
@ -42,6 +45,8 @@
|
||||||
- hyperkitty
|
- hyperkitty
|
||||||
- hyperkitty-selinux
|
- hyperkitty-selinux
|
||||||
- postorius
|
- postorius
|
||||||
|
- memcached
|
||||||
|
- python-pylibmc
|
||||||
- yum-plugin-post-transaction-actions
|
- yum-plugin-post-transaction-actions
|
||||||
- mailman3-fedmsg-plugin
|
- mailman3-fedmsg-plugin
|
||||||
tags:
|
tags:
|
||||||
|
@ -226,7 +231,16 @@
|
||||||
- name: set the postfix conffile
|
- name: set the postfix conffile
|
||||||
copy: src=postfix-main.cf dest=/etc/postfix/main.cf
|
copy: src=postfix-main.cf dest=/etc/postfix/main.cf
|
||||||
notify:
|
notify:
|
||||||
- restart postfix
|
- restart postfix
|
||||||
|
|
||||||
- name: create the postfix aliases
|
- name: create the postfix aliases
|
||||||
command: mailman3 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
|
||||||
|
|
|
@ -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
|
# HyperKitty-specific
|
||||||
#
|
#
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue