0
0
mirror of https://github.com/PostHog/posthog.git synced 2024-11-24 00:47:50 +01:00

feat: add env var for number of nginx unit worker processes (#22567)

add env var for number of nginx unit worker processes

i suspect that with asgi we'll be better off with 1 instead of 4 worker
processes - i'd like us to be able to test this per deployment via an
env var
This commit is contained in:
Frank Hamand 2024-05-29 12:01:09 +01:00 committed by GitHub
parent b547d4ad59
commit 87cfc3fae4
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 2 additions and 1 deletions

View File

@ -12,6 +12,7 @@ trap 'rm -rf "$PROMETHEUS_MULTIPROC_DIR"' EXIT
export PROMETHEUS_METRICS_EXPORT_PORT=8001 export PROMETHEUS_METRICS_EXPORT_PORT=8001
export STATSD_PORT=${STATSD_PORT:-8125} export STATSD_PORT=${STATSD_PORT:-8125}
export NGINX_UNIT_PYTHON_PROTOCOL=${NGINX_UNIT_PYTHON_PROTOCOL:-wsgi} export NGINX_UNIT_PYTHON_PROTOCOL=${NGINX_UNIT_PYTHON_PROTOCOL:-wsgi}
export NGINX_UNIT_APP_PROCESSES=${NGINX_UNIT_APP_PROCESSES:-4}
envsubst < /docker-entrypoint.d/unit.json.tpl > /docker-entrypoint.d/unit.json envsubst < /docker-entrypoint.d/unit.json.tpl > /docker-entrypoint.d/unit.json

View File

@ -40,7 +40,7 @@
"applications": { "applications": {
"posthog": { "posthog": {
"type": "python 3.10", "type": "python 3.10",
"processes": 4, "processes": $NGINX_UNIT_APP_PROCESSES,
"working_directory": "/code", "working_directory": "/code",
"path": ".", "path": ".",
"module": "posthog.$NGINX_UNIT_PYTHON_PROTOCOL", "module": "posthog.$NGINX_UNIT_PYTHON_PROTOCOL",