Show Table of Contents
3.2.3. Example Usage
Example 3.2. Limiting CPU access
The following examples assume you have an existing hierarchy of cgroups configured and the
cpu subsystem mounted on your system:
- To allow one cgroup to use 25% of a single CPU and a different cgroup to use 75% of that same CPU, use the following commands:
~]#
echo 250 > /cgroup/cpu/blue/cpu.shares~]#echo 750 > /cgroup/cpu/red/cpu.shares - To limit a cgroup to fully utilize a single CPU, use the following commands:
~]#
echo 10000 > /cgroup/cpu/red/cpu.cfs_quota_us~]#echo 10000 > /cgroup/cpu/red/cpu.cfs_period_us - To limit a cgroup to utilize 10% of a single CPU, use the following commands:
~]#
echo 10000 > /cgroup/cpu/red/cpu.cfs_quota_us~]#echo 100000 > /cgroup/cpu/red/cpu.cfs_period_us - On a multi-core system, to allow a cgroup to fully utilize two CPU cores, use the following commands:
~]#
echo 200000 > /cgroup/cpu/red/cpu.cfs_quota_us~]#echo 100000 > /cgroup/cpu/red/cpu.cfs_period_us

Where did the comment section go?
Red Hat's documentation publication system recently went through an upgrade to enable speedier, more mobile-friendly content. We decided to re-evaluate our commenting platform to ensure that it meets your expectations and serves as an optimal feedback mechanism. During this redesign, we invite your input on providing feedback on Red Hat documentation via the discussion platform.