Cgroups: Unterschied zwischen den Versionen

Aus Xinux Wiki
Zur Navigation springen Zur Suche springen
Zeile 22: Zeile 22:
 
*[[cgroups-blkio]]
 
*[[cgroups-blkio]]
  
=Anlegen einer Control Group=
 
*cgcreate -g blkio:/mygroup
 
 
=Checken=
 
*lscgroup | grep blkio:/dd
 
blkio:/dd
 
 
=Welche Parameter sind Subsystem Block-I/O vorhanden=
 
*cgget -g blkio  /mygroup
 
<pre>
 
/mygroup:
 
blkio.throttle.io_serviced: Total 0
 
blkio.io_service_bytes_recursive: Total 0
 
blkio.io_serviced_recursive: Total 0
 
blkio.time:
 
blkio.io_serviced: Total 0
 
blkio.reset_stats:
 
blkio.io_wait_time: Total 0
 
blkio.weight: 500
 
blkio.leaf_weight_device:
 
blkio.throttle.read_iops_device:
 
blkio.io_merged_recursive: Total 0
 
blkio.throttle.write_bps_device:
 
blkio.leaf_weight: 500
 
blkio.sectors_recursive:
 
blkio.weight_device:
 
blkio.io_service_time_recursive: Total 0
 
blkio.throttle.write_iops_device:
 
blkio.throttle.io_service_bytes: Total 0
 
blkio.io_service_bytes: Total 0
 
blkio.io_wait_time_recursive: Total 0
 
blkio.io_service_time: Total 0
 
blkio.time_recursive:
 
blkio.io_merged: Total 0
 
blkio.throttle.read_bps_device:
 
blkio.sectors:
 
blkio.io_queued: Total 0
 
blkio.io_queued_recursive: Total 0
 
</pre>
 
 
=Geschwindigkeit einschränken=
 
*echo "8:16 1048576" > /sys/fs/cgroup/blkio/mygroup/blkio.throttle.write_bps_device
 
 
=Ohne Einschränkung=
 
*dd if=/dev/zero of=/tmp/test count=50 bs=100M
 
50+0 records in
 
50+0 records out
 
5242880000 bytes (5.2 GB, 4.9 GiB) copied, 23.0043 s, 228 MB/s
 
=Mit Einschränkung(Funktioniert nicht wie gewünscht)=
 
*cgexec -g blkio:/mygroup dd if=/dev/zero of=/tmp/test count=50 bs=100M
 
  
 
=Links=
 
=Links=

Version vom 14. Oktober 2017, 15:11 Uhr

Install

  • apt-get install cgroup-bin cgroup-lite cgroup-tools cgroupfs-mount libcgroup1

Create

  • cat /etc/cgconfig.conf
Ist bei Ubuntu leer

Kontrolle

  • lssubsys -am
cpuset /sys/fs/cgroup/cpuset
cpu,cpuacct /sys/fs/cgroup/cpu,cpuacct
blkio /sys/fs/cgroup/blkio
memory /sys/fs/cgroup/memory
devices /sys/fs/cgroup/devices
freezer /sys/fs/cgroup/freezer
net_cls,net_prio /sys/fs/cgroup/net_cls,net_prio
perf_event /sys/fs/cgroup/perf_event
hugetlb /sys/fs/cgroup/hugetlb
pids /sys/fs/cgroup/pids


Links