-
-
Notifications
You must be signed in to change notification settings - Fork 349
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
[feature] various worker / request queue improvements #995
[feature] various worker / request queue improvements #995
Conversation
NyaaaWhatsUpDoc
commented
Nov 7, 2022
- greatly simplifies request queue to remove per-method queues
- uses faster lock-free map implementation for per-host queues
- reduces number of allocations by only allocating new channel if existing not found
- adds warning logs if worker / request queues are full
Signed-off-by: kim <grufwub@gmail.com>
Signed-off-by: kim <grufwub@gmail.com>
Signed-off-by: kim <grufwub@gmail.com>
Signed-off-by: kim <grufwub@gmail.com>
Signed-off-by: kim <grufwub@gmail.com>
Signed-off-by: kim <grufwub@gmail.com>
Signed-off-by: kim <grufwub@gmail.com>
Signed-off-by: kim <grufwub@gmail.com>
Signed-off-by: kim <grufwub@gmail.com>
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.
lgtm :)
} | ||
|
||
if cfg.MaxBodySize <= 0 { | ||
// By default set this to a reasonable 40MB | ||
cfg.MaxBodySize = 40 * 1024 * 1024 | ||
cfg.MaxBodySize = int64(40 * bytesize.MiB) |
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.
nice
} | ||
|
||
// Allocate a new host queue (or return a sneaky existing one). | ||
queue, _ = c.queue.GetOrInsert(host, make(chan struct{}, c.cmax)) |
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.
ah concurrency