-
Notifications
You must be signed in to change notification settings - Fork 70
Make heavy loaded optimization configurable #114
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
Changes from 1 commit
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -345,10 +345,10 @@ func (p *scyllaConnPicker) maybeReplaceWithLessBusyConnection(c *Conn) *Conn { | |
| return c | ||
| } | ||
| alternative := p.leastBusyConn() | ||
| if alternative == nil || alternative.AvailableStreams() * 120 > c.AvailableStreams() * 100 { | ||
| return c | ||
| } else { | ||
| if alternative != nil && alternative.InUseStreams() * 100 < c.InUseStreams() * 80 { | ||
|
||
| return alternative | ||
| } else { | ||
| return c | ||
| } | ||
| } | ||
|
|
||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
A question from a C-guy: why did you have to create all these complications with casting like this one (
intwould be aint64on 64-bit platform according to https://www.educative.io/answers/what-is-type-int-in-golang)?I assume that the reason you need to do all these transformations is because
NumStreamsisintbut for whatever unclear to me reasoninuseStreamsisint32. And this makes no sense to me at all becauseinuseStreamscan get a value stored inNumStreams, and this implies that they should have the same type.Am I missing something?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It is due to golang
atomicpackage that does not have API forint.