You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: pipeline/filters/throttle.md
+21-21Lines changed: 21 additions & 21 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,17 +1,17 @@
1
1
# Throttle
2
2
3
-
The _Throttle Filter_ plugin sets the average _Rate_ of messages per _Interval_, based on leaky bucket and sliding window algorithm. In case of overflood, it will leak within certain rate.
3
+
The _Throttle_ filter plugin sets the average `Rate` of messages per `Interval`, based on the leaky bucket and sliding window algorithm. In case of flooding, it will leak at a certain rate.
4
4
5
-
## Configuration Parameters
5
+
## Configuration parameters
6
6
7
7
The plugin supports the following configuration parameters:
8
8
9
9
| Key | Value Format | Description |
10
10
| :--- | :--- | :--- |
11
-
| Rate | Integer | Amount of messages for the time. |
12
-
| Window | Integer | Amount of intervals to calculate average over. Default 5. |
13
-
| Interval | String | Time interval, expressed in "sleep" format. e.g 3s, 1.5m, 0.5h etc|
14
-
|Print\_Status| Bool | Whether to print status messages with current rate and the limits to information logs |
11
+
|`Rate`|`Integer`| Amount of messages for the time. |
12
+
|`Window`|`Integer`| Amount of intervals to calculate average over. Default: `5`. |
13
+
|`Interval`|`String`| Time interval, expressed in `sleep` format. For example, `3s`, `1.5m`, `0.5h`.|
14
+
|`Print_Status`|`Bool`| Whether to print status messages with current rate and the limits to information logs.|
15
15
16
16
## Functional description
17
17
@@ -23,7 +23,7 @@ Window 5
23
23
Interval 1s
24
24
```
25
25
26
-
You would received 1 message in the first second, 3 messages second, and 5 third.
26
+
You would receive 1 message in the first second, 3 messages second, and 5 third.
27
27
Disregard that Window is actually 5, because the configuration uses `slow` start
28
28
to prevent flooding during the startup.
29
29
@@ -35,7 +35,7 @@ to prevent flooding during the startup.
35
35
+-----+
36
36
```
37
37
38
-
But as soon as we reached Window size \* Interval, we will have true sliding window with aggregation over complete window.
38
+
But as soon as you reach `Window size * Interval`, you will have true sliding window with aggregation over complete window.
39
39
40
40
```text
41
41
+-------------+
@@ -45,7 +45,7 @@ But as soon as we reached Window size \* Interval, we will have true sliding win
45
45
----------+
46
46
```
47
47
48
-
When we have average over window is more than Rate, we will start dropping messages, so that
48
+
When the average over window is more than `Rate`, Fluent Bit starts dropping messages, so the following:
49
49
50
50
```text
51
51
+-------------+
@@ -65,11 +65,11 @@ will become:
65
65
+---------+
66
66
```
67
67
68
-
As you can see, last pane of the window was overwritten and 1 message was dropped.
68
+
The last pane of the window was overwritten and 1 message was dropped.
69
69
70
-
### Interval vs Window size
70
+
### Interval versus Window size
71
71
72
-
You might noticed possibility to configure _Interval_of the _Window_ shift. It is counter intuitive, but there is a difference between two examples above:
72
+
You might notice it's possible to configure the `Interval`of the `Window` shift. It's counter intuitive, but there is a difference between the two previous examples:
73
73
74
74
```text
75
75
Rate 60
@@ -85,7 +85,7 @@ Window 300
85
85
Interval 1s
86
86
```
87
87
88
-
Even though both examples will allow maximum Rate of 60 messages per minute, first example may get all 60 messages within first second, and will drop all the rest for the entire minute:
88
+
Even though both examples will allow maximum `Rate` of 60 messages per minute, the first example might get all 60 messages within first second, and will drop all the rest for the entire minute:
89
89
90
90
```text
91
91
XX XX XX
@@ -97,24 +97,24 @@ XX XX XX
97
97
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
98
98
```
99
99
100
-
While the second example will not allow more than 1 message per second every second, making output rate more smooth:
100
+
While the second example won't allow more than 1 message per second every second, making output rate more smooth:
101
101
102
102
```text
103
103
X X X X X X
104
104
XXXX XXXX XXXX XXXX XXXX XXXX
105
105
+-+-+-+-+-+--+-+-+-+-+-+-+-+-+-+
106
106
```
107
107
108
-
It may drop some data if the rate is ragged. I would recommend to use bigger interval and rate for streams of rare but important events, while keep _Window_ bigger and _Interval_ small for constantly intensive inputs.
108
+
Fluent Bit might drop some data if the rate is ragged. Use bigger intervals and rates for streams of rare but important events, while keeping `Window` bigger and `Interval` smaller for constantly intensive inputs.
109
109
110
-
### Command Line
110
+
### Command line
111
111
112
-
> Note: It's suggested to use a configuration file.
112
+
It's suggested to use a configuration file.
113
113
114
-
The following command will load the _tail_ plugin and read the content of _lines.txt_ file. Then the _throttle_ filter will apply a rate limit and only _pass_ the records which are read below the certain _rate_:
114
+
The following command will load the Tail plugin and read the content of the `lines.txt` file. Then, the Throttle filter will apply a rate limit and only pass the records which are read below the `rate`:
0 commit comments