VM: Add disk I/O limit support - from Incus
I feel this warrants an API extension but none was added in Incus.
I feel this warrants an API extension but none was added in Incus.
Agreed.
It would also be useful to add some tests to lxd-ci for this if possible?
I feel this warrants an API extension but none was added in Incus.
Agreed.
So I should add the extension and collapse all those commits into one, with proper attribution, right?
It would also be useful to add some tests to lxd-ci for this if possible?
That's indeed the plan.
So I should add the extension and collapse all those commits into one, with proper attribution, right?
No, just add a single api extension commit (see https://github.com/canonical/lxd/blob/main/CONTRIBUTING.md#commit-structure) and that can be attributed to yourself as normal.
It doesn't look like there are any doc commits either so it'll also need something updated in the docs to indicate those keys are suitable for VMs and what they work on. cc @ru-fu
@tomponline the API extension was added, please take another look.
@tomponline I tested just limits.read=1000 which causes IOs to plummet down to reading at ~1kBps:
$ lxc exec v1 -- dd if=/dev/sda15 of=/dev/null iflag=direct status=progress
106263040 bytes (106 MB, 101 MiB) copied, 12 s, 8.9 MB/s
217088+0 records in
217088+0 records out
111149056 bytes (111 MB, 106 MiB) copied, 12.5408 s, 8.9 MB/s
$ lxc config device set v1 root limits.read=1000
$ lxc exec v1 -- dd if=/dev/sda15 of=/dev/null iflag=direct status=progress
17920 bytes (18 kB, 18 KiB) copied, 17 s, 1.0 kB/s^C
37+0 records in
36+0 records out
18432 bytes (18 kB, 18 KiB) copied, 18.3342 s, 1.0 kB/s
Thanks!
@tomponline I tested just
limits.read=1000which causes IOs to plummet down to reading at ~1kBps:$ lxc exec v1 -- dd if=/dev/sda15 of=/dev/null iflag=direct status=progress 106263040 bytes (106 MB, 101 MiB) copied, 12 s, 8.9 MB/s 217088+0 records in 217088+0 records out 111149056 bytes (111 MB, 106 MiB) copied, 12.5408 s, 8.9 MB/s $ lxc config device set v1 root limits.read=1000 $ lxc exec v1 -- dd if=/dev/sda15 of=/dev/null iflag=direct status=progress 17920 bytes (18 kB, 18 KiB) copied, 17 s, 1.0 kB/s^C 37+0 records in 36+0 records out 18432 bytes (18 kB, 18 KiB) copied, 18.3342 s, 1.0 kB/s
Sounds like a something maybe we can test on lxd-ci?