Client vs Pool for async web servers: is multiplexing sufficient? #371
Unanswered
richarddalves
asked this question in
Q&A
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
I'm building an async web server with Axum and trying to decide between using a single
Client(cloned across handlers) or aPoolfor my Valkey connection.My understanding is that
Clientuses internal multiplexing, meaning a single TCP connection can handle many concurrent commands without blocking - similar to howredis-rsdescribes itsMultiplexedConnection. If that's correct, aPoolwould only provide meaningful benefits in extreme high-throughput scenarios where a single TCP connection becomes a bottleneck.A few questions:
Clientuse internal multiplexing, or does it serialize commands?Clientthe recommended approach, or shouldPoolbe the default?Poolis recommended, is there a suggested starting size, or is that purely workload-dependent?All reactions