본문 바로가기
C.W.K.
Stream
Lesson 05 of 05 · published

Health Check, Metric, 재시작 전략

~22 min · serving, ops, monitoring

Level 0스카우트
0 XP0/50 lessons0/10 achievements
0/120 XP to next level120 XP to go0% complete

처리량보다 대기열을 먼저 봐

TGI와 vLLM은 Prometheus 지표를 제공해. 요청 수와 추론 시간뿐 아니라 tgi_queue_sizevllm_num_requests_waiting처럼 대기열을 보여 주는 값을 함께 수집해. 대기열이 계속 0보다 크면 일시적 부하가 아니라 용량 부족 신호야. 배치 크기와 GPU 메모리는 TGI 지표, nvidia-smi exporter 또는 DCGM으로 보완해.

살아 있음과 준비됨을 구분해

GET /health가 200이면 가중치가 로드되어 요청을 받을 준비가 된 상태야. Kubernetes readiness probe에 사용하고, GET /info로 실제 모델 ID가 배포 설정과 같은지도 확인해.

재시작은 캐시까지 포함한 계획이야

Docker에는 --restart=unless-stopped, Kubernetes에는 restartPolicy: Always와 충분한 초기 지연을 둔 liveness probe를 설정해. 모델 로드는 분 단위가 걸릴 수 있으므로 가중치를 이미지나 영구 볼륨에 미리 넣어. 프로덕션 재시작을 첫 다운로드로 시작하면 복구 시간이 네트워크 상태에 종속돼.

Code

k8s readiness + liveness probe (TGI / vLLM)·yaml
# Full pod spec elided.
spec:
  containers:
  - name: tgi
    image: ghcr.io/huggingface/text-generation-inference:latest
    args: ["--model-id", "/models/llama-3.1-8b", "--port", "80"]
    ports: [{containerPort: 80}]
    readinessProbe:
      httpGet: {path: /health, port: 80}
      initialDelaySeconds: 30
      periodSeconds: 10
    livenessProbe:
      httpGet: {path: /health, port: 80}
      initialDelaySeconds: 300   # 넉넉히: 가중치 로드 느림
      periodSeconds: 30
      failureThreshold: 3
alert 치기 전 빠른 체크·bash
# metrics 엔드포인트 hit, key series grep
curl -s http://localhost:8080/metrics | egrep 'request_count|queue_size|batch_current_size' | head -20

External links

Exercise

TGI 또는 vLLM 컨테이너에 Prometheus scrape 추가. 30 분 soak test (낮은 일정 트래픽). watch: queue size, batch size, 요청 latency p50/p95, GPU 메모리. 어떤 series 가 너 alert 후보, 어떤 threshold 인지 식별.

Progress

Progress is local-only — sign in to sync across devices.
이 페이지에서 버그를 발견하셨거나 피드백이 있으세요?문제 신고

댓글 0

🔔 답글 알림 (로그인 필요)
로그인댓글을 남기려면 로그인해 주세요.

아직 댓글이 없어요. 첫 댓글을 남겨보세요.