-
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
Add configurable MaxRequestsPerConn cluster param #113
Conversation
Limitations:
|
What about 64 multiple limitation you mentioned, other value will break the code? If so perhaps rounding is needed or panic check somewhere. |
First of all, this will cause trouble: gocql/internal/streams/streams.go Line 28 in c8cd0ba
as too few buckets will get allocated. An immediate solution would be to round it up: gocql/internal/streams/streams.go Lines 45 to 76 in c8cd0ba
To get this PR pushed out quickly I decided not to fix this at the moment. |
Maybe we could just round up and then set the unused bits to 1 in the last bucket if |
that's good, and if you don't want to change the code maybe for now just the first part (round up) so that e.g. MaxRequestsPerConn = 54 will be treated as = 64. |
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
82c72d2
to
cc4c65b
Compare
In the amended commit, added rounding up of MaxRequestsPerConn to the nearest multiple of 64. I think this now can be merged. A follow-up PR could relax the requirement that maxStream has to be a multiple of 64. |
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 queue).
This commit deliberately does not change the defaults as to be non-pessimizing for the users.
Fixes #112