-
Notifications
You must be signed in to change notification settings - Fork 44
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
Load balancing is useless unless we allow configuring the conn.maxStreams value #112
Comments
@nuivall FYI |
BTW, I found this patch from Michal Matczuk in my local repo which didn't make into the
|
Would it do the trick, @nuivall ? |
@mykaul FYI - this is very urgent. Many users complain about this missing feature. |
This is from this PR: #87 I'll review it and merge it if it looks ok. |
@vladzcloudius To double check: #87 implementation will immediately throw In some testing I did in the past (scylladb/scylladb#7748 (comment)) we saw that there were intermittent spikes of inflight requests on a connection. In such case the additional client-side queue helps the driver avoid throwing "overloaded" exception, while still maintaing an arbitrarly low number of inflight (sent to Scylla and awaiting response) requests. If this is not a concern, the PR looks good to me. I would only change the default |
All these are relevant concerns that should be eventually addressed. But regardless, I suggest to merge this and file a separate GH issue for a client side "queuing". BTW, it's not obvious to me at all that the Java driver behavior is better than the current GoCQL one. The former can cause high client side latencies despite Scylla side ones would be low. |
I think the patch should help (unsolved part of the issue is that there is still no limit to max connections with shard aware). As for the default max streams value how it compares to other drivers? Perhaps it indeed should be lower. For the queue I guess it can help to smooth things out, but in general long queues should not accumulate in the system - it's better to fail fast than create an unbalanced state which is then difficult to reason about. Better idea would be to have a controller for both max streams and max connections (I guess one conn perc shard policy won't work well when combined with bigger clusters and distributed clients). Another thing not mentioned is user's ability to react on overload errors. I haven't found how it is done in the gocql currently. This applies also to d71301a. There should be some exported error user can check (i.e. with error.Is(...)) or some other method. |
Please note that we need this fix asap to deal with an ongoing latency spike issue at Kiwi. The issue is related to an unbounded concurrency spikes and the bottlenecks they create. |
Before this change, a connection had a hardcoded maximum number of streams. Since this value was so large (32768 for CQL v3+) this essentially meant an unbound concurrency. This commit allows a user to configure this parameter by a newly added MaxRequestsPerConn option. The "MaxRequestsPerConn" naming was chosen to be very general deliberately to allow us to safely introduce a more advanced behavior in the future: where the concurrency limiting happens not at a IDGenerator level and an additional client-side queue is introduced for requests to wait to be sent to Scylla (in addition to inflight requests). This commit deliberately does not change the defaults as to be non-pessimizing for the users. Fixes scylladb#112
Pushed this PR: #113 I'd be comfortable with merging it "now" as I tried to make it as non-pessimizing and as safe as much as possible. Some limitations of that PR:
|
Thanks, @avelanarius. |
Probably a separate GH issue will be better. |
Before this change, a connection had a hardcoded maximum number of streams. Since this value was so large (32768 for CQL v3+) this essentially meant an unbound concurrency. This commit allows a user to configure this parameter by a newly added MaxRequestsPerConn option. The "MaxRequestsPerConn" naming was chosen to be very general deliberately to allow us to safely introduce a more advanced behavior in the future: where the concurrency limiting happens not at a IDGenerator level and an additional client-side queue is introduced for requests to wait to be sent to Scylla (in addition to inflight requests). This commit deliberately does not change the defaults as to be non-pessimizing for the users. Fixes scylladb#112
@avelanarius I posted comments on the avelanarius@8baecfb |
Actually, their version looks better in this regard: kiwicom#31 |
In that patch having both MaxStreamID and NumStreams I think is quite confusing. |
Before this change, a connection had a hardcoded maximum number of streams. Since this value was so large (32768 for CQL v3+) this essentially meant an unbound concurrency. This commit allows a user to configure this parameter by a newly added MaxRequestsPerConn option. The "MaxRequestsPerConn" naming was chosen to be very general deliberately to allow us to safely introduce a more advanced behavior in the future: where the concurrency limiting happens not at a IDGenerator level and an additional client-side queue is introduced for requests to wait to be sent to Scylla (in addition to inflight requests). This commit deliberately does not change the defaults as to be non-pessimizing for the users. Fixes scylladb#112
Before this change, a connection had a hardcoded maximum number of streams. Since this value was so large (32768 for CQL v3+) this essentially meant an unbound concurrency. This commit allows a user to configure this parameter by a newly added MaxRequestsPerConn option. The "MaxRequestsPerConn" naming was chosen to be very general deliberately to allow us to safely introduce a more advanced behavior in the future: where the concurrency limiting happens not at a IDGenerator level and an additional client-side queue is introduced for requests to wait to be sent to Scylla (in addition to inflight requests). This commit deliberately does not change the defaults as to be non-pessimizing for the users. Fixes #112
HEAD: c8cd0ba
Description
The hard codded value for "protocol" version greater than 2 is 32768: https://github.com/scylladb/gocql/blob/master/internal/streams/streams.go#L24
This makes #86 pretty much useless with a shard-aware driver because any concurrency above 100-200 per shard is already going to cause issues.
The issue is a follow up for the comment here: #86 (comment)
Two things:
conn.maxStreams
value by the user.The text was updated successfully, but these errors were encountered: