lxd icon indicating copy to clipboard operation
lxd copied to clipboard

VM: Add disk I/O limit support - from Incus

Open simondeziel opened this issue 1 year ago • 4 comments

I feel this warrants an API extension but none was added in Incus.

simondeziel avatar Feb 29 '24 17:02 simondeziel

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?

tomponline avatar Mar 04 '24 15:03 tomponline

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.

simondeziel avatar Mar 04 '24 15:03 simondeziel

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.

tomponline avatar Mar 05 '24 08:03 tomponline

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 avatar Mar 05 '24 08:03 tomponline

@tomponline the API extension was added, please take another look.

simondeziel avatar Mar 08 '24 15:03 simondeziel

@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

simondeziel avatar Mar 08 '24 16:03 simondeziel

Thanks!

tomponline avatar Mar 08 '24 17:03 tomponline

@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

Sounds like a something maybe we can test on lxd-ci?

tomponline avatar Mar 08 '24 17:03 tomponline