fix(config): 提升粘性会话默认等待时长
- 默认值调整为 120s - 同步示例配置与环境变量
This commit is contained in:
@@ -767,7 +767,7 @@ func setDefaults() {
|
|||||||
viper.SetDefault("gateway.stream_keepalive_interval", 10)
|
viper.SetDefault("gateway.stream_keepalive_interval", 10)
|
||||||
viper.SetDefault("gateway.max_line_size", 10*1024*1024)
|
viper.SetDefault("gateway.max_line_size", 10*1024*1024)
|
||||||
viper.SetDefault("gateway.scheduling.sticky_session_max_waiting", 3)
|
viper.SetDefault("gateway.scheduling.sticky_session_max_waiting", 3)
|
||||||
viper.SetDefault("gateway.scheduling.sticky_session_wait_timeout", 45*time.Second)
|
viper.SetDefault("gateway.scheduling.sticky_session_wait_timeout", 120*time.Second)
|
||||||
viper.SetDefault("gateway.scheduling.fallback_wait_timeout", 30*time.Second)
|
viper.SetDefault("gateway.scheduling.fallback_wait_timeout", 30*time.Second)
|
||||||
viper.SetDefault("gateway.scheduling.fallback_max_waiting", 100)
|
viper.SetDefault("gateway.scheduling.fallback_max_waiting", 100)
|
||||||
viper.SetDefault("gateway.scheduling.load_batch_enabled", true)
|
viper.SetDefault("gateway.scheduling.load_batch_enabled", true)
|
||||||
|
|||||||
@@ -73,6 +73,18 @@ JWT_EXPIRE_HOUR=24
|
|||||||
# Gateway Scheduling (Optional)
|
# Gateway Scheduling (Optional)
|
||||||
# 调度缓存与受控回源配置(缓存就绪且命中时不读 DB)
|
# 调度缓存与受控回源配置(缓存就绪且命中时不读 DB)
|
||||||
# -----------------------------------------------------------------------------
|
# -----------------------------------------------------------------------------
|
||||||
|
# 粘性会话最大排队长度
|
||||||
|
GATEWAY_SCHEDULING_STICKY_SESSION_MAX_WAITING=3
|
||||||
|
# 粘性会话等待超时(时间段,例如 45s)
|
||||||
|
GATEWAY_SCHEDULING_STICKY_SESSION_WAIT_TIMEOUT=120s
|
||||||
|
# 兜底排队等待超时(时间段,例如 30s)
|
||||||
|
GATEWAY_SCHEDULING_FALLBACK_WAIT_TIMEOUT=30s
|
||||||
|
# 兜底最大排队长度
|
||||||
|
GATEWAY_SCHEDULING_FALLBACK_MAX_WAITING=100
|
||||||
|
# 启用调度批量负载计算
|
||||||
|
GATEWAY_SCHEDULING_LOAD_BATCH_ENABLED=true
|
||||||
|
# 并发槽位清理周期(时间段,例如 30s)
|
||||||
|
GATEWAY_SCHEDULING_SLOT_CLEANUP_INTERVAL=30s
|
||||||
# 是否允许受控回源到 DB(默认 true,保持现有行为)
|
# 是否允许受控回源到 DB(默认 true,保持现有行为)
|
||||||
GATEWAY_SCHEDULING_DB_FALLBACK_ENABLED=true
|
GATEWAY_SCHEDULING_DB_FALLBACK_ENABLED=true
|
||||||
# 受控回源超时(秒),0 表示不额外收紧超时
|
# 受控回源超时(秒),0 表示不额外收紧超时
|
||||||
|
|||||||
@@ -172,6 +172,24 @@ gateway:
|
|||||||
# Scheduling configuration
|
# Scheduling configuration
|
||||||
# 调度配置
|
# 调度配置
|
||||||
scheduling:
|
scheduling:
|
||||||
|
# Sticky session max waiting queue size
|
||||||
|
# 粘性会话最大排队长度
|
||||||
|
sticky_session_max_waiting: 3
|
||||||
|
# Sticky session wait timeout (duration)
|
||||||
|
# 粘性会话等待超时(时间段)
|
||||||
|
sticky_session_wait_timeout: 120s
|
||||||
|
# Fallback wait timeout (duration)
|
||||||
|
# 兜底排队等待超时(时间段)
|
||||||
|
fallback_wait_timeout: 30s
|
||||||
|
# Fallback max waiting queue size
|
||||||
|
# 兜底最大排队长度
|
||||||
|
fallback_max_waiting: 100
|
||||||
|
# Enable batch load calculation for scheduling
|
||||||
|
# 启用调度批量负载计算
|
||||||
|
load_batch_enabled: true
|
||||||
|
# Slot cleanup interval (duration)
|
||||||
|
# 并发槽位清理周期(时间段)
|
||||||
|
slot_cleanup_interval: 30s
|
||||||
# 是否允许受控回源到 DB(默认 true,保持现有行为)
|
# 是否允许受控回源到 DB(默认 true,保持现有行为)
|
||||||
db_fallback_enabled: true
|
db_fallback_enabled: true
|
||||||
# 受控回源超时(秒),0 表示不额外收紧超时
|
# 受控回源超时(秒),0 表示不额外收紧超时
|
||||||
|
|||||||
Reference in New Issue
Block a user