Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Introduce heap balancer for the gRPC connection pool #589

Draft
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

mrahs
Copy link
Collaborator

@mrahs mrahs commented Jul 29, 2024

We observed increased latencies in builds that use the round-robin balancer. It is possible that the load is not uniformly spread across the pool, particularly around streams. This could cause client-side queuing on hot connections which may explain the increased latencies.

The heap-based balancer keeps track of the number of invocation and streaming requests per connection and selects the least used connection. One big caveat is that the pool is not aware of active connections. The number of stream requests is not necessarily the number of active streams on the connection. Without that knowledge, it is still possible for some connections to be used more than others. E.g. if long streaming requests accumulate on the same connection.

@mrahs mrahs force-pushed the master branch 4 times, most recently from 502427d to bc3a965 Compare July 31, 2024 17:46
We observed increased latencies in builds that use the round-robin balancer.
It is possible that the load is not uniformly spread across the pool, particularly
around streams.
This could cause client-side queuing on hot connections which may explain
the increased latencies.

The heap-based balancer keeps track of the number of invocation
and streaming requests per connection and selects the least used connection.
One big caveat is that the pool is not aware of active connections.
The number of stream requests is not necessarily the number of active streams
on the connection. Without that knowledge, it is still possible for some connections
to be used more than others.
E.g. if long streaming requests accumulate on the same connection.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant