-
Notifications
You must be signed in to change notification settings - Fork 65
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
80c0ba00e24577526f170cdf209b1696792a1597
- Loading branch information
Showing
12 changed files
with
120 additions
and
4 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
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,4 +1,5 @@ | ||
# Практики использования | ||
|
||
- [Discard Overflow](best_practices/discard-overflow.md) | ||
- [RPS per instance](./best_practices/rps-per-instance.md) | ||
- [Shared client](best_practices/shared-client.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,48 @@ | ||
[Home](../../index.md) | ||
|
||
--- | ||
|
||
# Discard Overflow | ||
|
||
When you specify a [load profile](../load-profile.md), the generator calculates the order and timing of requests. This | ||
can be referred to as the schedule of requests execution. Pandora's scheduler is responsible for this. It receives | ||
requests from the provider and according to this schedule, passes them to the instances. Each instance then executes the | ||
requests sequentially. | ||
|
||
There may be situations where the scheduler believes it's time to execute the next request, but all instances are busy | ||
waiting for their current requests to complete. In this case, the scheduler can proceed in one of two ways: | ||
|
||
1. Wait until an instance becomes available and then pass the request to it later than scheduled. | ||
2. Discard this request and wait for the next one, anticipating that by the time the next request is due, one of the | ||
instances will have become available. | ||
|
||
The instance setting `discard_overflow` determines which behavior to follow. | ||
|
||
1. `discard_overflow: false` - Flexible schedule adherence. The generator ensures that all planned requests are sent. | ||
The test duration depends on the performance of the service being tested, average response time, and the number of | ||
instances. | ||
2. `discard_overflow: true` - Strict adherence to the request schedule by the generator. Requests that do not fit into | ||
the schedule are discarded. The test duration is predetermined. Requests that fail to meet the schedule are marked as | ||
failed (with a net error `777`, and also tagged as discarded). | ||
|
||
By default, starting from version [email protected], the setting `discard_overflow: true` is enabled. | ||
|
||
## A Bit of Theory | ||
|
||
When might the situation arise that forces the scheduler to choose the `discard_overflow` behavior? As mentioned | ||
earlier, this occurs when it's time to execute a request, but there are no free instances available to process it. Why | ||
can this happen? This typically occurs when the server's response time is high and the combination of the number of | ||
instances and the load profile is not optimally selected. This is when `V > N * 1/rps`, where: | ||
|
||
- `V` is the response time of the server being tested (in seconds). | ||
- `N` is the number of instances. | ||
|
||
To avoid such situations, you can: | ||
|
||
- Increase the number of instances. | ||
- Decrease the load profile. | ||
- Optimize the server being tested to reduce response time. | ||
|
||
--- | ||
|
||
[Home](../../index.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
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,4 +1,5 @@ | ||
# Практики использования | ||
|
||
- [Discard Overflow](best_practices/discard-overflow.md) | ||
- [RPS на инстанс](best_practices/rps-per-instance.md) | ||
- [Общий транспорт](best_practices/shared-client.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,47 @@ | ||
[Домой](../index.md) | ||
|
||
--- | ||
|
||
# Discard overflow | ||
|
||
Когда вы указываете [профиль нагрузки](../load-profile.md) генератор рассчитывает порядок и время выполнения запросов. | ||
Можно назвать это расписанием выполнения запросов. За это отвечает планировщик Пандоры. Он получает запросы от | ||
провайдера и по этому рассписанию передает инстансам. А каждый инстанс выполняет запросы последовательно. | ||
|
||
Может возникнуть ситуация, когда планировщик считает, что наступило время выполнить следующий запрос, но все инстансы | ||
заняты ожиданием выполнения своего текущего запроса. В этом случае планировщик может поступать одним из 2-х способов. | ||
|
||
1. Дождаться, когда освободится какой-либо инстанс и передать запрос ему позже расписания | ||
2. Отбросить этот запрос и ожидать следующий, рассчитывая на то, что когда наступит время следующего запроса, уже | ||
освободится один из инстансов. | ||
|
||
За то, какому поведению следовать, отвечает настройка инстанса `discard_overflow` | ||
|
||
1. `discard_overflow: false` - нестрогое следование расписанию. Генератор гарантирует, что все запланированные запросы | ||
будут отправлены. Время выполнения теста зависит от производительности тестируемого сервиса, среднего времени ответа | ||
и количества инстансов. | ||
2. `discard_overflow: true` - строгое следование генератором расписания запросов. Запросы, не уложившиеся | ||
в расписание, отбрасываются. Время выполнения теста предопределено. Запросы, которые не укладываются в расписание, | ||
помечаются неудавшимися (ошибка net `777`, а так же добавляется tag:discarded). | ||
|
||
По-умолчанию, начиная с версии [email protected] настройка `discard_overflow: true` | ||
|
||
## Немного теории | ||
|
||
Когда может возникнуть ситуация, в которой планировщику придется выбрать поведение discard_overflow? Как было сказано | ||
выше, когда наступает время выполнения запроса, но нет свободных инстансов, которые этот запрос могут выполнить. | ||
Почему это может происходить? Когда время ответа от сервера высоко и комбинация кол-во инстансов и профиль нагрузки | ||
выбраны не оптимально. То есть когда `V > N * 1/rps`, где | ||
|
||
- `V` - время ответа нагружаемого сервера (в секундах) | ||
- `N` - кол-во инстансов | ||
|
||
Таким образом, чтобы избежать такой ситуации можно | ||
|
||
- увеличить кол-во инстансов | ||
- уменьшить профиль нагрузки | ||
- оптимизировать нагружаемый сервис, для уменьшения времени ответа | ||
|
||
--- | ||
|
||
[Домой](../index.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
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,5 +1,5 @@ | ||
pools: | ||
- id: "" | ||
- id: "http pool" | ||
ammo: | ||
file: testdata/http/payload.uri | ||
type: uri | ||
|
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,5 +1,5 @@ | ||
pools: | ||
- id: "" | ||
- id: "http2 pool" | ||
ammo: | ||
file: testdata/http/payload.uri | ||
type: uri | ||
|