소스 검색

Add Resource Controls to SystemD

Add some documentation around resource controls for SystemD
master
Nate Bohman 3 년 전
부모
커밋
a6940d69d1
로그인 계정: Nate Bohman <natrinicle@gmail.com> GPG Key ID: C10546A54ABA1CE5
1개의 변경된 파일35개의 추가작업 그리고 0개의 파일을 삭제
  1. +35
    -0
      systemd/resource-control.service

+ 35
- 0
systemd/resource-control.service 파일 보기

@@ -0,0 +1,35 @@
# Override file to specify CPU and RAM limits. Create a directory
# /etc/systemd/system/<service-name>.service.d and place a file
# with these contents inside with a .conf extension.

[Service]
# Assign the specified CPU time quota to the processes executed.
# Takes a percentage value, suffixed with "%". The percentage
# specifies how much CPU time the unit shall get at maximum,
# relative to the total CPU time available on one CPU. Use
# values > 100% for allotting CPU time on more than one CPU. This
# controls the "cpu.max" attribute on the unified control group
# hierarchy and "cpu.cfs_quota_us" on legacy. For details about
# these control group attributes, see Control Groups v2 and
# sched-bwc.txt.
# Example: CPUQuota=20% ensures that the executed processes will
# never get more than 20% CPU time on one CPU.
CPUQuota=20%

# Specify the throttling limit on memory usage of the executed
# processes in this unit. Memory usage may go above the limit if
# unavoidable, but the processes are heavily slowed down and memory
# is taken away aggressively in such cases. This is the main
# mechanism to control memory usage of a unit.
# Takes a memory size in bytes. If the value is suffixed with
# K, M, G or T, the specified memory size is parsed as Kilobytes,
# Megabytes, Gigabytes, or Terabytes (with the base 1024),
# respectively. Alternatively, a percentage value may be specified,
# which is taken relative to the installed physical memory on the
# system. If assigned the special value "infinity", no memory
# throttling is applied. This controls the "memory.high" control
# group attribute. For details about this control group attribute,
# see Memory Interface Files.
# This setting is supported only if the unified control group
# hierarchy is used and disables MemoryLimit=.
MemoryHigh=512M

Loading…
취소
저장