You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The client maintains a connection pool behind the scenes, one for each protocol. Connections are opened as-needed; a random node is selected when a new connection is requested.
What isn't obvious from this is that in a single threaded use case you are pinned to a single host for the life of a client object until a connection fails and you need a new one. This can be less than ideal when you expect requests to be distributed to a full cluster to avoid hotspots.
I think it would be preferable if every time you perform a riak command on a client, that a new connection from a random node is used. (ie: you end up with at least one connection to each node in the pool, and requests are balanced among all nodes).
TL;DR; while client.init.py _choose_node() does pick a random node, it only ever does so once (for the life of that client object until BadResource is raised by some operation).
It would seem that the pool should be filled with a connection for each node initially, or some other handling happens in a single threaded environment to actually distribute requests not just to just connect once to a random node.
The text was updated successfully, but these errors were encountered:
The docs describe connection pooling as
What isn't obvious from this is that in a single threaded use case you are pinned to a single host for the life of a client object until a connection fails and you need a new one. This can be less than ideal when you expect requests to be distributed to a full cluster to avoid hotspots.
I think it would be preferable if every time you perform a riak command on a client, that a new connection from a random node is used. (ie: you end up with at least one connection to each node in the pool, and requests are balanced among all nodes).
TL;DR; while client.init.py
_choose_node()
does pick a random node, it only ever does so once (for the life of that client object untilBadResource
is raised by some operation).It would seem that the pool should be filled with a connection for each node initially, or some other handling happens in a single threaded environment to actually distribute requests not just to just connect once to a random node.
The text was updated successfully, but these errors were encountered: