blob: 0ad503f566be2fc4a7c107ed3cb440faadbb57ca [file] [log] [blame]
#!/bin/ash
export SIMPLE_SETTINGS=${SIMPLE_SETTINGS:-sf_notifier.settings.production}
export PROMETHEUS_MULTIPROC_DIR=/tmp/prom
mkdir -p ${PROMETHEUS_MULTIPROC_DIR}
WORKERS=${SF_NOTIFIER_WORKERS:-4}
BUFFER=${SF_NOTIFIER_BUFFER_SIZE:-32768}
PORT=${SF_NOTIFIER_APP_PORT:-5000}
uwsgi \
--http-processes 2 \
--processes ${WORKERS} \
--uid 64000 \
--gid 64000 \
--http 0.0.0.0:${PORT} \
--wsgi-file sf_notifier/server.py \
--callable app \
--buffer-size=${BUFFER} \
--master \
--req-logger=file:${LOGPATH} \
--enable-threads \
--single-interpreter \
--vacuum \
--die-on-term \
--need-app \
--disable-logging \
--log-4xx \
--log-5xx \
--auto-procname \
--procname-prefix "sf_notifier " \
--max-requests 1000 \
--max-worker-lifetime 3600 \
--reload-on-rss 512 \
--worker-reload-mercy 60 \
--harakiri 60 \
--py-call-osafterfork