diff --git a/.env b/.env index e43601dcdb9..a6c4865a322 100644 --- a/.env +++ b/.env @@ -12,6 +12,11 @@ SENTRY_BIND=9000 # SENTRY_MAIL_HOST=example.com # Parallel taskworker processes (higher values increase memory usage; >32 not recommended) SENTRY_TASKWORKER_CONCURRENCY=4 +# Respawn the snuba-api worker once it exceeds this resident memory (MiB). +# Leave empty to disable the cap and let the worker grow unbounded. +SNUBA_API_WORKERS_MAX_RSS=1024 +# Respawn the snuba-api worker after this many seconds, regardless of memory. +SNUBA_API_WORKERS_LIFETIME=86400 SENTRY_IMAGE=ghcr.io/getsentry/sentry:nightly SNUBA_IMAGE=ghcr.io/getsentry/snuba:nightly RELAY_IMAGE=ghcr.io/getsentry/relay:nightly diff --git a/docker-compose.yml b/docker-compose.yml index bbb98256d9b..948bd8d96c8 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -113,8 +113,11 @@ x-snuba-defaults: &snuba_defaults CLICKHOUSE_HOST: clickhouse DEFAULT_BROKERS: "kafka:9092" REDIS_HOST: redis - UWSGI_MAX_REQUESTS: "10000" - UWSGI_DISABLE_LOGGING: "true" + # Snuba serves the API with Granian, which leaves worker recycling off + # unless these are set. Leaving the values empty passes through whatever + # is set on the host system (or in the .env file). + SNUBA_API_WORKERS_MAX_RSS: + SNUBA_API_WORKERS_LIFETIME: SENTRY_KAFKA_MAX_POLL_INTERVAL_MS: # Leaving the value empty to just pass whatever is set # on the host system (or in the .env file)