feat: add SCGI connection pooling with bb8
Some checks failed
Build MIPS Binary / build (push) Failing after 3m50s

- Implement ScgiConnectionManager with bb8 for Unix socket pooling
- Create connection pool with max 10 connections, min 5 idle
- Update RtorrentClient to use pooled connections instead of per-request connections
- Add ScgiPool to AppState for shared access across handlers
- Update all handlers to use pooled client
- Reduces file descriptor pressure and connection latency
This commit is contained in:
spinline
2026-02-08 23:18:11 +03:00
parent 3ffc7576a0
commit 05d3a60d56
6 changed files with 135 additions and 83 deletions

14
Cargo.lock generated
View File

@@ -292,9 +292,11 @@ name = "backend"
version = "0.1.0"
dependencies = [
"anyhow",
"async-trait",
"axum",
"axum-extra",
"base64 0.22.1",
"bb8",
"bcrypt",
"bytes",
"clap",
@@ -356,6 +358,18 @@ version = "1.8.3"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "2af50177e190e07a26ab74f8b1efbfe2ef87da2116221318cb1c2e82baf7de06"
[[package]]
name = "bb8"
version = "0.8.6"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "d89aabfae550a5c44b43ab941844ffcd2e993cb6900b342debf59e9ea74acdb8"
dependencies = [
"async-trait",
"futures-util",
"parking_lot",
"tokio",
]
[[package]]
name = "bcrypt"
version = "0.17.1"