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

뭘 scrape

TGI 와 vLLM 둘 다 configurable 포트에 Prometheus metric expose. key series:

  • tgi_request_count / vllm_requests_total — throughput.
  • tgi_request_inference_duration — 요청별 latency 히스토그램.
  • tgi_queue_size / vllm_num_requests_waiting — backlog. 지속적으로 > 0 면 alert.
  • tgi_batch_current_size — live batch fullness.
  • GPU 메모리: nvidia-smi-exporter 또는 DCGM exporter scrape.

Health check

둘 다 GET /health. 가중치 로드되면 200. k8s readiness probe 로; 실행 모델 id 가 너 config 가 live 라 생각하는 거랑 매치하는지 검증엔 GET /info.

재시작 전략

인퍼런스 서버가 long-tailed 워크로드에서 가끔 메모리 leak. Docker 에 --restart=unless-stopped 핀. k8s 면 restartPolicy: Always + 넉넉한 initial delay (모델 로드 분 단위 가능) 의 liveness probe. cold start 계획: 가중치를 이미지 또는 persistent volume 에 pre-load; 프로덕션 노드에서 절대 first-pull X.

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

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

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