fix(runtime): 強化健康檢查監控韌性
All checks were successful
CD Pipeline / deploy (push) Successful in 2m29s

This commit is contained in:
OoO
2026-05-01 14:46:49 +08:00
parent 77b085f813
commit 6bce46bbc7
18 changed files with 130 additions and 19 deletions

View File

@@ -105,3 +105,8 @@
- **原因**: Hermes/Ollama 負載高或舊 `/api/embeddings` endpoint 慢,會讓 embedding worker 累加 retry。
- **檢查**: 看 `embedding_retry_queue``pending/processing/failed` 分布,並測 `http://192.168.0.111:11434/api/embed`
- **修復**: client 預設使用官方 `/api/embed`;若舊節點 404/405 才 fallback `/api/embeddings`。必要時調整 `EMBEDDING_TIMEOUT`
### 11. `/health` 偶發 000 或容器 unhealthy但 app log 仍有 200
- **原因**: Blackbox 或外部探測打 Dashboard 首頁 `/`,會觸發商品看板與 PChome 比價重型查詢;少量 sync worker 被長請求佔滿時,輕量 `/health` 也會排隊逾時。
- **檢查**: `docker logs momo-pro-system --since 20m | grep 'Blackbox-Exporter'` 應只看到 `GET /health``docker stats momo-db` 若接近多核心滿載,需同步看 `pg_stat_activity``latest_momo` 類查詢。
- **修復**: 188 的 `monitoring/prometheus.yml` 與 110 的 `/home/wooo/monitoring/prometheus.yml` blackbox HTTP targets 必須使用 `/health`Gunicorn 保持 `worker_class=gthread``GUNICORN_THREADS=4``preload_app=False`