Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions charts/model-engine/templates/gateway_deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,7 @@ spec:
path: /readyz
port: 5000
periodSeconds: 2
timeoutSeconds: {{ ((.Values.gateway).readinessProbeTimeoutSeconds | default 5) }}
failureThreshold: 30
command:
- dumb-init
Expand Down
6 changes: 6 additions & 0 deletions charts/model-engine/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,12 @@ celery_broker_type_redis: null
# drop:
# - ALL

# gateway [optional] tuning for the gateway deployment.
gateway:
# readinessProbeTimeoutSeconds sets the /readyz probe timeout. The k8s default of 1s
# ejects saturated-but-healthy pods and concentrates load on the survivors.
readinessProbeTimeoutSeconds: 5

redis:
auth:
authSecretName: ""
Expand Down
9 changes: 7 additions & 2 deletions model-engine/model_engine_server/api/app.py
Original file line number Diff line number Diff line change
Expand Up @@ -313,8 +313,13 @@ def load_redis():
get_or_create_aioredis_pool()


def healthcheck() -> Response:
"""Returns 200 if the app is healthy."""
async def healthcheck() -> Response:
"""Returns 200 if the app is healthy.

Must be async: a sync handler runs in the shared threadpool, so under load the
probe queues behind blocked requests and misses its timeout, ejecting pods that
are saturated but healthy.
"""
return Response(status_code=200)


Expand Down