fix(db): 收斂 DatabaseManager PostgreSQL 連線池
All checks were successful
CD Pipeline / deploy (push) Successful in 1m35s
All checks were successful
CD Pipeline / deploy (push) Successful in 1m35s
This commit is contained in:
@@ -96,3 +96,8 @@
|
||||
- **原因**: NVIDIA `/v1/models` 可能列出模型,但帳號未必可呼叫該 hosted function;production 曾對 Ultra 253B 回 `Function ... Not found for account`。
|
||||
- **檢查**: 在容器內用 `NVIDIA_API_KEY` 呼叫 `https://integrate.api.nvidia.com/v1/models`,再用低 `max_tokens` 測試目標 model。
|
||||
- **修復**: `ELEPHANT_ALPHA_MODEL` 預設使用 `nvidia/llama-3.3-nemotron-super-49b-v1.5`,並保留 `ELEPHANT_ALPHA_FALLBACK_MODELS`。
|
||||
|
||||
### 9. PostgreSQL 連線數快速升高
|
||||
- **原因**: Flask routes 會頻繁建立 `DatabaseManager()`,若每次都產生新 engine/pool,Gunicorn 多 worker 會快速吃滿 PostgreSQL clients。
|
||||
- **修復**: `DatabaseManager` 以 `(DATABASE_TYPE, DATABASE_PATH)` 重用 engine/session,且 PostgreSQL pool 收斂為 `pool_size=2/max_overflow=3`。
|
||||
- **檢查**: app log 應出現 `使用 PostgreSQL 資料庫 (連線池已收斂)`,Gunicorn `post_fork` 仍需 dispose inherited engines。
|
||||
|
||||
Reference in New Issue
Block a user