-
-
Notifications
You must be signed in to change notification settings - Fork 5
ref(server): Introduce a queue to the concurrency limiter #562
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 all commits
ba4e743
151acd0
3bc02fc
aa2fec0
4d9d436
1682ece
f7acaac
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 | ||||
|---|---|---|---|---|---|---|
|
|
@@ -508,6 +508,8 @@ pub struct Config { | |||||
| /// # Environment Variables | ||||||
| /// | ||||||
| /// - `OS__SERVICE__MAX_CONCURRENCY` | ||||||
| /// - `OS__SERVICE__CONCURRENCY_QUEUE` | ||||||
| /// - `OS__SERVICE__CONCURRENCY_QUEUE_TIMEOUT` | ||||||
| #[derive(Debug, Deserialize, Serialize)] | ||||||
| #[serde(default)] | ||||||
| pub struct Service { | ||||||
|
|
@@ -521,12 +523,39 @@ pub struct Service { | |||||
| /// | ||||||
| /// [`DEFAULT_CONCURRENCY_LIMIT`](objectstore_service::service::DEFAULT_CONCURRENCY_LIMIT) | ||||||
| pub max_concurrency: u32, | ||||||
|
|
||||||
| /// Maximum number of requests that may wait for a concurrency permit. | ||||||
| /// | ||||||
| /// When all `max_concurrency` execution slots are held, up to this many | ||||||
| /// additional requests will park and wait (for at most | ||||||
| /// `concurrency_queue_timeout`) instead of being rejected immediately. | ||||||
| /// Requests beyond that are rejected with HTTP 429. | ||||||
| /// | ||||||
| /// Sizing guidance: `concurrency_queue ≈ permit_release_rate × | ||||||
| /// acceptable_added_latency`. | ||||||
| /// | ||||||
| /// # Default | ||||||
| /// | ||||||
| /// `0` | ||||||
| pub concurrency_queue: u32, | ||||||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
Maybe?
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I'm also not entirely happy with this. Was also thinking of |
||||||
|
|
||||||
| /// Maximum time a request may wait in the concurrency queue. | ||||||
| /// | ||||||
| /// Ignored when `concurrency_queue` is `0`. | ||||||
| /// | ||||||
| /// # Default | ||||||
| /// | ||||||
| /// `1s` | ||||||
| #[serde(with = "humantime_serde")] | ||||||
| pub concurrency_queue_timeout: Duration, | ||||||
| } | ||||||
|
|
||||||
| impl Default for Service { | ||||||
| fn default() -> Self { | ||||||
| Self { | ||||||
| max_concurrency: objectstore_service::service::DEFAULT_CONCURRENCY_LIMIT, | ||||||
| concurrency_queue: 0, | ||||||
| concurrency_queue_timeout: Duration::from_secs(1), | ||||||
| } | ||||||
| } | ||||||
| } | ||||||
|
|
||||||
Uh oh!
There was an error while loading. Please reload this page.