Repository navigation
Expand file tree
/
Copy pathprocess-slice-manager.conf.example
More file actions
143 lines (124 loc) · 6.35 KB
/
Copy pathprocess-slice-manager.conf.example
File metadata and controls
143 lines (124 loc) · 6.35 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
# /etc/process-slice-manager.conf
# Main configuration for the Process Slice Manager daemon (Rust).
# Copy this file to /etc/process-slice-manager.conf and adjust if needed.
#
# The daemon is a complementary extension of HestiaCP:
# * it moves php-fpm workers into the user slices HestiaCP already manages,
# * it applies OPTIONAL cgroup v2 attributes from the [Package] sections
# below - nothing else. HestiaCP remains the owner of the cgroups and the
# source of truth for users, packages and primary resource limits.
# * it enforces a HARD memory policy on every user slice: memory.max =
# MEMORY_LIMIT, memory.high = max (no throttle) and memory.oom.group = 0
# (no group kill). HestiaCP only sets memory.high - a throttle that freezes
# the whole slice (and with it PHP-FPM) once usage crosses it, instead of
# letting the kernel OOM-kill a single worker. This policy always runs and
# cannot be disabled or overridden from a package section.
#
# Global keys use `key = value` syntax. Sections use `[Package]` headers.
# Lines starting with '#' are comments.
# ---------------------------------------------------------------------------
# Global settings
# ---------------------------------------------------------------------------
# Logging level: error | warn | info | debug | trace
log_level = info
# Log file (daemon opens it once, keeps the descriptor open).
log_file = /var/log/process-slice-manager.log
# PID file used by start/stop.
pid_file = /var/run/process-slice-manager.pid
# Seconds between monitor cycles. Lower = faster reaction, more CPU.
poll_interval = 2
# Seconds between statistics snapshots (logged once per interval).
stats_interval = 60
# How long (seconds) a non-php pid stays in the negative cache before its
# comm is re-read. Protects against pid reuse while keeping the loop cheap.
check_expiry = 60
# How often (seconds) the negative cache is pruned of dead pids.
prune_interval = 300
# Seconds between automatic reloads of the HestiaCP user data. HestiaCP's
# package hooks fire on user creation / package change but NOT on
# v-delete-user, so this periodic refresh is what lets the daemon notice
# deleted accounts and reclaim their (empty) slices. Set to 0 to disable
# (then only `systemctl reload process-slice-manager` triggers a refresh).
refresh_interval = 300
# Exempt interactive SSH/SFTP sessions from the user's cgroup limits.
# pam_systemd places them in `user-<uid>.slice/session-*.scope`, so the
# cpu/memory limits HestiaCP and this daemon apply to the user slice would
# throttle or kill the user's SSH/SFTP session while their PHP-FPM is under
# load - breaking file transfer exactly when the user falls under the limits.
# When enabled (default), the daemon relocates the session's processes into a
# dedicated leaf scope (`user.slice/psm-<uid>-session-<id>`) that carries no
# per-user limits.
exempt_ssh_sftp = true
# HestiaCP users directory (each user has users/<name>/user.conf).
hestia_users_dir = /usr/local/hestia/data/users
# HestiaCP packages directory. Every `<name>.pkg` file is a package (the
# `.sh` files are the per-package hooks and are ignored), so the dashboard
# (`top`) lists all of them - even packages no user is assigned to yet (e.g.
# `default`, which always exists in HestiaCP).
hestia_packages_dir = /usr/local/hestia/data/packages
# Unix socket used by the "status" command.
socket_path = /var/run/process-slice-manager.sock
# ---------------------------------------------------------------------------
# Assignment providers (IPC socket)
# ---------------------------------------------------------------------------
#
# The IPC socket is bound only when `providers` lists an event provider
# (currently only `exim`). Exim reports pid + $authenticated_id after SMTP
# AUTH; the daemon verifies the pid is really Exim and moves the process into
# the owner's user slice. No Exim config changes are needed on the daemon side.
#
# providers = exim
# ipc_socket = /run/process-slice-manager-ipc.sock
# exim_bin = /usr/sbin/exim4
#
# By default the IPC socket is root-only (0600). HestiaCP's Exim always runs
# as Debian-exim (never_users = root), so to let the post-AUTH notifier connect
# set this to the Exim group; the daemon then chowns the socket to that group
# and opens it 0660. Leave empty for a root-only socket.
# ipc_socket_group = Debian-exim
# ---------------------------------------------------------------------------
# Optional cgroup v2 attributes per HestiaCP package
# ---------------------------------------------------------------------------
#
# Each `[Package]` section may define attributes to write into every user's
# `user-<uid>.slice` cgroup. The package name must match a `<name>.pkg` file
# in `hestia_packages_dir`, which is also the PACKAGE value in the user's
# user.conf. Values are passed through verbatim to the cgroup attribute files
# (e.g. "70%", "true", "200").
#
# Rules:
# * an attribute is applied ONLY if it is listed here,
# * attributes NOT listed are never touched - HestiaCP's settings stay,
# * a missing or empty section means "no extensions" for that package.
#
# Value handling:
# * boolean tokens (true/false/yes/no/on/off) are written as 1/0,
# * a percentage (e.g. memory.swap.max = 50%) is resolved against the slice's
# own finite limit (memory.swap.max as set by HestiaCP), or the parent's if
# the slice has none; unresolvable percentages are skipped with a warning,
# * everything else is passed through verbatim to the cgroup attribute file.
#
# Supported attribute keys:
# memory.swap.max cpu.weight cpu.uclamp.min cpu.uclamp.max
# io.weight memory.zswap.max memory.reclaim pids.max
#
# memory.high / memory.swap.high / memory.oom.group are NOT supported: the
# memory throttle and group-kill would freeze (or kill) the user's whole slice
# under load. The daemon always writes memory.high = max and
# memory.oom.group = 0 instead - see the note at the top.
#
# Only the package sections below are used. If a user's package has no
# section, no attributes are applied to that user's slice.
#
# Package names are matched against the packages listed in HestiaCP
# (`hestia_packages_dir`). The `default` package is always present, so it is
# a safe place for attributes that should apply to every user whose package
# has no dedicated section. Example:
[default]
[Mini]
cpu.weight = 200
[Pro]
cpu.weight = 500
[Business]
cpu.weight = 1000
io.weight = 1000