From 57b983e876c485fab90ee12f0b4d53a79417b4cf Mon Sep 17 00:00:00 2001 From: Enno Tensing Date: Wed, 30 Jul 2025 10:22:25 +0200 Subject: [PATCH] example.container: Add resource accounting Add 'accounting' and its child-objects 'cgroup' and 'cpu' to control the container cgroup and cpu usage. Signed-off-by: Enno Tensing --- example.container | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/example.container b/example.container index 2108e18..29cce0a 100644 --- a/example.container +++ b/example.container @@ -48,5 +48,23 @@ "capabilities": { "add": [ "NET_RAW" ], "drop": [ "CAP_SYS_ADMIN" ] + }, + "accounting": { + "cgroup": { + "config": ["memory.high=1073741824"], + "parent": "/example-parent", + "namespace": "host", + "how": "enabled" + }, + "cpu": { + "period": "100000", + "quota": "100000", + "shares": "1024", + "number": "4", + "cpuset": { + "cpus": "0-3,11-15", + "mems": "0,1" + } + } } }