chore(gateway): 调小 Postgres 连接池默认值

- max_connections 100 → 20
- idle_timeout 60s → 30s
- .env.example 补充连接池相关变量注释
This commit is contained in:
fawney19
2026-04-25 09:53:21 +08:00
parent f30b1f3f6b
commit e5bbc797e0
3 changed files with 11 additions and 6 deletions

View File

@@ -170,7 +170,7 @@ struct GatewayDataArgs {
#[arg(
long,
env = "AETHER_GATEWAY_DATA_POSTGRES_MAX_CONNECTIONS",
default_value_t = 100
default_value_t = 20
)]
postgres_max_connections: u32,
@@ -184,7 +184,7 @@ struct GatewayDataArgs {
#[arg(
long,
env = "AETHER_GATEWAY_DATA_POSTGRES_IDLE_TIMEOUT_MS",
default_value_t = 60_000
default_value_t = 30_000
)]
postgres_idle_timeout_ms: u64,
@@ -1243,9 +1243,9 @@ mod tests {
redis_url: None,
redis_key_prefix: None,
postgres_min_connections: 1,
postgres_max_connections: 100,
postgres_max_connections: 20,
postgres_acquire_timeout_ms: 10_000,
postgres_idle_timeout_ms: 60_000,
postgres_idle_timeout_ms: 30_000,
postgres_max_lifetime_ms: 1_800_000,
postgres_statement_cache_capacity: 100,
postgres_require_ssl: false,