Skip to content

Commit 15bcc8e

Browse files
dklibanclaude
andauthored
fix: set pulp-api --max-requests to 5000 to prevent OOM (#1163)
Without an explicit --max-requests, pulp-api workers accumulate memory indefinitely due to a leak (~60 MiB/hr), causing OOMKilled events. Set --max-requests=5000 (jitter 500) to recycle workers before they exhaust the 5120 MiB limit while keeping counter values high enough for reliable Prometheus counter reset detection in SLO metrics. Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
1 parent 6d03c4e commit 15bcc8e

1 file changed

Lines changed: 7 additions & 1 deletion

File tree

deploy/clowdapp.yaml

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -294,7 +294,7 @@ objects:
294294
annotations:
295295
"kubectl.kubernetes.io/default-container": pulp-api
296296
image: ${IMAGE}:${IMAGE_TAG}
297-
command: ['pulpcore-api', '-b', '0.0.0.0:8000', '--timeout', '${PULP_API_GUNICORN_TIMEOUT}', '--workers', '${PULP_API_GUNICORN_WORKERS}', '--access-logfile', '-', '--access-logformat', '(pulp [%({correlation-id}o)s]: %(h)s %(l)s user:%({REMOTE_USER}e)s org_id:%({ORG_ID}e)s %(t)s "%(r)s" %(s)s %(b)s "%(f)s" "%(a)s" %(M)s x_forwarded_for:"%({X_FORWARDED_FOR}e)s")']
297+
command: ['pulpcore-api', '-b', '0.0.0.0:8000', '--timeout', '${PULP_API_GUNICORN_TIMEOUT}', '--max-requests', '${PULP_API_GUNICORN_MAX_REQUESTS}', '--max-requests-jitter', '${PULP_API_GUNICORN_MAX_REQUESTS_JITTER}', '--workers', '${PULP_API_GUNICORN_WORKERS}', '--access-logfile', '-', '--access-logformat', '(pulp [%({correlation-id}o)s]: %(h)s %(l)s user:%({REMOTE_USER}e)s org_id:%({ORG_ID}e)s %(t)s "%(r)s" %(s)s %(b)s "%(f)s" "%(a)s" %(M)s x_forwarded_for:"%({X_FORWARDED_FOR}e)s")']
298298
volumeMounts:
299299
- name: secret-volume
300300
mountPath: "/etc/pulp/keys"
@@ -1369,6 +1369,12 @@ parameters:
13691369
- name: PULP_API_GUNICORN_TIMEOUT
13701370
description: Workers silent for more than this many seconds are killed and restarted.
13711371
value: "1800"
1372+
- name: PULP_API_GUNICORN_MAX_REQUESTS
1373+
description: The maximum number of requests an API worker will process before restarting.
1374+
value: "5000"
1375+
- name: PULP_API_GUNICORN_MAX_REQUESTS_JITTER
1376+
description: The maximum jitter to add to the API max_requests setting for each worker.
1377+
value: "500"
13721378
- name: PULP_API_GUNICORN_WORKERS
13731379
description: Number of gunicorn workers in the API pods
13741380
value: "1"

0 commit comments

Comments
 (0)