-
Notifications
You must be signed in to change notification settings - Fork 26
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
### Description of change <!-- This is an auto-generated comment: release notes by coderabbit.ai --> ## Summary by CodeRabbit - **Documentation** - Updated internal documentation links and sidebar positions for improved navigation and clarity. - Introduced new documentation for the Concurrency Limiter and Request Prioritization features. - Enhanced existing documentation with clearer explanations and updated references. - Reorganized content to better reflect feature hierarchies and usage. - Added new sections on advanced concepts, including detailed guides on scheduling and rate limiting. <!-- end of auto-generated comment: release notes by coderabbit.ai -->
- Loading branch information
1 parent
8296f81
commit 6f4a7ad
Showing
34 changed files
with
381 additions
and
247 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
4 changes: 2 additions & 2 deletions
4
api/gen/proto/go/aperture/policy/language/v1/flowcontrol.pb.go
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
--- | ||
title: Advanced | ||
sidebar_position: 8 | ||
sidebar_position: 10 | ||
--- | ||
|
||
```mdx-code-block | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes
File renamed without changes
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,53 @@ | ||
--- | ||
title: Concurrency Limiter | ||
sidebar_position: 6 | ||
--- | ||
|
||
:::info See also | ||
|
||
[_Concurrency Limiter_ reference][reference] | ||
|
||
::: | ||
|
||
The _Concurrency Limiter_ component is used to enforce in-flight request quotas | ||
to prevent overloads. It can also be used to enforce limits per entity such as a | ||
user to ensure fair access across users. Essentially, providing an added layer | ||
of protection in additional to per-user rate limits. | ||
|
||
_Concurrency Limiter_ can limit the number of concurrent requests to a control | ||
point or certain labels that match within the control point. It achieves this by | ||
maintaining a ledger of in-flight requests. If the number of in-flight requests | ||
exceeds the configured limit, the _Concurrency Limiter_ rejects new requests | ||
until the number of in-flight requests drops below the limit. The in-flight | ||
requests are maintained by the Agents based on the flow start and end calls made | ||
from the SDKs. Alternatively, for proxy integrations, the flow end is inferred | ||
as the access log stream is received from the underlying middleware or proxy. | ||
|
||
## Distributed Request Ledgers {#distributed-request-ledgers} | ||
|
||
For each configured [_Concurrency Limiter Component_][reference], every matching | ||
Aperture Agent instantiates a copy of the _Concurrency Limiter_. Although each | ||
agent has its own copy of the component, they all share the in-flight request | ||
ledger through a distributed cache. This means that they work together as a | ||
single _Concurrency Limiter_, providing seamless coordination and control across | ||
Agents. The Agents within an [agent group][agent-group] constantly share state | ||
and detect failures using a gossip protocol. | ||
|
||
## Lifecycle of a Request {#lifecycle-of-a-request} | ||
|
||
The _Concurrency Limiter_ maintains a ledger of in-flight requests. The ledger | ||
is updated by the Agents based on the flow start and end calls made from the | ||
SDKs. Alternatively, for proxy integrations, the flow end is inferred as the | ||
access log stream is received from the underlying middleware or proxy. | ||
|
||
### Max In-flight Duration {#max-in-flight-duration} | ||
|
||
In case of failures at the SDK or middleware/proxy, the flow end call might not | ||
be made. To prevent stale entries in the ledger, the _Concurrency Limiter_ | ||
allows the definition of a maximum in-flight duration. This can be set according | ||
to the maximum time a request is expected to take. If the request exceeds the | ||
configured duration, it is automatically removed from the ledger by the | ||
_Concurrency Limiter_. | ||
|
||
[reference]: /reference/configuration/spec.md#concurrency-limiter | ||
[agent-group]: /concepts/selector.md#agent-group |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
44 changes: 44 additions & 0 deletions
44
docs/content/concepts/request-prioritization/concurrency-scheduler.md
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
--- | ||
title: Concurrency Scheduler | ||
keywords: | ||
- scheduler | ||
- concurrency | ||
- queuing | ||
sidebar_position: 2 | ||
--- | ||
|
||
:::info See Also | ||
|
||
Concurrency Scheduler | ||
[Reference](/reference/configuration/spec.md#concurrency-scheduler) | ||
|
||
::: | ||
|
||
The _Concurrency Scheduler_ is used to schedule requests based on importance | ||
while ensuring that the application adheres to concurrency limits. | ||
|
||
The _Concurrency Scheduler_ can be thought of as a combination of a | ||
[_Scheduler_](../scheduler.md) and a | ||
[_Concurrency Limiter_](../concurrency-limiter.md). It essentially provides | ||
scheduling capabilities atop a _Concurrency Limiter_. Similar to the | ||
_Concurrency Limiter_, this component takes `max_concurrency` as an input port | ||
which determines the maximum number of in-flight requests in the global request | ||
ledger. | ||
|
||
The global request ledger is shared among Agents in an | ||
[agent group](../advanced/agent-group.md). This ledger records the total number | ||
of in-flight requests across the Agents. If the ledger exceeds the configured | ||
`max_concurrency`, new requests are queued until the number of in-flight | ||
requests drops below the limit or | ||
[until timeout](../scheduler.md#queue-timeout). | ||
|
||
In a scenario where the maximum concurrency is known upfront, the _Concurrency | ||
Scheduler_ becomes particularly beneficial to enforce concurrency limits on a | ||
per-service basis. | ||
|
||
The _Concurrency Scheduler_ also allows the definition of | ||
[workloads](../scheduler.md#workload), a property of the scheduler, which allows | ||
for strategic prioritization of requests when faced with concurrency | ||
constraints. As a result, the _Concurrency Scheduler_ ensures adherence to the | ||
concurrency limits and simultaneously offers a mechanism to prioritize requests | ||
based on their importance. |
Oops, something went wrong.