minor fixes

This commit is contained in:
Alexey Avramov 2019-01-11 15:15:34 +09:00
parent f48ce59382
commit fbc76b3947
3 changed files with 18 additions and 37 deletions

26
nohang
View File

@ -1319,8 +1319,7 @@ else:
if print_config:
print(
'\n1. Memory levels to respond to as an OOM threat\n[displaying these options need fix]\n')
print('\n1. Memory levels to respond to as an OOM threat\n[displaying these options need fix]\n')
print('mem_min_sigterm: {} MiB, {} %'.format(
round(mem_min_sigterm_mb), round(mem_min_sigterm_percent, 1)))
@ -1355,28 +1354,7 @@ if print_config:
print('\n4. Impact on the badness of processes via matching their'
' names, cmdlines ir UIDs with regular expressions\n')
print('regex_matching: {}'.format(regex_matching))
if regex_matching:
print('prefer_regex: {}'.format(prefer_regex))
print('prefer_factor: {}'.format(prefer_factor))
print('avoid_regex: {}'.format(avoid_regex))
print('avoid_factor: {}'.format(avoid_factor))
print()
print('re_match_cmdline: {}'.format(re_match_cmdline))
if re_match_cmdline:
print('prefer_re_cmdline: {}'.format(prefer_re_cmdline))
print('prefer_cmd_factor: {}'.format(prefer_cmd_factor))
print('avoid_re_cmdline: {}'.format(avoid_re_cmdline))
print('avoid_cmd_factor: {}'.format(avoid_cmd_factor))
print()
print('re_match_uid: {}'.format(re_match_uid))
if re_match_uid:
print('prefer_re_uid: {}'.format(prefer_re_uid))
print('prefer_uid_factor: {}'.format(prefer_uid_factor))
print('avoid_re_uid: {}'.format(avoid_re_uid))
print('avoid_uid_factor: {}'.format(avoid_uid_factor))
print('(todo)')
print('\n5. The execution of a specific command instead of sending the\nSIGTERM signal\n')
print('execute_the_command: {}'.format(execute_the_command))

View File

@ -65,7 +65,7 @@ zram_max_sigkill = 55 %
Response on PSI memory some avg10 value
(/proc/pressure/memory on systems with Linux 4.20+).
ignore_psi = True
ignore_psi = False
sigterm_psi_avg10 = 60
sigkill_psi_avg10 = 90
@ -110,7 +110,7 @@ rate_zram = 1
Valid values are integers from the range [0; 1000].
min_badness = 50
min_badness = 30
Минимальная задержка после отправки соответствующих сигналов
для предотвращения риска убийства сразу множества процессов.
@ -132,7 +132,7 @@ min_delay_after_sigkill = 0.8
Valid values are True and False.
Values are case sensitive.
decrease_oom_score_adj = False
decrease_oom_score_adj = True
Valid values are integers from the range [0; 1000].
@ -160,7 +160,7 @@ oom_score_adj_max = 30
Valid values are True and False.
regex_matching = False
regex_matching = True
Syntax:
@ -184,7 +184,7 @@ regex_matching = False
A good option that allows fine adjustment.
re_match_cmdline = False
re_match_cmdline = True
@CMDLINE_RE 300 /// -childID|--type=renderer
@ -195,7 +195,7 @@ re_match_cmdline = False
The most slow option
re_match_uid = False
re_match_uid = True
@UID_RE -100 /// ^0$
@ -215,7 +215,7 @@ re_match_uid = False
Valid values are True and False.
execute_the_command = False
execute_the_command = True
The length of the process name can't exceed 15 characters.
The syntax is as follows: lines starting with keyword $ETC are
@ -248,17 +248,17 @@ $ETC foo /// exit 0
See also wiki.archlinux.org/index.php/Desktop_notifications
Valid values are True and False.
gui_notifications = False
gui_notifications = True
Enable GUI notifications about the low level of available memory.
Valid values are True and False.
gui_low_memory_warnings = False
gui_low_memory_warnings = True
Минимальное время между отправками уведомлений в секундах.
Valid values are floating-point numbers from the range [1; 300].
min_time_between_warnings = 20
min_time_between_warnings = 10
Если значения MemAvailable и SwapFree одновременно будут ниже
соотвестствующих значений, то будут отправлены уведомления.
@ -286,15 +286,15 @@ zram_max_warnings = 40 %
Display the configuration when the program starts.
Valid values are True and False.
print_config = False
print_config = True
Print memory check results.
Valid values are True and False.
print_mem_check_results = False
print_mem_check_results = True
Print sleep periods between memory checks.
Valid values are True and False.
print_sleep_periods = False
print_sleep_periods = True

View File

@ -15,7 +15,10 @@ CPUSchedulingPriority=99
CPUSchedulingResetOnFork=true
ProtectSystem=strict
MemoryMax=100M
MemorySwapMax=0
TasksMax=100
OOMScoreAdjust=-20
Slice=nohang.slice
[Install]
WantedBy=multi-user.target