Michal Kobus | 492d8bc | 2021-02-15 16:54:13 +0100 | [diff] [blame] | 1 | #!/bin/ash |
vitalygusev | 507dfdb | 2019-05-28 12:53:55 +0400 | [diff] [blame] | 2 | |
| 3 | export SIMPLE_SETTINGS=${SIMPLE_SETTINGS:-sf_notifier.settings.production} |
Michal Kobus | 7187d6b | 2023-07-11 11:56:06 +0200 | [diff] [blame] | 4 | export PROMETHEUS_MULTIPROC_DIR=/tmp/prom |
| 5 | |
| 6 | mkdir -p ${PROMETHEUS_MULTIPROC_DIR} |
vitalygusev | 507dfdb | 2019-05-28 12:53:55 +0400 | [diff] [blame] | 7 | |
| 8 | WORKERS=${SF_NOTIFIER_WORKERS:-4} |
| 9 | BUFFER=${SF_NOTIFIER_BUFFER_SIZE:-32768} |
| 10 | PORT=${SF_NOTIFIER_APP_PORT:-5000} |
vitalygusev | 507dfdb | 2019-05-28 12:53:55 +0400 | [diff] [blame] | 11 | |
Michal Kobus | 7187d6b | 2023-07-11 11:56:06 +0200 | [diff] [blame] | 12 | uwsgi \ |
| 13 | --http-processes 2 \ |
| 14 | --processes ${WORKERS} \ |
Michal Kobus | 492d8bc | 2021-02-15 16:54:13 +0100 | [diff] [blame] | 15 | --uid 1000 \ |
| 16 | --gid 1000 \ |
vitalygusev | 507dfdb | 2019-05-28 12:53:55 +0400 | [diff] [blame] | 17 | --http 0.0.0.0:${PORT} \ |
| 18 | --wsgi-file sf_notifier/server.py \ |
Michal Kobus | 7187d6b | 2023-07-11 11:56:06 +0200 | [diff] [blame] | 19 | --callable app \ |
vitalygusev | 507dfdb | 2019-05-28 12:53:55 +0400 | [diff] [blame] | 20 | --buffer-size=${BUFFER} \ |
Michal Kobus | 2e85ef8 | 2021-06-24 18:01:43 +0200 | [diff] [blame] | 21 | --master \ |
Michal Kobus | 7187d6b | 2023-07-11 11:56:06 +0200 | [diff] [blame] | 22 | --req-logger=file:${LOGPATH} \ |
| 23 | --enable-threads \ |
| 24 | --single-interpreter \ |
| 25 | --vacuum \ |
| 26 | --die-on-term \ |
| 27 | --need-app \ |
| 28 | --disable-logging \ |
| 29 | --log-4xx \ |
| 30 | --log-5xx \ |
| 31 | --auto-procname \ |
| 32 | --procname-prefix "sf_notifier " \ |
| 33 | --max-requests 1000 \ |
| 34 | --max-worker-lifetime 3600 \ |
| 35 | --reload-on-rss 512 \ |
| 36 | --worker-reload-mercy 60 \ |
| 37 | --harakiri 60 \ |
| 38 | --py-call-osafterfork |