AlmaLinux is becoming popular day by day for the server-side OS. Besides, cGroups v2 plays a significant role in managing resources! Based on the necessity to have cGroups v2 enabled in AlmaLinux, today we will learn how to enable cGroups v2 in AlmaLinux 9.
Table of Contents
What’s the use of cGroups v2?
cGroups v2 is the next version of the Linux cGroups API. cGroups v2 provides a unified control system with advanced resource management capabilities. It’s a kernel feature that helps to limit resource usage (CPU, memory, disk, I.O, etc.) for different users/accounts.
How to enable cGroups v2 in AlmaLinux 9?
AlmaLinux 9 supports cGroups v2. Sometimes, the cGroups v2 may be disabled. At that time, we’ll need to enable it to get its benefits.
Before starting, please check the NOTES section first. By following the process, let’s check whether cGroups v2 is enabled.
Step 01: Checking whether cGroups v2 is enabled or not:
We can find out if the cGroups v2 is enabled or not by the following command:
stat -fc %T /sys/fs/cgroup
If cGroups v1 is enabled and the cGroups v2 is disabled, then it will show below output:
As here, cGroups v2 is disabled; we need to enable it by following the next steps.
Step 02: Modifying grub:
Using the following command, we can edit the grub file.
nano /etc/default/grub
Now need to append the “Now, we need to save it by CTRL+O & then ENTER. We are losing it by CTRL+X.
Step 03: Executing the modified grub file:
Using the following command, we have to execute the modified grub file:
grub2-mkconfig
Also, we need to use the following command:
yum update
Step 04: Restarting the system:
Now, we need to restart the system manually or using the following command:
reboot
Step 05: Rechecking if cGroups v2 is enabled or not:
After rebooting the system, we need to recheck whether cGroups v2 is enabled using the command we executed in STEP 01. If the cGroups v2 is enabled, the following output will be displayed.
ALL DONE!
Notes
- root user access must be required for this process.
- To use nano, we must install it before using this feature. By default, nano is not installed in AlmaLinux 9. So, before going through the STEP 02 process, use nano is installed.
- Following these steps, we can enable cGroups v2 in AlmaLinux 8.x.
0 Comments