Fix how %m behaves in the log format
[platform/core/system/dlog.git] / configs / 15-qos.conf
1
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
7 qos_file_path=
8
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.
12 qos_refresh_rate_s=5
13
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
18
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.
23 qos_threshold_logs=40
24
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
31
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).
38 #
39 #
40 # Here's a hydraulic interpretation (think of the limits as of water filling
41 # connected containers):
42 #
43 #            ┌   ┐         ┌     ┐           ┌ ┐         ┌       ┐
44 #            │   │         │     │           │ │         │       │
45 #            │   │         │     │           │ │         │       │
46 #            │   │         │     │           │ │         │       │
47 #            │   │         │     │           │ │         │       │
48 #            │   │         │     │           │ │         │       │
49 #            │   │         │     │           │ │         │       │
50 #            │   │         │     │           │ │         │       │
51 #            │   │         │     │           │ │         │       │
52 #            │▒▒▒│         │▒▒▒▒▒│           │▒│         │▒▒▒▒▒▒▒│
53 #            │▒▒▒│         │▒▒▒▒▒│           │▒│         │▒▒▒▒▒▒▒│
54 #            └─╥─┘         └──╥──┘           └╥┘         └───╥───┘
55 #              ╚══════════════╩═══════════════╩══════════════╝
56 #
57 #             8/40          12/60            4/20          16/80
58 #
59 #
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).
64 #
65 #
66 #
67 #
68 #                            ▒▒▒▒▒
69 #                            ▒▒▒▒▒
70 # 50 (= 200 / 4)_____________▒▒▒▒▒________________________________
71 #                            ▒▒▒▒▒
72 #                            ▒▒▒▒▒
73 #                            ▒▒▒▒▒                           ▒▒▒▒▒
74 #                            ▒▒▒▒▒                           ▒▒▒▒▒
75 #                            ▒▒▒▒▒                           ▒▒▒▒▒
76 #                            ▒▒▒▒▒                           ▒▒▒▒▒
77 #                            ▒▒▒▒▒           ▒▒▒▒▒           ▒▒▒▒▒
78 #                            ▒▒▒▒▒           ▒▒▒▒▒           ▒▒▒▒▒
79 #                            ▒▒▒▒▒           ▒▒▒▒▒           ▒▒▒▒▒
80 #            ▒▒▒▒▒           ▒▒▒▒▒           ▒▒▒▒▒           ▒▒▒▒▒
81 #              1              66               17             42
82 #
83 #
84 #
85 #
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
92 #               gets split equally
93 #
94 #
95 #                                            ▒▒▒▒▒
96 #                                            ▒▒▒▒▒
97 #                                            ▒▒▒▒▒
98 #                                            ▒▒▒▒▒
99 #                                            ▒▒▒▒▒
100 # 90 (= (200 - 20) / 2)______________________▒▒▒▒▒___
101 #                                            ▒▒▒▒▒
102 #                            ▒▒▒▒▒           ▒▒▒▒▒
103 #                            ▒▒▒▒▒           ▒▒▒▒▒
104 #                            ▒▒▒▒▒           ▒▒▒▒▒
105 # 67 (= 200 / 3)_______      ▒▒▒▒▒           ▒▒▒▒▒
106 #                            ▒▒▒▒▒           ▒▒▒▒▒
107 #                            ▒▒▒▒▒           ▒▒▒▒▒
108 #                            ▒▒▒▒▒           ▒▒▒▒▒
109 #                            ▒▒▒▒▒           ▒▒▒▒▒
110 #                            ▒▒▒▒▒           ▒▒▒▒▒
111 #                            ▒▒▒▒▒           ▒▒▒▒▒
112 #                            ▒▒▒▒▒           ▒▒▒▒▒
113 #                            ▒▒▒▒▒           ▒▒▒▒▒
114 #                            ▒▒▒▒▒           ▒▒▒▒▒
115 #            ▒▒▒▒▒           ▒▒▒▒▒           ▒▒▒▒▒
116 #            ▒▒▒▒▒           ▒▒▒▒▒           ▒▒▒▒▒
117 #            ▒▒▒▒▒           ▒▒▒▒▒           ▒▒▒▒▒
118 #            ▒▒▒▒▒           ▒▒▒▒▒           ▒▒▒▒▒
119 #             20              85             120
120 #
121 #
122 #
123 #
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.
132 #
133 #
134 # Here's a hydraulic interpretation:
135 #
136 #                                           ┌─────┐
137 #                                           │     │
138 #                                           │     │
139 #                                           │     │
140 #                                           │     │
141 # 95 (= (200 - 20 - 85) / 1)________________│     │__
142 # 90 (= (200 - 20) / 2)________________     │▒▒▒▒▒│
143 #                           ┌─────┐         │▒▒▒▒▒│
144 #                           │▒▒▒▒▒│         │▒▒▒▒▒│
145 #                           │▒▒▒▒▒│         │▒▒▒▒▒│
146 #                           │▒▒▒▒▒│         │▒▒▒▒▒│
147 # 67 (= 200 / 3)________    │▒▒▒▒▒│         │▒▒▒▒▒│
148 #                           │▒▒▒▒▒│         │▒▒▒▒▒│
149 #                           │▒▒▒▒▒│         │▒▒▒▒▒│
150 #                           │▒▒▒▒▒│         │▒▒▒▒▒│
151 #                           │▒▒▒▒▒│         │▒▒▒▒▒│
152 #                           │▒▒▒▒▒│         │▒▒▒▒▒│
153 #                           │▒▒▒▒▒│         │▒▒▒▒▒│
154 #                           │▒▒▒▒▒│         │▒▒▒▒▒│
155 #                           │▒▒▒▒▒│         │▒▒▒▒▒│
156 # -20-      ┌─────┐         │▒▒▒▒▒│         │▒▒▒▒▒│
157 #           │▒▒▒▒▒│         │▒▒▒▒▒│         │▒▒▒▒▒│
158 #           │▒▒▒▒▒│         │▒▒▒▒▒│         │▒▒▒▒▒│
159 #           │▒▒▒▒▒│         │▒▒▒▒▒│         │▒▒▒▒▒│
160 # -0-       │▒▒▒▒▒│         │▒▒▒▒▒│         │▒▒▒▒▒│
161 #           └──╥──┘         └──╥──┘         └──╥──┘
162 #              ╚═══════════════╩═══════════════╝
163 #             20              85              120
164 #
165 #
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
175 #
176 #
177 # Here's a hydraulic interpretation:
178 #
179 #
180 # -300-     ┌─────┐         ┌─────┐         ┌─────┐
181 #           │     │         │     │         │     │
182 #           │     │         │     │         │     │
183 #           │     │         │     │         │     │
184 #           │▓▓▓▓▓│         │▓▓▓▓▓│         │▓▓▓▓▓│<- when adding 150 more to the
185 # -250-     └──╥──┘         │▓▓▓▓▓│         │▓▓▓▓▓│   previous total of 350, the
186 #              ║            │▓▓▓▓▓│         │▓▓▓▓▓│   levels turn out to be
187 #              ║            │▓▓▓▓▓│         │▓▓▓▓▓│   67, 167, 267
188 #              ║            │▓▓▓▓▓│         │▓▓▓▓▓│
189 #              ║            │▓▓▓▓▓│         │▓▓▓▓▓│
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
195 # -150-        ║               ║            │▒▒▒▒▒│
196 #              ║               ║            │▒▒▒▒▒│
197 #              ║               ║            │▒▒▒▒▒│
198 #              ║               ║            │▒▒▒▒▒│
199 #              ║               ║            │▒▒▒▒▒│
200 # -100-        ║            ┌──╨──┐         │▒▒▒▒▒│
201 #              ║            │▒▒▒▒▒│         │▒▒▒▒▒│
202 #              ║            │▒▒▒▒▒│         │▒▒▒▒▒│
203 #              ║            │░░░░░│         │░░░░░│<- at 200 total, the levels
204 #              ║            │░░░░░│         │░░░░░│   turn out to be 50, 75 and 75
205 # -50-      ┌──╨──┐         │░░░░░│         │░░░░░│
206 #           │░░░░░│         │░░░░░│         │░░░░░│
207 #           │░░░░░│         │░░░░░│         │░░░░░│
208 #           │░░░░░│         │░░░░░│         │░░░░░│
209 #           │░░░░░│         │░░░░░│         │░░░░░│
210 # -0-       └──╥──┘         └──╥──┘         └──╥──┘
211 #              ╚═══════════════╩═══════════════╝
212 #
213 #
214 #
215 qos_method=equal_multi
216