Unify supervisor configuration files. Lower nice levels of most workers. Merge OCR and slow workers. Lower gunicorn workers to 2. Call all supervisor processes using a shell to expand the install and mayan binary locations and avoid hardcoding.

Signed-off-by: Roberto Rosario <roberto.rosario.gonzalez@gmail.com>
This commit is contained in:
Roberto Rosario
2018-05-04 00:48:03 -04:00
parent 9fad6c37bf
commit 55359c72cf
7 changed files with 92 additions and 110 deletions

View File

@@ -1,15 +0,0 @@
[program:celery-beat]
autorestart = false
autostart = true
command = python /usr/local/lib/python2.7/dist-packages/mayan/bin/mayan-edms.py celery --settings=mayan.settings.production beat -l ERROR
directory = /usr/local/lib/python2.7/dist-packages/mayan/
killasgroup = true
numprocs = 1
priority = 998
stderr_logfile = /dev/fd/2
stderr_logfile_maxbytes = 0
stdout_logfile = /dev/fd/1
stdout_logfile_maxbytes = 0
startsecs = 10
stopwaitsecs = 1
user = mayan

View File

@@ -1,9 +0,0 @@
[program:gunicorn]
autorestart = false
autostart = true
command = /bin/bash -c "gunicorn -w ${MAYAN_GUNICORN_WORKERS:-3} mayan.wsgi --max-requests 1000 --max-requests-jitter 50 --worker-class gevent --bind 0.0.0.0:8000"
#command = gunicorn -w ${MAYAN_GUNICORN_WORKERS:-3} mayan.wsgi --max-requests 1000 --max-requests-jitter 50 --worker-class gevent --bind 0.0.0.0:8000
#command = /bin/bash -c "if [ -z ${MAYAN_BROKER_URL} ] || [ -z ${MAYAN_CELERY_RESULT_BACKEND} ];then /usr/bin/redis-server /etc/redis/;fi"
directory = /tmp
redirect_stderr = true
user = mayan

View File

@@ -0,0 +1,72 @@
[program:gunicorn]
autorestart = false
autostart = true
command = /bin/bash -c "cd ${MAYAN_INSTALL_DIR}; gunicorn -w ${MAYAN_GUNICORN_WORKERS} mayan.wsgi --max-requests 500 --max-requests-jitter 50 --worker-class gevent --bind 0.0.0.0:8000 --env DJANGO_SETTINGS_MODULE=${MAYAN_SETTINGS_FILE}"
redirect_stderr = true
user = mayan
[program:redis]
autorestart = false
autostart = true
command = /bin/bash -c "if [ ${MAYAN_BROKER_URL} != ${MAYAN_DEFAULT_BROKER_URL} ] || [ ${MAYAN_CELERY_RESULT_BACKEND} != ${MAYAN_DEFAULT_CELERY_RESULT_BACKEND} ];then /usr/bin/redis-server /etc/redis/;fi"
user = root
[program:mayan-worker-fast]
autorestart = false
autostart = true
command = nice -n 1 /bin/bash -c "cd ${MAYAN_INSTALL_DIR}; python ${MAYAN_BIN} celery --settings=${MAYAN_SETTINGS_FILE} worker -Ofair -l ERROR -Q converter -n mayan-worker-fast.%%h --concurrency=1"
killasgroup = true
numprocs = 1
priority = 998
startsecs = 10
stderr_logfile = /dev/fd/2
stderr_logfile_maxbytes = 0
stdout_logfile = /dev/fd/1
stdout_logfile_maxbytes = 0
stopwaitsecs = 1
user = mayan
[program:mayan-worker-medium]
autorestart = false
autostart = true
command = nice -n 18 /bin/bash -c "cd ${MAYAN_INSTALL_DIR}; python ${MAYAN_BIN} celery --settings=${MAYAN_SETTINGS_FILE} worker -Ofair -l ERROR -Q checkouts_periodic,documents_periodic,indexing,metadata,sources,sources_periodic,uploads,documents -n mayan-worker-medium.%%h --concurrency=1"
killasgroup = true
numprocs = 1
priority = 998
startsecs = 10
stderr_logfile = /dev/fd/2
stderr_logfile_maxbytes = 0
stdout_logfile = /dev/fd/1
stdout_logfile_maxbytes = 0
stopwaitsecs = 1
user = mayan
[program:mayan-worker-slow]
autorestart = false
autostart = true
command = nice -n 19 /bin/bash -c "cd ${MAYAN_INSTALL_DIR}; python ${MAYAN_BIN} celery --settings=${MAYAN_SETTINGS_FILE} worker -Ofair -l ERROR -Q mailing,tools,statistics,parsing,ocr -n mayan-worker-slow.%%h --concurrency=1"
killasgroup = true
numprocs = 1
priority = 998
startsecs = 10
stderr_logfile = /dev/fd/2
stderr_logfile_maxbytes = 0
stdout_logfile = /dev/fd/1
stdout_logfile_maxbytes = 0
stopwaitsecs = 1
user = mayan
[program:celery-beat]
autorestart = false
autostart = true
command = nice -n 1 /bin/bash -c "cd ${MAYAN_INSTALL_DIR}; python ${MAYAN_BIN} celery --settings=${MAYAN_SETTINGS_FILE} beat -l ERROR"
killasgroup = true
numprocs = 1
priority = 998
stderr_logfile = /dev/fd/2
stderr_logfile_maxbytes = 0
stdout_logfile = /dev/fd/1
stdout_logfile_maxbytes = 0
startsecs = 10
stopwaitsecs = 1
user = mayan

