Overview

Background

Red Hat Blog Cgroups Part 6

From a computing standpoint, often we have applications or services that are much more critical than other things on a system and they need all the help that they can get to be as responsive as possible.

This is going to involve a two-step process on Red Hat Enterprise Linux 7:

  1. Isolate the CPUs that we want to dedicate for our application

  2. Create the cgroups and unit files to make our application land on these CPUs

Create a Control Group in Lab 3 (daq-tst-dev03)

before cpuset cgroup created
-bash-4.2$ hostname
daq-tst-dev03.pcdsn
-bash-4.2$ cd /sys/fs/cgroup/
-bash-4.2$ ls
blkio    cpu,cpuacct  freezer  net_cls           perf_event
cpu      cpuset       hugetlb  net_cls,net_prio  pids
cpuacct  devices      memory   net_prio          systemd
-bash-4.2$ 
create a new cpuset control group named "p1"
-bash-4.2$ sudo bash 
[root@daq-tst-dev03 cgroup]# cgcreate -g cpuset:p1
[root@daq-tst-dev03 cgroup]# cgset -r cpuset.cpus=1,13 p1
[root@daq-tst-dev03 cgroup]# cgset -r cpuset.mems=0 p1
[root@daq-tst-dev03 cgroup]# exit
verify p1 subdirectory newly created
-bash-4.2$ cd /sys/fs/cgroup
-bash-4.2$ ls cpu
cgroup.clone_children  cpuacct.usage_percpu  cpu.stat
cgroup.event_control   cpu.cfs_period_us     notify_on_release
cgroup.procs           cpu.cfs_quota_us      release_agent
cgroup.sane_behavior   cpu.rt_period_us      tasks
cpuacct.stat           cpu.rt_runtime_us
cpuacct.usage          cpu.shares
-bash-4.2$ ls cpuset/
cgroup.clone_children   cpuset.memory_pressure_enabled
cgroup.event_control    cpuset.memory_spread_page
cgroup.procs            cpuset.memory_spread_slab
cgroup.sane_behavior    cpuset.mems
cpuset.cpu_exclusive    cpuset.sched_load_balance
cpuset.cpus             cpuset.sched_relax_domain_level
cpuset.mem_exclusive    notify_on_release
cpuset.mem_hardwall     p1
cpuset.memory_migrate   release_agent
cpuset.memory_pressure  tasks
-bash-4.2$ cd cpuset/p1
-bash-4.2$ ls
cgroup.clone_children  cpuset.memory_pressure
cgroup.event_control   cpuset.memory_spread_page
cgroup.procs           cpuset.memory_spread_slab
cpuset.cpu_exclusive   cpuset.mems
cpuset.cpus            cpuset.sched_load_balance
cpuset.mem_exclusive   cpuset.sched_relax_domain_level
cpuset.mem_hardwall    notify_on_release
cpuset.memory_migrate  tasks
-bash-4.2$ cat cpuset.cpus
1,13
-bash-4.2$ 
  • No labels