i/o disk limit

Bestbeast

Well-Known Member
Jul 29, 2016
163
5
58
30
Hello,

I saw in some forums that lxc can limit i/o disk and wanted to know how to do it with proxmox.

Thanks
 
For lxc:

lsblk to get device:

└─sda3 8:3 0 3.7T 0 part
├─pve-root 251:0 0 10G 0 lvm /
├─pve-swap 251:1 0 2G 0 lvm [SWAP]
├─pve-data_tmeta 251:2 0 116M 0 lvm
│ └─pve-data-tpool 251:4 0 3.6T 0 lvm
│ ├─pve-data 251:5 0 3.6T 0 lvm
│ ├─pve-dir 251:6 0 50G 0 lvm
│ ├─pve-vm--60200--disk--1 251:7 0 600G 0 lvm

then
limit read to 10KB/s for container 60200
echo "251:7 10000" > /sys/fs/cgroup/blkio/lxc/60200/blkio.throttle.read_bps_device

for iops use blkio.throttle.read_iops_device
 
For lxc:

lsblk to get device:

└─sda3 8:3 0 3.7T 0 part
├─pve-root 251:0 0 10G 0 lvm /
├─pve-swap 251:1 0 2G 0 lvm [SWAP]
├─pve-data_tmeta 251:2 0 116M 0 lvm
│ └─pve-data-tpool 251:4 0 3.6T 0 lvm
│ ├─pve-data 251:5 0 3.6T 0 lvm
│ ├─pve-dir 251:6 0 50G 0 lvm
│ ├─pve-vm--60200--disk--1 251:7 0 600G 0 lvm

then
limit read to 10KB/s for container 60200
echo "251:7 10000" > /sys/fs/cgroup/blkio/lxc/60200/blkio.throttle.read_bps_device

for iops use blkio.throttle.read_iops_device
But I can not limit 1 by 1, I will need something automated like being this option in proxmox
 
Hi @zima

The output of lsblk in my proxmox shows a different thing (attached)

So what i should do to limit the io?

Thanks!

 

Attachments

  • lsblk.png
    lsblk.png
    10 KB · Views: 63
Unfortunately LXC seems to have major issues for cpu limiting and now disk limiting. Not very good for hosting providers.

Anyway I think I got this disk limiting thing working. Did as per above. Do I need top stop and start the lxc container after doing this?
 
Seems to not save:

root@vz-cpt-1:/etc/pve/lxc# cat /sys/fs/cgroup/blkio/lxc/140/blkio.throttle.read_bps_device
251:49 50000

Then a few minutes later:

root@vz-cpt-1:/etc/pve/lxc# cat /sys/fs/cgroup/blkio/lxc/140/blkio.throttle.read_bps_device
root@vz-cpt-1:/etc/pve/lxc#
 
just checked on 2 containers and after +1h limit is still there and working.

Code:
Tue Nov 15 15:35:51 CET 2016
root@dreadnought:/# cat /sys/fs/cgroup/blkio/lxc/107/blkio.throttle.read_bps_device
251:19 50000
root@dreadnought:/# stat /sys/fs/cgroup/blkio/lxc/107/blkio.throttle.read_bps_device
  File: ‘/sys/fs/cgroup/blkio/lxc/107/blkio.throttle.read_bps_device’
  Size: 0               Blocks: 0          IO Block: 4096   regular empty file
Device: 1ah/26d Inode: 201         Links: 1
Access: (0644/-rw-r--r--)  Uid: (    0/    root)   Gid: (    0/    root)
Access: 2016-11-15 14:31:23.386872849 +0100
Modify: 2016-11-15 14:31:23.386872849 +0100
Change: 2016-11-15 14:31:23.386872849 +0100
 Birth: -
 

About

The Proxmox community has been around for many years and offers help and support for Proxmox VE, Proxmox Backup Server, and Proxmox Mail Gateway.
We think our community is one of the best thanks to people like you!

Get your subscription!

The Proxmox team works very hard to make sure you are running the best software and getting stable updates and security enhancements, as well as quick enterprise support. Tens of thousands of happy customers have a Proxmox subscription. Get yours easily in our online shop.

Buy now!