perf(gateway): 流式处理代码层性能优化

- 将 spawn 内 buffered_body 从 Vec<u8> 改为 VecDeque<u8>, drain 前端从 O(n) 变 O(1)
- 消除 prefetched body/chunks 的不必要 clone, 改为直接 move
- Pending/Streaming 非终态候选状态写入改为 tokio::spawn fire-and-forget
- 连接池默认 max_connections 从 30 提升到 50
This commit is contained in:
fawney19
2026-04-15 11:55:45 +08:00
parent 026a77306c
commit 707d9ac274
2 changed files with 73 additions and 49 deletions

View File

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