chore: 调整 Nginx 代理超时配置并移除废弃的 concurrency_slot_ttl

- proxy_connect_timeout 从 600s 降至 60s
- proxy_send_timeout/proxy_read_timeout 从 600s 升至 3600s 以支持长时间流式响应
- 移除已无引用的 concurrency_slot_ttl 配置项
This commit is contained in:
fawney19
2026-02-12 11:57:42 +08:00
parent be430ebdde
commit 4c83780b5e
3 changed files with 6 additions and 8 deletions

View File

@@ -94,9 +94,9 @@ RUN printf '%s\n' \
' chunked_transfer_encoding on;' \ ' chunked_transfer_encoding on;' \
' gzip off;' \ ' gzip off;' \
' add_header X-Accel-Buffering no;' \ ' add_header X-Accel-Buffering no;' \
' proxy_connect_timeout 600s;' \ ' proxy_connect_timeout 60s;' \
' proxy_send_timeout 600s;' \ ' proxy_send_timeout 3600s;' \
' proxy_read_timeout 600s;' \ ' proxy_read_timeout 3600s;' \
' }' \ ' }' \
'' \ '' \
' # API 文档路由 → 代理到后端' \ ' # API 文档路由 → 代理到后端' \

View File

@@ -105,9 +105,9 @@ RUN printf '%s\n' \
' chunked_transfer_encoding on;' \ ' chunked_transfer_encoding on;' \
' gzip off;' \ ' gzip off;' \
' add_header X-Accel-Buffering no;' \ ' add_header X-Accel-Buffering no;' \
' proxy_connect_timeout 600s;' \ ' proxy_connect_timeout 60s;' \
' proxy_send_timeout 600s;' \ ' proxy_send_timeout 3600s;' \
' proxy_read_timeout 600s;' \ ' proxy_read_timeout 3600s;' \
' }' \ ' }' \
'' \ '' \
' # API 文档路由 → 代理到后端' \ ' # API 文档路由 → 代理到后端' \

View File

@@ -132,9 +132,7 @@ class Config:
self.db_pool_warn_threshold = int(os.getenv("DB_POOL_WARN_THRESHOLD", "70")) self.db_pool_warn_threshold = int(os.getenv("DB_POOL_WARN_THRESHOLD", "70"))
# 并发控制配置 # 并发控制配置
# CONCURRENCY_SLOT_TTL: 并发槽位 TTL防止死锁
# CACHE_RESERVATION_RATIO: 缓存用户预留比例(默认 10%,新用户可用 90% # CACHE_RESERVATION_RATIO: 缓存用户预留比例(默认 10%,新用户可用 90%
self.concurrency_slot_ttl = int(os.getenv("CONCURRENCY_SLOT_TTL", "600"))
self.cache_reservation_ratio = float(os.getenv("CACHE_RESERVATION_RATIO", "0.1")) self.cache_reservation_ratio = float(os.getenv("CACHE_RESERVATION_RATIO", "0.1"))
# 限流降级策略配置 # 限流降级策略配置