2 # The file path to which QoS writes its limiting file.
3 # Should be inside "dynamic_config_path",
4 # but outside is also allowed (eg. for debugging)
5 # Comment the line out (or leave empty) to disable QoS
6 #qos_file_path=/run/dlog/filters.d/42-qos.conf
9 # This is the timeframe during which logs are considered. After
10 # each period of this length, all clients get their limits reset,
11 # so that they can start logging again if they were limited.
14 # This is how many logs are allowed overall from all programs over
15 # each time frame. QoS module tries to limit it to this value, but
16 # the real amount can be slightly higher. Use 0 to disable QoS.
17 qos_max_throughput_logs=50
19 # After this many logs arrive in a single time frame, the QoS
20 # module enforces a limit. This is so that even if a single
21 # program spends most of the limit, other programs will still
22 # have some space left to allocate. Use 0 to disable QoS.
25 # After this many logs, limits are updated (for example, if
26 # the default is 40 and reapply is 5, then it will update at
27 # 40, 45, 50 (and 55, 60... if more logs slip through). This
28 # is mostly important for new programs who will usually be
29 # able to write this many logs even if max is already reached.
30 qos_threshold_reapply_logs=5
32 # How the limit is distributed.
33 # "proportional_raw" : max limit is distributed by how much
34 # each clients used up their limits.
35 # For example if there are 4 clients, and they sent
36 # 4/8/12/16 logs respectively (reaching threshold 40)
37 # their limits will be 20/40/60/80 (if max is 200).
40 # Here's a hydraulic interpretation (think of the limits as of water filling
41 # connected containers):
52 # │▒▒▒│ │▒▒▒▒▒│ │▒│ │▒▒▒▒▒▒▒│
53 # │▒▒▒│ │▒▒▒▒▒│ │▒│ │▒▒▒▒▒▒▒│
54 # └─╥─┘ └──╥──┘ └╥┘ └───╥───┘
55 # ╚══════════════╩═══════════════╩══════════════╝
57 # 8/40 12/60 4/20 16/80
60 # "equal" : max limit is distributed equally.
61 # For example if there are 4 clients, and they sent
62 # 1/17/42/66 logs respectively, their limits will
63 # be 50/50/50/50 (if max is 200).
70 # 50 (= 200 / 4)_____________▒▒▒▒▒________________________________
80 # ▒▒▒▒▒ ▒▒▒▒▒ ▒▒▒▒▒ ▒▒▒▒▒
86 # "equal_dual" : any client under the "equal" limit
87 # can log freely, any remaining throughput is
88 # distributed equally among the rest
89 # For example if there are 3 clients, and they sent
90 # 20/85/120 logs (max throughput 200), they will get
91 # --/90/90 limits respectively: 20 < 67, remaining 180
100 # 90 (= (200 - 20) / 2)______________________▒▒▒▒▒___
105 # 67 (= 200 / 3)_______ ▒▒▒▒▒ ▒▒▒▒▒
124 # "equal_multi" (default) : similar to the above, but any client
125 # not reaching its limit is also unlimited, increasing it.
126 # For example if there are 3 clients, and they sent
127 # 20/85/120 logs (max throughput 200), they will get
128 # --/--/95 limits respectively: 20 < 67, but then the
129 # remaining average becomes 90 (like in dual) and 85 < 90,
130 # and finally average becomes 95 ((200 - 20 - 85) / 1) and 120 > 95,
131 # so it stays at this level.
134 # Here's a hydraulic interpretation:
141 # 95 (= (200 - 20 - 85) / 1)________________│ │__
142 # 90 (= (200 - 20) / 2)________________ │▒▒▒▒▒│
147 # 67 (= 200 / 3)________ │▒▒▒▒▒│ │▒▒▒▒▒│
156 # -20- ┌─────┐ │▒▒▒▒▒│ │▒▒▒▒▒│
157 # │▒▒▒▒▒│ │▒▒▒▒▒│ │▒▒▒▒▒│
158 # │▒▒▒▒▒│ │▒▒▒▒▒│ │▒▒▒▒▒│
159 # │▒▒▒▒▒│ │▒▒▒▒▒│ │▒▒▒▒▒│
160 # -0- │▒▒▒▒▒│ │▒▒▒▒▒│ │▒▒▒▒▒│
161 # └──╥──┘ └──╥──┘ └──╥──┘
162 # ╚═══════════════╩═══════════════╝
166 # "proportional_talmud" : Talmudic contested garment rule.
167 # It interpolates between equal shares and equal dropped
168 # logs depending on throughput (it's complicated so I
169 # would recommend googling). Some classic examples:
170 # 100/200/300 logs, max throughput 100: 33/ 33/ 33
171 # 100/200/300 logs, max throughput 200: 50/ 75/ 75
172 # 100/200/300 logs, max throughput 300: 50/100/150
173 # 100/200/300 logs, max throughput 400: 50/125/225
174 # 100/200/300 logs, max throughput 500: 67/167/267
177 # Here's a hydraulic interpretation:
180 # -300- ┌─────┐ ┌─────┐ ┌─────┐
184 # │▓▓▓▓▓│ │▓▓▓▓▓│ │▓▓▓▓▓│<- when adding 150 more to the
185 # -250- └──╥──┘ │▓▓▓▓▓│ │▓▓▓▓▓│ previous total of 350, the
186 # ║ │▓▓▓▓▓│ │▓▓▓▓▓│ levels turn out to be
187 # ║ │▓▓▓▓▓│ │▓▓▓▓▓│ 67, 167, 267
190 # -200- ║ └──╥──┘ │▒▒▒▒▒│<- when adding 150 more to the
191 # ║ ║ │▒▒▒▒▒│ previous total of 200, most
192 # ║ ║ │▒▒▒▒▒│ of it goes to the third one
193 # ║ ║ │▒▒▒▒▒│ with the highest limit, for
194 # ║ ║ │▒▒▒▒▒│ levels of 50, 100 and 200
200 # -100- ║ ┌──╨──┐ │▒▒▒▒▒│
203 # ║ │░░░░░│ │░░░░░│<- at 200 total, the levels
204 # ║ │░░░░░│ │░░░░░│ turn out to be 50, 75 and 75
205 # -50- ┌──╨──┐ │░░░░░│ │░░░░░│
206 # │░░░░░│ │░░░░░│ │░░░░░│
207 # │░░░░░│ │░░░░░│ │░░░░░│
208 # │░░░░░│ │░░░░░│ │░░░░░│
209 # │░░░░░│ │░░░░░│ │░░░░░│
210 # -0- └──╥──┘ └──╥──┘ └──╥──┘
211 # ╚═══════════════╩═══════════════╝
215 qos_method=equal_multi