Skip to content

fix(infra): raise MLflow memory limit; cut uvicorn workers to 2 - #32

Merged
Enskc05 merged 1 commit into
mainfrom
devops/fix
Aug 7, 2026
Merged

fix(infra): raise MLflow memory limit; cut uvicorn workers to 2#32
Enskc05 merged 1 commit into
mainfrom
devops/fix

Conversation

@Enskc05

@Enskc05 Enskc05 commented Aug 7, 2026

Copy link
Copy Markdown
Collaborator

fix(infra): raise MLflow memory limit; cut uvicorn workers to 2

MLflow was OOMKilled while receiving the first model artifact and entered
CrashLoopBackOff (4 restarts).

Cause

Artifacts are proxied through the tracking server
(--artifacts-destination with the default --serve-artifacts behaviour), so
the model file passes through MLflow's memory on its way to MinIO. A 2Gi limit
did not cover that, and MLflow 3.x starts four uvicorn workers by default —
each loading the app — so the baseline was already high before any upload.

The failure was self-sustaining: the training client retried the upload, and
each retry killed MLflow again as soon as it came back up. Deleting
The failure was self-sustaining: the training client retried the upl
each retry killed MLflow again as soon as it came back up. Deleting the
training Job is what breaks the loop; raising the limit alone would not have.

Changes

  • Memory limit 2Gi6Gi, request 512Mi1Gi.
  • --workers 2. A single-tenant tracking server does not need four; this
    roughly halves idle memory.
  • Added a troubleshooting row to docs/runbooks/ML-TRAINING.md covering the
    symptom (RemoteDisconnectedConnection refused after training
    completes) and the order of recovery: delete the Job first.

Notes

6Gi is deliberately generous — the pod was deleted before the checkpoint size
could be measured. Once an upload succeeds, kubectl top pod -l app=mlflow
will show real peak usage and the limit can be tightened.

The underlying issue is architectural: proxying artifacts through the tracking
server does not scale with model size. The alternative is having cli
directly to MinIO, which docs/DEVOPS.md §10 deliberately avoided so the ML
side would not need S3 credentials. Worth revisiting as models grow; raising
the limit is the right move for now.

Ilk model artifact'i yuklenirken MLflow OOMKilled olup CrashLoopBackOff'a
girdi (4 restart). Artifact'lar sunucu proxy'sinden gectigi icin model
dosyasi MinIO'ya giderken MLflow'un bellegini kullaniyor; 2Gi limiti
yetmedi. Istemci yuklemeyi yeniden denedigi icin her ayaga kalkista tekrar
oldu — dongu kendini besliyordu.

- limit 2Gi -> 6Gi, request 512Mi -> 1Gi
- --workers 2: MLflow 3.x uvicorn'u varsayilan 4 worker aciyor ve her biri
  uygulamayi ayri yukluyor; tek kullanicili tracking sunucusunda 2 yeterli,
  taban bellek yariya iniyor.
- ML-TRAINING.md sorun giderme tablosuna satir eklendi: bu belirtide once
  Job silinmeli, yoksa MLflow toparlanamaz.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
@Enskc05
Enskc05 merged commit bd5d364 into main Aug 7, 2026
0 of 2 checks passed
Enskc05 added a commit that referenced this pull request Aug 7, 2026
#32'de limit 6Gi'ye cikarilmisti; o sayi olculmeden, guvenli tarafta kalmak
icin secilmisti. Basarili model yuklemesi sonrasi Prometheus'tan olculdu:

  max_over_time(container_memory_working_set_bytes{
    namespace="deephorizon-ml",container="mlflow"}[45m]) = 1.71 GiB

4Gi bunun ~2.3 kati; tek GPU sunucusunda bosa rezervasyon yapmadan buyuyen
artifact'lara pay birakiyor. Olcum ve yeniden olcme sorgusu manifest'e
yorum olarak islendi — kubectl top bu kumede calismiyor (metrics-server
addon'u kapali), o yuzden yontem yaziyla kalsin.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant