logoalt Hacker News

dimestoday at 2:05 AM1 replyview on HN

Multiplexing would have a number of benefits. As you say, each client would only need a single connection regardless of the number of queries being sent. Resulting in:

On the client side, there is usually a local connection pool. When a burst of traffic comes in, the client needs to either wait for the pool to free up or establish a new connection, which adds latency. This latency hit wouldn’t occur with multiplexing.

With multiplexing, systems like pgbouncer would be unnecessary.

Also, even with a thread-per-connection, you can still quickly exhaust the servers resources when you have lots of connections because threads have a lot of overhead. Reducing the number of connections needed would greatly increase the number of clients that a database can serve.


Replies

skybriantoday at 7:17 AM

At that point does it make sense to use http/3 to avoid head-of-line blocking on the network?