chore: 调整 Postgres 连接池默认参数:增大最大连接数、缩短获取超时

This commit is contained in:
fawney19
2026-04-11 02:26:33 +08:00
parent 6144473ebe
commit cf02a10050
2 changed files with 4 additions and 4 deletions

View File

@@ -163,14 +163,14 @@ struct GatewayDataArgs {
#[arg( #[arg(
long, long,
env = "AETHER_GATEWAY_DATA_POSTGRES_MAX_CONNECTIONS", env = "AETHER_GATEWAY_DATA_POSTGRES_MAX_CONNECTIONS",
default_value_t = 20 default_value_t = 30
)] )]
postgres_max_connections: u32, postgres_max_connections: u32,
#[arg( #[arg(
long, long,
env = "AETHER_GATEWAY_DATA_POSTGRES_ACQUIRE_TIMEOUT_MS", env = "AETHER_GATEWAY_DATA_POSTGRES_ACQUIRE_TIMEOUT_MS",
default_value_t = 5_000 default_value_t = 3_000
)] )]
postgres_acquire_timeout_ms: u64, postgres_acquire_timeout_ms: u64,

View File

@@ -21,8 +21,8 @@ impl Default for PostgresPoolConfig {
Self { Self {
database_url: String::new(), database_url: String::new(),
min_connections: 1, min_connections: 1,
max_connections: 20, max_connections: 30,
acquire_timeout_ms: 5_000, acquire_timeout_ms: 3_000,
idle_timeout_ms: 60_000, idle_timeout_ms: 60_000,
max_lifetime_ms: 30 * 60_000, max_lifetime_ms: 30 * 60_000,
statement_cache_capacity: 100, statement_cache_capacity: 100,