SlidePub
Home
Categories
Login
Register
Home
Technology
Future Proof Your Applications - Avoid Breakdowns with cgroup changes
Future Proof Your Applications - Avoid Breakdowns with cgroup changes
steam20
22 views
20 slides
Sep 14, 2025
Slide
1
of 20
Previous
Next
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
About This Presentation
cgroup v1 vs v2 changes
Size:
483.85 KB
Language:
en
Added:
Sep 14, 2025
Slides:
20 pages
Slide Content
Slide 1
Future-Proof Your Applications:
Avoid Breakdowns with cgroup
Changes!
Kamalesh Babulal, Tom Hromatka
[email protected]
,
[email protected]
Oracle Cloud Infrastructure
August 5
th
, 2025
Slide 2
The following is intended to outline our general product direction. It is intended for
information purposes only, and may not be incorporated into any contract. It is not a
commitment to deliver any material, code, or functionality, and should not be relied
upon in making purchasing decisions. The development, release, timing, and pricing
of any features or functionality described for Oracle’s products may change and
remains at the sole discretion of Oracle Corporation.
Safe harbor statement
2 Copyright © 2025, Oracle and/or its affiliates | Open Source Summit, Hyderabad 2025
Slide 3
“cgroup is a mechanism to organize
processes hierarchically and distribute
system resources along the hierarchy in a
controlled and configurable manner.”
Documentation/admin-guide/cgroup-v2.rst
Kernel Source
Copyright © 2025, Oracle and/or its affiliates | Open Source Summit, Hyderabad 20253
Slide 4
Demo
Introduction to cgroup
4 Copyright © 2025, Oracle and/or its affiliates | Open Source Summit, Hyderabad 2025
Slide 5
Jan 2008
cgroup v1
(v2.6.24)
memory,
blkio (IO)
(v3.16)
Aug 2014
cgroup v2
(v3.16)*
RDMA
(v4.11)
Apr 2017
*mount -t cgroup -o __DEVEL__sane_behavior cgroup <mount-point>
Jan 2016
cgroup v2
(v4.5)
cpu
(v4.15)
Jan 2018
PSI
(v4.20)
Dec 2018
cpuset v2
(v5.0)
Mar 2019
freezer
(v5.2)
July 2019
hugeTLB
(v5.6)
Mar 2020
misc
(v5.13)
July 2021
libcgroup v0.34
cgroup v1
Jun 2009
libcgroup v2.0
cgroup v2
May 2021
libcgroup v3.1
systemd support
July 2023
systemd
cgroup v1
Mar 2010
Systemd v232
cgroup v2
Nov 2016
Systemd v244
default cgroup v2
Dec 2019
dmem
(v6.14)
Dec 2024
5 Copyright © 2025, Oracle and/or its affiliates | Open Source Summit, Hyderabad 2025
cgroup Introduction
The Timeline
Slide 6
6 Copyright © 2025, Oracle and/or its affiliates | Open Source Summit, Hyderabad 2025
cgroup Introduction
cgroup v1 hierarchy
blkio
cpu
cpuacct
IOdevices
cpuset
freezer
dmem
misc
hugetlb
memory
netcls
perf_event
net_prio
rdma
pids
debug
DB Insights
D1 ……. Dn I1 ……. In
Insights
InsightsDB Insights
D1 ……. Dn I1 ……. In
cpu.shares = 3072 cpu.shares = 1024memory.limit_in_bytes = 1G memory.limit_in_bytes = -1
/sys/fs/cgroup
Slide 7
cgroup Introduction
cgroup v1 vs cgroup v2 hierarchy
7 Copyright © 2025, Oracle and/or its affiliates | Open Source Summit, Hyderabad 2025
cpu
DB Insights
D1 ……. Dn
/
mycgrp echo `+cpu +memory` > cgroup.subtree
I1 ……. In
cpu.shares=1024
cpu.weight=300
memory.max=1G
D1 ……. Dn I1 ……. In
DB Insights
memory
memory.limit_in_bytes=1G memory.limit_in_bytes=-1
DB Insights
D1 ……. Dn I1 ……. In
cpu.weight=100
memory.max=max
cpu.shares=3072
Slide 8
cgroup Introduction
Hierarchy How To
Bash
●
# cd /sys/fs/cgroup/
●
# echo "+cpu +memory" >
cgroup.subtree_control
●
# echo "300" > db/cpu.weight
●
# echo "100" > insights/cpu.weight
●
# echo "1G" > db/memory.max
libcgroup
●
cgcreate -gcpu,memory db
●
cgcreate -gcpu,memory insights
●
cgset -r cpu.weight=300 \
-r memory.max=1G db
●
cgset -r cpu.weight=100 insights
man cgconfig.conf – libcgroup configuration file
systemd
●
systemd-run --scope \
--unit=db.scope \
--slice=demo.slice \
-p CPUWeight=300 \
-p MemoryMax=1G sleep 1000
●
systemd-run --scope \
--unit=insights.scope \
--slice=demo.slice \
-p CPUWeight=100 sleep 1000
8 Copyright © 2025, Oracle and/or its affiliates | Open Source Summit, Hyderabad 2025
Slide 9
cgroup Transition
cgroup v1 vs cgroup v2
9 Copyright © 2025, Oracle and/or its affiliates | Open Source Summit, Hyderabad 2025
cpu
DB Insights
D1 ……. Dn
/
mycgrp
echo `+cpu +memory` > cgroup.subtree_control
I1 ……. In
cpu.shares=1024
cpu.weight=300
memory.max=1G
D1 ……. Dn
I1 ……. In
DB Insights
memory
memory.limit_in_bytes=1G memory.limit_in_bytes=-1
DB Insights
D1 ……. Dn I1 ……. In
cpu.weight=100
memory.max=max
cpu.shares=3072
multi-hierarchyunified-hierarchy
Slide 10
cgroup Transition
Constraints
10 Copyright © 2025, Oracle and/or its affiliates | Open Source Summit, Hyderabad 2025
/
mycgrp
echo `+cpu +memory` > cgroup.subtree_control
cpu.weight=300
memory.max=1G
DB Insights
D1 ……. Dn I1 ……. In
cpu.weight=100
memory.max=max
●Top-Down Constraint
●Resources from the parent cgroup are distributed among
children cgroups
●No Internal Process Constraint
●Processes are allowed only in leaf cgroup
●Delegation
●Allowing non-root users to manage their sub-tree hierarchy
cpu.weight=400
memory.max=1G
Slide 11
cgroup Transition
11 Copyright © 2025, Oracle and/or its affiliates | Open Source Summit, Hyderabad 2025
CPU controller
cpu.shares ⏵ cpu.weight
cpu.cfs_period_us ⏵ cpu.max (second field)
cpu.cfs_quota_us ⏵ cpu.max (first field)
memory controller
memory.limits_in_bytes ⏵memory.max
memory.soft_limit_in_bytes ⏵memory.high
memory.swappiness ⏵memory.swap.max
blkio (IO) controller
blkio.weight ⏵ io.weight
blkio.throttle.read_bps_device⏵ io.max
blkio.throttle.wrtie_bps_device⏵ io.max
blkio.throttle.read_iops_device⏵ io.max
blkio.throttle.write_iops_device⏵ io.max
pids controller
pids.max ⏵ pids.max
cpusets controller
cpuset.cpus ⏵ cpuset.cpus
cpuset.mems ⏵ cpuset.mems
cpuset.cpu_exclusive ⏵ cpuset.cpu.exclusive
cpuset.cpu.partition
Enabling cgroup v1 controllers:
CONFIG_MEMCG_V1 (v6.11)
CONFIG_CPUSETS_V1 (v6.12)
Mapping Examples
Slide 12
Demo
Introduction to libcgroup
abstractions
12 Copyright © 2025, Oracle and/or its affiliates | Open Source Summit, Hyderabad 2025
Slide 13
cgroup v2 QoS
Finer granularity control
13 Copyright © 2025, Oracle and/or its affiliates | Open Source Summit, Hyderabad 2025
memory.min
memory.low
memory.high
memory.max
memory cpu IO
cpu.weight
cpu.max
io.weight
io.max
memory.min = 1024M # 1GB
memory.low = 1536M # 1.5GB
memory.high = 2048M # 2GB
memory.max = 2560M # 2.5GB
cpu.weight = 300 # 3x
cpu.max = 800000 1000000 # 80% of cpu
io.weight = 800 # 8x IO bandwidth
io.max = 259:0 rbps=209715200 wbps=104857600
riops=5000 wiops=2000 # read/write bandwidth/IOPS
Slide 14
Demo
Introduction to PSI
14 Copyright © 2025, Oracle and/or its affiliates | Open Source Summit, Hyderabad 2025
Slide 15
Thank you
Copyright © 2025, Oracle and/or its affiliates | Open Source Summit, Hyderabad 202515
Slide 17
Backup Slides
Copyright © 2025, Oracle and/or its affiliates | Open Source Summit, Hyderabad 202517
Slide 18
Demo
Introduction to cgroup
18 Copyright © 2025, Oracle and/or its affiliates | Open Source Summit, Hyderabad 2025
Terminal 1
# cgcreate -gcpu:db
# cgcreate -gcpu:insights
# cgexec -gcpu:db stress-ng --cpu 0 --timeout 1800s &
# cgexec -gcpu:insights stress-ng –-cpu 0 --timeout 1800s &
# cgset -r cpu.weight=300 db
Terminal 2
# systemd-cgtop
Slide 19
Demo
Introduction to libcgroup
abstractions
19 Copyright © 2025, Oracle and/or its affiliates | Open Source Summit, Hyderabad 2025
Terminal 1
# cgcreate -gcpu:insights
# cgget -r cpu.weight insights
# cgxset -1 -r cpu.shares=512 insights
# cgget -r cpu.weight insights
Slide 20
Demo
Introduction to PSI
20 Copyright © 2025, Oracle and/or its affiliates | Open Source Summit, Hyderabad 2025
Terminal 1
# cgcreate -gcpu,memory:insights
# cgexec -gmemory:insights stress-ng --vm 2 --vm-bytes 4G \
--vm-keep &
Terminal 2
# watch -n 0.1 "cat /sys/fs/cgroup/insights/memory.pressure"
Monitoring
<some|full> <stall amount is us> <time window in us>
Use select(), poll() or epoll()
# cgset -r memory.pressure="some 150000 1000000 foo"
Take the example from https://docs.kernel.org/accounting/psi.html#psi (Changed to cgroup
insights from global memory pressure)
Tags
presentation
software
Categories
Technology
Download
Download Slideshow
Get the original presentation file
Quick Actions
Embed
Share
Save
Print
Full
Report
Statistics
Views
22
Slides
20
Age
78 days
Related Slideshows
11
8-top-ai-courses-for-customer-support-representatives-in-2025.pptx
JeroenErne2
44 views
10
7-essential-ai-courses-for-call-center-supervisors-in-2025.pptx
JeroenErne2
45 views
13
25-essential-ai-courses-for-user-support-specialists-in-2025.pptx
JeroenErne2
36 views
11
8-essential-ai-courses-for-insurance-customer-service-representatives-in-2025.pptx
JeroenErne2
33 views
21
Know for Certain
DaveSinNM
19 views
17
PPT OPD LES 3ertt4t4tqqqe23e3e3rq2qq232.pptx
novasedanayoga46
23 views
View More in This Category
Embed Slideshow
Dimensions
Width (px)
Height (px)
Start Page
Which slide to start from (1-20)
Options
Auto-play slides
Show controls
Embed Code
Copy Code
Share Slideshow
Share on Social Media
Share on Facebook
Share on Twitter
Share on LinkedIn
Share via Email
Or copy link
Copy
Report Content
Reason for reporting
*
Select a reason...
Inappropriate content
Copyright violation
Spam or misleading
Offensive or hateful
Privacy violation
Other
Slide number
Leave blank if it applies to the entire slideshow
Additional details
*
Help us understand the problem better