1 |
On 2021-07-15 09:58+0200 tastytea <gentoo@××××××××.de> wrote: |
2 |
|
3 |
> www-apps/gitea often used all 4 of my CPU cores and slowed everything |
4 |
> else down. So I attempted to limit CPU usage with cgroups: |
5 |
> |
6 |
> I have set this in /etc/rc.conf: |
7 |
> |
8 |
> rc_cgroup_mode="unified" |
9 |
> rc_cgroup_controllers="cpu memory io pids" |
10 |
> |
11 |
> And this in /etc/conf.d/gitea: |
12 |
> |
13 |
> rc_cgroup_settings=" |
14 |
> cpu.shares 128 |
15 |
> cpu.cfs_period_us 1000000 |
16 |
> cpu.cfs_quota_us 1000000 |
17 |
> memory.limit_in_bytes 8G |
18 |
> " |
19 |
|
20 |
The error was that I used documentation for cgroups v1 instead of v2¹. |
21 |
🤦The right values are: |
22 |
|
23 |
rc_cgroup_settings=" |
24 |
cpu.max 1000000 1000000 |
25 |
memory.high 7G |
26 |
memory.max 8G |
27 |
" |
28 |
|
29 |
¹ <https://www.kernel.org/doc/html/latest/admin-guide/cgroup-v2.html> |
30 |
|
31 |
-- |
32 |
Get my PGP key with `gpg --locate-keys tastytea@××××××××.de` or at |
33 |
<https://tastytea.de/tastytea.asc>. |