Skip to content
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

Merged

Conversation

NyaaaWhatsUpDoc
Copy link
Member

  • 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>
@NyaaaWhatsUpDoc NyaaaWhatsUpDoc added enhancement New feature or request performance chore a pain in the butt that needs doing labels Nov 7, 2022
@NyaaaWhatsUpDoc NyaaaWhatsUpDoc changed the title [chore] improve request queue performance [feature] various worker / request queue improvements Nov 7, 2022
Signed-off-by: kim <grufwub@gmail.com>
Copy link
Contributor

@tsmethurst tsmethurst left a 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)
Copy link
Contributor

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))
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ah concurrency

@tsmethurst tsmethurst merged commit 0e57246 into superseriousbusiness:main Nov 8, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
chore a pain in the butt that needs doing enhancement New feature or request performance
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants