mirror of
https://github.com/fawney19/Aether.git
synced 2026-09-03 09:50:21 +08:00
chore: 调整 Postgres 连接池默认参数:增大最大连接数、缩短获取超时
This commit is contained in:
@@ -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,
|
||||||
|
|
||||||
|
|||||||
@@ -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,
|
||||||
|
|||||||
Reference in New Issue
Block a user