diff --git a/man/systemd-system.conf.xml b/man/systemd-system.conf.xml index e403fa5308..e22b335d30 100644 --- a/man/systemd-system.conf.xml +++ b/man/systemd-system.conf.xml @@ -382,30 +382,14 @@ DefaultLimitRTPRIO= DefaultLimitRTTIME= - These settings control various default - resource limits for units. See - setrlimit2 - for details. The resource limit is possible to specify in two formats, - to set soft and hard limits to the same value, - or to set both limits individually (e.g. DefaultLimitAS=4G:16G). - Use the string infinity to - configure no limit on a specific resource. The multiplicative - suffixes K (=1024), M (=1024*1024) and so on for G, T, P and E - may be used for resource limits measured in bytes - (e.g. DefaultLimitAS=16G). For the limits referring to time values, - the usual time units ms, s, min, h and so on may be used (see - systemd.time7 - for details). Note that if no time unit is specified for - DefaultLimitCPU= the default unit of seconds is - implied, while for DefaultLimitRTTIME= the default - unit of microseconds is implied. Also, note that the effective - granularity of the limits might influence their - enforcement. For example, time limits specified for - DefaultLimitCPU= will be rounded up implicitly to - multiples of 1s. These settings may be overridden in individual units - using the corresponding LimitXXX= directives. Note that these resource - limits are only defaults for units, they are not applied to PID 1 - itself. + These settings control various default resource limits for processes executed by + units. See + setrlimit2 for + details. These settings may be overridden in individual units using the corresponding + LimitXXX= directives, see + systemd.exec5, for + details, and they accept the same parameter syntax. Note that these resource limits are only defaults + for units, they are not applied to the service manager process (i.e. PID 1) itself. diff --git a/man/systemd.exec.xml b/man/systemd.exec.xml index bf17188ed2..c4cada2f27 100644 --- a/man/systemd.exec.xml +++ b/man/systemd.exec.xml @@ -498,42 +498,51 @@ CapabilityBoundingSet=~CAP_B CAP_C LimitRTTIME= Set soft and hard limits on various resources for executed processes. See - setrlimit2 for details on - the resource limit concept. Resource limits may be specified in two formats: either as single value to set a - specific soft and hard limit to the same value, or as colon-separated pair to set - both limits individually (e.g. LimitAS=4G:16G). Use the string to - configure no limit on a specific resource. The multiplicative suffixes K, M, G, T, P and E (to the base 1024) - may be used for resource limits measured in bytes (e.g. LimitAS=16G). For the limits referring to time values, - the usual time units ms, s, min, h and so on may be used (see + setrlimit2 for + details on the resource limit concept. Resource limits may be specified in two formats: either as + single value to set a specific soft and hard limit to the same value, or as colon-separated pair + to set both limits individually (e.g. LimitAS=4G:16G). + Use the string to configure no limit on a specific resource. The + multiplicative suffixes K, M, G, T, P and E (to the base 1024) may be used for resource limits + measured in bytes (e.g. LimitAS=16G). For the limits referring to time values, the + usual time units ms, s, min, h and so on may be used (see systemd.time7 for - details). Note that if no time unit is specified for LimitCPU= the default unit of seconds - is implied, while for LimitRTTIME= the default unit of microseconds is implied. Also, note - that the effective granularity of the limits might influence their enforcement. For example, time limits - specified for LimitCPU= will be rounded up implicitly to multiples of 1s. For - LimitNICE= the value may be specified in two syntaxes: if prefixed with + - or -, the value is understood as regular Linux nice value in the range -20..19. If not - prefixed like this the value is understood as raw resource limit parameter in the range 0..40 (with 0 being - equivalent to 1). + details). Note that if no time unit is specified for LimitCPU= the default unit of + seconds is implied, while for LimitRTTIME= the default unit of microseconds is + implied. Also, note that the effective granularity of the limits might influence their + enforcement. For example, time limits specified for LimitCPU= will be rounded up + implicitly to multiples of 1s. For LimitNICE= the value may be specified in two + syntaxes: if prefixed with + or -, the value is understood as + regular Linux nice value in the range -20..19. If not prefixed like this the value is understood as + raw resource limit parameter in the range 0..40 (with 0 being equivalent to 1). - Note that most process resource limits configured with these options are per-process, and processes may - fork in order to acquire a new set of resources that are accounted independently of the original process, and - may thus escape limits set. Also note that LimitRSS= is not implemented on Linux, and - setting it has no effect. Often it is advisable to prefer the resource controls listed in + Note that most process resource limits configured with these options are per-process, and + processes may fork in order to acquire a new set of resources that are accounted independently of the + original process, and may thus escape limits set. Also note that LimitRSS= is not + implemented on Linux, and setting it has no effect. Often it is advisable to prefer the resource + controls listed in systemd.resource-control5 - over these per-process limits, as they apply to services as a whole, may be altered dynamically at runtime, and - are generally more expressive. For example, MemoryLimit= is a more powerful (and working) - replacement for LimitRSS=. - - For system units these resource limits may be chosen freely. For user units however (i.e. units run by a - per-user instance of - systemd1), these limits are - bound by (possibly more restrictive) per-user limits enforced by the OS. + over these per-process limits, as they apply to services as a whole, may be altered dynamically at + runtime, and are generally more expressive. For example, MemoryMax= is a more + powerful (and working) replacement for LimitRSS=. Resource limits not configured explicitly for a unit default to the value configured in the various DefaultLimitCPU=, DefaultLimitFSIZE=, … options available in systemd-system.conf5, and – if not configured there – the kernel or per-user defaults, as defined by the OS (the latter only for user - services, see above). + services, see below). + + For system units these resource limits may be chosen freely. When these settings are configured + in a user service (i.e. a service run by the per-user instance of the service manager) they cannot be + used to raise the limits above those set for the user manager itself when it was first invoked, as + the user's service manager generally lacks the privileges to do so. In user context these + configuration options are hence only useful to lower the limits passed in or to raise the soft limit + to the maximum of the hard limit as configured for the user. To raise the user's limits further, the + available configuration mechanisms differ between operating systems, but typically require + privileges. In most cases it is possible to configure higher per-user resource limits via PAM or by + setting limits on the system service encapsulating the user's service manager, i.e. the user's + instance of user@.service. After making such changes, make sure to restart the + user's service manager. Resource limit directives, their equivalent <command>ulimit</command> shell commands and the unit used