accbc39e109e10c10b8cad558977319def0aa532
[platform/core/system/resourced.git] / conf / README
1 Resourced Configurations
2 ========================
3
4 Index
5 =====
6 1. limiter.conf            : configurations to limit resources
7 2. optimizer.conf          : configurations to optimize resources
8 3. monitor.conf            : configurations to monitor resources
9 4. process.conf            : configurations to manage process
10 5. proc.conf               : configurations to specify the oom_score_adj for each app
11 6. limiter.conf.d/*.conf   : configurations to limit resources, for each app
12 7. optimizer.conf.d/*.conf : configurations to optimize resources, for each app
13 8. process.conf.d/*.conf   : configurations to manage process, for each app
14 9. vip-process.d/*.conf    : configurations to manage vip-process, for each app
15
16 File Format
17 ===========
18 Config file consists of two parts: section names and key-value pairs.
19 Section name should be located between '[' and ']'. (ex: [MemoryLevelThreshold])
20 The range of a section is: From the first appearance of section name to the EOF or the line before the next section starts
21 Example: [MemoryBackgroundLru]
22          BackgroundLruLimit=80%
23 Lines beginning with '#' are ignored.
24
25 Value Format
26 ============
27 Value format will be described as regular expression form.
28 Names enclosed with clamps(<...>) can be replaced with some value which described inside clamps.
29
30 1. limiter.conf
31 ===============
32
33 1.1 Section: MemoryBackgroundLru
34 =============================
35 Key: BackgroundLruLimit
36 Value: <limit ratio in percentage>%
37 Comment: Specify the memory cgroup BackgroundLru limit ratio in percentage.
38 Example: BackgroundLruLimit=80%
39
40 1.2 Section: MemoryLevelThreshold
41 =================================
42 Key: OomPopup
43 Value: (yes|1|ok|on|no|0|off)
44 Comment: Specify whether a popup is needed or not when the process is killed by LMK or proactive killer.
45          If (yes|1|ok|on), resoruced will request system popup when OOM occurred.
46          If (no|0|off), resoruced will not request system popup when OOM occurred.
47 Example: OomPopup=no
48
49 Key: MediumLevel
50 Value: <threshold>[GMK]B
51         or
52        <ratio>%
53 Comment: Specify the threshold or ratio for memory level medium.
54 Example: MediumLevel=400MB
55
56 Key: LowLevel
57 Value: <threshold>[GMK]B
58         or
59        <ratio>%
60 Comment: Specify the threshold or ratio for memory level low.
61 Example: LowLevel=300MB
62
63 Key: CriticalLevel
64 Value: <threshold>[GMK]B
65         or
66        <ratio>%
67 Comment: Specify the threshold or ratio for memory level critical.
68 Example: LowLevel=200MB
69
70 Key: OomLevel
71 Value: <threshold>[GMK]B
72         or
73        <ratio>%
74 Comment: Specify the threshold or ratio for memory level oom(out of memory).
75 Example: OomLevel=160MB
76
77 1.3 Section: MemoryAppTypeLimit
78 ===============================
79 Key: ServicePerAppLimitAction
80 Value: <limit>[GMK]B,<action>
81 Comment: Specify the memory limitation of services.
82          <action> specifies an action to be performed when the limit is crossed.
83          <action> can be: broadcast, reclaim, kill, ignore
84 Example: ServicePerAppLimitAction=128MB,kill
85
86 Key: WidgetPerAppLimitAction
87 Value: <limit>[GMK]B,<action>
88 Comment: Specify the memory limitation of widgets.
89          <action> specifies an action to be performed when the limit is crossed.
90          <action> can be: broadcast, reclaim, kill, ignore
91 Example: WidgetPerAppLimitAction=160MB,kill
92
93 Key: GUIPerAppLimitAction
94 Value: <limit>[GMK]B,<action>
95 Comment: Specify the memory limitation of GUIs.
96          <action> specifies an action to be performed when the limit is crossed.
97          <action> can be: broadcast, reclaim, kill, ignore
98 Example: GUIPerAppLimitAction=160MB,kill
99
100 1.4 Section: MemoryAppStatusLimit
101 =================================
102 Key: BackgroundPerAppLimitAction
103 Value: <limit>[GMK]B,<action>
104 Comment: Specify the memory limitation of background apps.
105          <action> specifies an action to be performed when the limit is crossed.
106          <action> can be: broadcast, reclaim, kill, ignore
107 Example: BackgroundPerAppLimitAction=768MB,kill
108
109 1.5 Section: MemoryLimitTrigger
110 ===============================
111 Key: MemoryLimitTrigger
112 Value: oom or threshold or others
113 Comment: Specify the type of memory limit trigger type.
114          oom: If memory usage reaches limit, then cgroup oom will handle the situation.
115          threshold: If memory usage reaches limit, then resourced will kill the target without page reclaim.
116          others: If 'MemLimit(Action)' is turned on, just set memory limit.
117 Example: MemoryLimitTrigger=oom
118
119 1.6 Section: CpuThrottling
120 ==========================
121 Key: CpuSched
122 Value: <schedule scheme>
123 Comment: Specify the schedule scheme.
124          <schedule schedule> can be: idle, other, batch, fifo, rr, deadline
125 Example: CpuSched=idle
126
127 Key: CpuNice
128 Value: <nice value>
129 Comment: Specify the nice value.
130          <nice value> is an decimal integer value. (-20 ~ 19)
131 Example: CpuNice=-20
132
133 Key: CpuShare
134 Value: <share amount>
135 Comment: Specify ratio(%) of quota cpu share(= Lowest cgroup/root cgroup * 100)
136          <share amount> is an decimal unsigned integer value.
137 Example: CpuShare=2
138
139 Key: CpuCFSRuntime
140 Value: <cpu runtime>[ mu]?s
141 Comment: Specifies cfs_quota in milliseconds(m), microseconds(u) or seconds.
142          <cpu runtime> is an decimal unsigned integer value.
143 Example: CpuCFSRuntime=50000
144
145 Key: CpuCFSPeriod
146 Value: <cpu period>[ mu]?s
147 Comment: Specifies cfs_period in milliseconds(m), microseconds(u) or seconds.
148          <cpu period> is an decimal unsigned integer value.
149 Example: CpuCFSRuntime=50000
150
151 2. optimizer.conf
152 =================
153
154 2.1 Section: MemorySwap
155 =======================
156 Key: ReclaimAtBoot
157 Value: (yes|1|ok|on|no|0|off)
158 Comment: Specify whether reclaim is needed at boot time.
159          If (yes|1|ok|on), resourced reclaims the swap at booting time.
160          If (no|0|off), no raclaim.
161 Example: ReclaimAtBoot=yes
162
163 Key: SwapType
164 Value: <swapping type>([+|]+<swapping type>)*
165 Comment: Specify the type of memory swapping.
166          <swapping type> can be: zram, file, zswap
167 Example: SwapType=zram|file
168           or
169          SwapType=zram+file
170
171 Key: BackgroundLruSwappiness=80
172 Value: <swappiness>
173 Comment: Specify memory swappiness value.
174          <swappiness> is an decimal integer value.
175          Default swappiness is 60.
176          If <swappiness> < 60, the tendency of the kernel of swapping process memory will be decreased.
177          (But 0 does not mean no swapping)
178          If <swappiness> > 60, the tendency of the kernel of swapping process memory will be increased.
179          If <swappiness> > 100, then the kernel can swap out a part of the pages in the address space in this cgroup.
180 Example: BackgroundLruSwappiness=80
181
182 2.2 Section: MemoryZram
183 =======================
184 Key: CompAlgorithm
185 Value: <algorithm>
186 Comment: Specify an algorithm for zram swap comparing algorithm.
187          <algorithm> string value will be written to "/sys/block/zram0/comp_algorithm"
188          The value for <algorithm> can be found by `cat /sys/block/zram0/comp_algorithm`, please choose one of them.
189 Example: CompAlgorithm=zstd
190
191 Key: ZramRatio
192 Value: <ratio>
193 Comment: Specify the ratio of zram swap size. (ratio in total ram)
194          <ratio> is an float value, 0 to 1.
195 Example: ZramRatio=0.4
196
197 2.3 Section: MemoryZswap
198 ========================
199 Key: PoolRatio
200 Value: <ratio>
201 Comment: Specify the max ratio which the zswap pool can use. (/sys/module/zswap/parameters/max_pool_percent)
202          <ratio> is a percentage value.
203 Example: PoolRatio=25
204
205 Key: PoolType
206 Value: <type>
207 Comment: Specify the type of zswap pool. (/sys/module/zswap/parameters/zpool)
208          <type> is a string value of zswap pool type name.
209          (zbud, z3fold ...)
210
211 Example: PoolType=z3fold
212
213 2.4 Section: MemoryDedup
214 ========================
215 Key: DedupAtBoot
216 Value: (yes|1|ok|on|no|0|off)
217 Comment: Dedup removes duplication on memory.
218          Specify whether dedup is needed at boot time
219          If (yes|1|ok|on), dedup will be activated at boot time.
220          If (no|0|off), no dedup at boot time.
221 Example: DedupAtBoot=yes
222
223 Key: ScanOnLowmem
224 Value: (yes|1|ok|on|no|0|off)
225 Comment: Specify whether scanning for dedup is invoked by low memory event or periodic timer.
226          If (yes|1|ok|on), dedup is on.
227          If (no|0|off), no dedup.
228 Example: ScanOnLowmem=yes
229
230 2.5 Section: MemoryKsm
231 ======================
232 Key: KsmMode
233 Value: <mode>
234 Comment: Specify KSM(Kernsl Same-page Merging, dedup) mode.
235          <mode> can be: oneshot, periodic
236          oneshot: The KSM daemon only performs deduplication.
237          periodic: The kernel manages all behaviors of deduplication.
238 Example: KsmMode=periodic
239
240 Key: PagesToScan
241 Value: <pages>
242 Comment: Specify the number of pages to scan for deduplication.
243          <pages> is an decimal integer value.
244 Example: PagesToScan=100
245
246 Key: PagesToScanWithBoost
247 Value: <pages>
248 Comment: Specify the number of pages to scan for boosting partial scan.
249          This value is normally larger than "PagesToScan" value.
250          <pages> is an decimal integer value.
251 Example: PagesToScanWithBoost=1000
252
253 2.6 Section: MemoryCompaction
254 =============================
255 Key: FragLevel
256 Value: <level>
257 Comment: Specify external fragmentation size of the kernel zone.
258          It determines when to trigger compaction.
259          <level> is an decimal integer value.
260          800 means 80%.
261 Example: FragLevel=800
262
263 2.7 Section: MemoryBackgroundReclaim
264 =============================
265 Key: AfterScreenDim
266 Value: (yes|1|ok|on|no|0|off)
267 Comment: Specify whether memory is reclaimed
268          from most recently used background app.
269          If value is (yes|1|ok|on), background reclaim on.
270          If value is (no|0|off), background reclaim off.
271 Example: AfterScreenDim=yes
272
273 2.8 Section: CpuSched
274 =====================
275 Key: CpuSchedFeature
276 Value: <feature>([,]+<feature>)*
277 Comment: Specify cpu scheduling features.
278          <feature> can be: rt_runtime_share, no_rt_runtime_share
279          Multiple values can be used by separating them into ','.
280 Example: CpuSchedFeature=no_rt_runtime_share
281
282 Key: CpuRTRuntime
283 Value: <cpu rt runtime>[ mu]?s
284 Comment: Specify cpu rt runtime in milliseconds(m), microseconds(u) or seconds.
285          <cpu rt runtime> is an decimal integer value.
286 Example: CpuRTRuntime=900ms
287
288 Key: CpuRTPeriod
289 Value: <cpu rt period>[ mu]?s
290 Comment: Specify cpu rt period in milliseconds(m), microseconds(u) or seconds.
291          <cpu rt period> is an decimal integer value.
292 Example: CpuRTRuntime=900ms
293
294 2.9 Section: CpuAffinity
295 ========================
296 Key: ForegroundApps
297 Value: (<core num>|<core range>)(,(<core num>|<core range>))*
298 Comment: Specify the cpu affinity of each core
299          <core num> is an decimal integer
300          <core range> is: <core num>-<core num>
301 Example: ForegroundApps=1,2,3-5
302
303 2.10 Section: CpuBoostingLevelStrong
304 ===================================
305 Key: CpuSched
306 Value: <schedule scheme>
307 Comment: Specify the schedule scheme when the cpu boosting level is "strong".
308          <schedule schedule> can be: idle, other, batch, fifo, rr, deadline
309 Example: CpuSched=rr
310
311 Key: CpuNice
312 Value: <nice value>
313 Comment: Specify the nice value when the cpu boosting level is "strong".
314          <nice value> is an decimal integer value. (-20 ~ 19)
315 Example: CpuNice=-20
316
317 Key: CpuRTPriority
318 Value: <priority>
319 Comment: Specify the cpu rt priority when the cpu boosting level is "strong".
320          <priority> is an decimal integer value.
321 Example: CpuRTPriority=50
322
323 2.11 Section: CpuBoostingLevelMedium
324 ====================================
325 Key: CpuSched
326 Value: <schedule scheme>
327 Comment: Specify the schedule scheme when the cpu boosting level is "medium".
328          <schedule schedule> can be: idle, other, batch, fifo, rr, deadline
329 Example: CpuSched=rr
330
331 Key: CpuNice
332 Value: <nice value>
333 Comment: Specify the nice value when the cpu boosting level is "medium".
334          <nice value> is an decimal integer value. (-20 ~ 19)
335 Example: CpuNice=-20
336
337 Key: CpuRTPriority
338 Value: <priority>
339 Comment: Specify the cpu rt priority when the cpu boosting level is "medium".
340          <priority> is an decimal integer value.
341 Example: CpuRTPriority=50
342
343 2.12 Section: CpuBoostingLevelWeak
344 ==================================
345 Key: CpuSched
346 Value: <schedule scheme>
347 Comment: Specify the schedule scheme when the cpu boosting level is "weak".
348          <schedule schedule> can be: idle, other, batch, fifo, rr, deadline
349 Example: CpuSched=rr
350
351 Key: CpuNice
352 Value: <nice value>
353 Comment: Specify the nice value when the cpu boosting level is "weak".
354          <nice value> is an decimal integer value. (-20 ~ 19)
355 Example: CpuNice=-20
356
357 Key: CpuRTPriority
358 Value: <priority>
359 Comment: Specify the cpu rt priority when the cpu boosting level is "weak".
360          <priority> is an decimal integer value.
361 Example: CpuRTPriority=50
362
363 3. monitor.conf
364 ===============
365
366 3.1 HEART
367 =========
368 Key: <device module name>
369 Value: (ON|OFF)
370 Comment: Specify logging is ON or OFF.
371          <device module name> can be: ABNORMAL, BATTERY, CPU, MEMORY, STORAGE
372          If value is ON, then logging for <device module name> is on.
373          else no logging for this module.
374 Example: BATTERY=ON
375
376 3.2 BATTERY_POWER_MODE
377 ======================
378 Key: POWER_NORMAL_MODE
379 Value: <power>
380 Comment: Specify power for normal mode.
381          <power> is an integer value.
382 Example: POWER_NORMAL_MODE=676
383
384 Key: POWER_SAVING_MODE
385 Value: <power>
386 Comment: Specify power for saving mode.
387          <power> is an integer value.
388 Example: POWER_SAVING_MODE=750
389
390 Key: ULTRA_SAVING_MODE
391 Value: <power>
392 Comment: Specify power for ultra saving mode.
393          <power> is an integer value.
394 Example: ULTRA_SAVING_MODE=1947
395
396 3.3 BATTERY_<capacity>
397 ======================
398 Key: LOGIC_V2
399 Value: (0|1)
400 Comment: Specify whether logic_v2 is suppoted or not.
401 Example: LOGIC_V2=1
402
403 Key: LOGIC_RUL
404 Value: (0|1)
405 Comment: Specify whether remaining usefull life (RUL) prediction logic is supported or not.
406 Example: LOGIC_RUL=1
407
408 Key: BATTERY_CAPACITY
409 Value: <capacity>
410 Comment: Specify the capacity of the battery.
411 Example: BATTERY_CAPACITY=12000
412
413 Key: DISCHARGE_FAST
414 Value: <time>
415 Comment: Specify the total time(min) taken when the device is discharging at fastest rate.
416          <time> is an integer value.
417 Example: DISCHARGE_FAST=700
418
419 Key: DISCHARGE_SLOW
420 Value: <time>
421 Comment: Specify the total time(min) taken when the device is discharging at slowest rate.
422          <time> is an integer value.
423 Example: DISCHARGE_SLOW=12000
424
425 Key: AVERAGE_PWR
426 Value: <avg_pwr>
427 Comment: Specify the avarage power consumed in UPS mode.
428          <avg_pwr> is a float value.
429 Example: AVERAGE_PWR=35.0
430
431 Key: OCV_SOC_POLY_COEF
432 Value: <ocv degree(n)> <coef 1> ... <coef n>
433 Comment: Specify coefficients of polynomial expression for OCV, SOC.
434 Example: OCV_SOC_POLY_COEF=6 3402.664 42.031 -1.76745 0.034798 -0.00030516 0.0000010116
435
436 4. process.conf
437 ===============
438
439 4.1 APPUSAGE
440 ============
441 Key: APPUSAGE
442 Value: (ON|OFF)
443 Comment: Specify whether favorite apps table is required or not.
444          Favorite apps will be specified in "PREDEFINED" (see below)
445 Example: APPUSAGE=ON
446
447 Key: PREDEFINED
448 Value: <app name>
449 Comment: Specify favorite apps.
450          <app name> will be added to favorite apps table.
451 Example: PREDEFINED=app1
452
453 4.2 BLOCK
454 =========
455 Key: activate
456 Value: (TRUE|FALSE)
457 Comment: Specify whether the monitoring for home directory of users is required or not
458          If TRUE, monitoring on.
459          else, no monitoring.
460 Example: activate=TRUE
461
462 Key: mode
463 Value: (ACCESS|READ|WRITE|DISABLE)
464 Comment: Specify monitoring mode.
465 Example: mode=WRITE
466
467 Key: include
468 Value: <pkgname>
469 Comment: Specify included package name.
470 Example: include=DOWNLOADABLE
471
472 Key: exclude
473 Value: <pkgname>
474 Comment: Specify excluded package name.
475 Example: excluded=SLP_debug
476
477 Key: logging
478 Value: <type>
479 Comment: Specify logging type.
480          <type> is a flag value, including: DLOG(0x1), FILE(0x2), DB(0x4).
481          If DLOG and DB type, then <type> is 5 (0x01 | 0x04).
482 Example: logging=5
483
484 5. limiter.conf.d/*.conf
485 ========================
486
487 5.1 Section: Private
488 ====================
489 Key: App|Service|SERVICE|Process|PROCESS
490 Value: <name>
491 Comment: Specify the name of app/service/process.
492          One per one Private section.
493 Example: Service=dbus.service
494 Example: App=org.tizen.<app>
495
496 Key: MemLimitAction
497 Value: <limit>[GMK]B,<action>
498 Comment: Specify the memory limitation of this app/service/process.
499          <action> specifies an action to be performed when the limit is crossed.
500          <action> can be: broadcast, reclaim, kill, ignore
501 Example: MemLimitAction=4096KB,kill
502
503 Key: MemoryBackgroundLru
504 Value: (yes|1|ok|on|no|0|off)
505 Comment: Specify whether put the process or service
506          in BackgroundLru memory cgroup.
507          If (yes|1|ok|on), put the process or service in BackgroundLru.
508          If (no|0|off), do not put the process or service in BackgroundLru.
509 Example: MemoryBackgroundLru=yes
510
511 Key: CpuThrottling
512 Value: (yes|1|ok|on|no|0|off)
513 Comment: Specify whether the cpu throttling is enabled.
514          If (yes|1|ok|on), enable cpu throttling.
515          If (no|0|off), disable cpu throttling.
516 Example: CpuThrottling=yes
517
518 Key: LmkKillException
519 Value: (yes|1|ok|on|no|0|off)
520 Comment: Specify whether the corresponding process is excluded from LMK victim list.
521          If (yes|1|ok|on), the process is removed from the list.
522          If (no|0|off), the process is not removed from the list.
523          Only app is supported, but service and process are not supported.
524          (system services with System, System::Privileged, and User attrs are
525          already removed from the list in LMK)
526 Example: LmkKillException=yes
527
528 6. optimizer.conf.d/*.conf
529 ==========================
530
531 6.1 Section: Private
532 ====================
533 Key: App|Service|SERVICE|Process|PROCESS
534 Value: <name>
535 Comment: Specify the name of app/service/process.
536          One per one Private section.
537 Example: Service=dbus.service
538 Example: App=org.tizen.<app>
539
540 Key: CpuSched
541 Value: <schedule scheme>
542 Comment: Specify the schedule scheme.
543          <schedule schedule> can be: idle, other, batch, fifo, rr, deadline
544 Example: CpuSched=idle
545
546 Key: CpuNice
547 Value: <nice value>
548 Comment: Specify the nice value.
549          <nice value> is an decimal integer value. (-20 ~ 19)
550 Example: CpuNice=-20
551
552 Key: CpuRTPriority
553 Value: <priority>
554 Comment: Specify the cpu rt priority.
555          <priority> is an decimal integer value.
556 Example: CpuRTPriority=50
557
558 Key: CpuBoostingLevel
559 Value: (strong|medium|weak)
560 Comment: Specify the boosting level of this app/service/process.
561 Example: CpuBoostingLevel=medium
562
563 Key: CpuAffinity
564 Value: (cpu id|min cpu id-max cpu id|cpu_id,cpu_id)
565 Comment: Specify the cpu affinity of this app
566 Example: CpuAffinity=1,3-5,8
567
568 7. process.conf.d/*.conf
569 ========================
570
571 7.1 Section: Private
572 ====================
573 Key: App|Service|SERVICE|Process|PROCESS
574 Value: <name>
575 Comment: Specify the name of app/service/process.
576          One per one Private section.
577 Example: Service=dbus.service
578 Example: App=org.tizen.<app>
579
580 Key: ActionOnFailure
581 Value: <action>
582 Comment: Specify an action on failure.
583          <action> can be: reboot
584 Example: ActionOnFailure=reboot
585
586 Key: WatchdogAction
587 Value: <action>
588 Comment: Specify an action for watchdog.
589          <action> can be: ignore, kill
590 Example: WatchdogAction=ignore
591
592 Key: OomScore
593 Value: <oom_score_adj>
594 Comment: Specify the oom_score_adj.
595          oom_score_adj is an integer value between -900 to 250.
596          Predefined values cannot be used.
597          Predefined values are: -900, 0, 100, 150, 200, 230, 250
598          (Please refer to procfs.h)
599 Example: OomScore=125
600
601 8. vip-process.d/*.conf
602 =======================
603
604 8.1 Section: Private|VIP_GROUP
605 ==============================
606 Key: App|Service|SERVICE|Process|PROCESS
607 Value: <name>
608 Comment: Specify the name of app/service/process.
609          One per one Private section.
610 Example: Service=dbus.service
611 Example: App=org.tizen.<app>
612
613 Key: ACTION_ON_FAILURE
614 Value: <action>
615 Comment: Specify an action on failure.
616          <action> can be: reboot
617 Example: ACTION_ON_FAILURE=reboot