chore(deploy): 补齐连接池默认与 8G 参数

This commit is contained in:
yangjianbo
2026-02-06 20:44:08 +08:00
parent 2d4bbbf49d
commit de753a149e
4 changed files with 13 additions and 10 deletions

View File

@@ -888,7 +888,7 @@ func setDefaults() {
// HTTP 上游连接池配置(针对 5000+ 并发用户优化)
viper.SetDefault("gateway.max_idle_conns", 240) // 最大空闲连接总数HTTP/2 场景默认)
viper.SetDefault("gateway.max_idle_conns_per_host", 120) // 每主机最大空闲连接HTTP/2 场景默认)
viper.SetDefault("gateway.max_conns_per_host", 4096) // 每主机最大连接数(含活跃;流式/HTTP1.1 可调大)
viper.SetDefault("gateway.max_conns_per_host", 1024) // 每主机最大连接数(含活跃;流式/HTTP1.1 场景可调大,如 2400+
viper.SetDefault("gateway.idle_conn_timeout_seconds", 90) // 空闲连接超时(秒)
viper.SetDefault("gateway.max_upstream_clients", 5000)
viper.SetDefault("gateway.client_idle_ttl_seconds", 900)