View File

@@ -1,5 +0,0 @@
[program:redis]
autorestart = false
autostart = true
command = /bin/bash -c "if [ -z ${MAYAN_BROKER_URL} ] || [ -z ${MAYAN_CELERY_RESULT_BACKEND} ];then /usr/bin/redis-server /etc/redis/;fi"
user = root

View File

@@ -1,63 +0,0 @@
[program:mayan-worker-fast]
autorestart = false
autostart = true
command = python /usr/local/lib/python2.7/dist-packages/mayan/bin/mayan-edms.py celery --settings=mayan.settings.production worker -Ofair -l ERROR -Q converter -n mayan-worker-fast.%%h --concurrency=1
directory = /usr/local/lib/python2.7/dist-packages/mayan/
killasgroup = true
numprocs = 1
priority = 998
startsecs = 10
stderr_logfile = /dev/fd/2
stderr_logfile_maxbytes = 0
stdout_logfile = /dev/fd/1
stdout_logfile_maxbytes = 0
stopwaitsecs = 1
user = mayan
[program:mayan-worker-medium]
autorestart = false
autostart = true
command = python /usr/local/lib/python2.7/dist-packages/mayan/bin/mayan-edms.py celery --settings=mayan.settings.production worker -Ofair -l ERROR -Q checkouts_periodic,documents_periodic,indexing,metadata,sources,sources_periodic,uploads,documents -n mayan-worker-medium.%%h --concurrency=1
directory = /usr/local/lib/python2.7/dist-packages/mayan/
killasgroup = true
numprocs = 1
priority = 998
startsecs = 10
stderr_logfile = /dev/fd/2
stderr_logfile_maxbytes = 0
stdout_logfile = /dev/fd/1
stdout_logfile_maxbytes = 0
stopwaitsecs = 1
user = mayan
[program:mayan-worker-slow]
autorestart = false
autostart = true
command = python /usr/local/lib/python2.7/dist-packages/mayan/bin/mayan-edms.py celery --settings=mayan.settings.production worker -Ofair -l ERROR -Q mailing,tools,statistics -n mayan-worker-slow.%%h --concurrency=1
directory = /usr/local/lib/python2.7/dist-packages/mayan/
killasgroup = true
numprocs = 1
priority = 998
startsecs = 10
stderr_logfile = /dev/fd/2
stderr_logfile_maxbytes = 0
stdout_logfile = /dev/fd/1
stdout_logfile_maxbytes = 0
stopwaitsecs = 1
user = mayan
[program:mayan-worker-ocr]
autorestart = false
autostart = true
command = nice -n 19 python /usr/local/lib/python2.7/dist-packages/mayan/bin/mayan-edms.py celery --settings=mayan.settings.production worker -Ofair -l ERROR -Q parsing,ocr -n mayan-worker-ocr.%%h --concurrency=1
directory = /usr/local/lib/python2.7/dist-packages/mayan/
killasgroup = true
numprocs = 1
priority = 998
startsecs = 10
stderr_logfile = /dev/fd/2
stderr_logfile_maxbytes = 0
stdout_logfile = /dev/fd/1
stdout_logfile_maxbytes = 0
stopwaitsecs = 1
user = mayan