[libvirt] [ROC] migration: set cpu throttle value by workload

Hi all, When migrating a guest which consumes too much CPU & memory, dirty pages amount will increase significantly, so does the migration time, migration can not even complete, at worst. So I made an RFC patch in QEMU to set cpu throttle value by workload when migration. The test result and the RFC patch are here: https://lists.gnu.org/archive/html/qemu-devel/2017-01/msg03479.html But this idea was not accepted by QEMU community. So I want to do a similar feature in libvirt: Step 1: Add --auto-converge-smart parameter to migrate. Step 2: Add a timer in qemu-driver to get the 'info migrate' to check if the dirty-pages-rate updated every 1 second or 0.5 second when migration. Step 3: If updated, change the cpu throttle value according to the dirty-pages-rate and page-size by 'migrate_set_parameter cpu-throttle-increment' I think this feature makes auto-converge smarter than leaving the cpu throttle value with default 20/10 or set by users. And also it can save time. Any comments will be welcome. Thanks, Chao Fan

On Wed, Apr 26, 2017 at 07:26:53PM +0800, Chao Fan wrote:
Hi all,
When migrating a guest which consumes too much CPU & memory, dirty pages amount will increase significantly, so does the migration time, migration can not even complete, at worst.
So I made an RFC patch in QEMU to set cpu throttle value by workload when migration. The test result and the RFC patch are here: https://lists.gnu.org/archive/html/qemu-devel/2017-01/msg03479.html
But this idea was not accepted by QEMU community. So I want to do a similar feature in libvirt:
Step 1: Add --auto-converge-smart parameter to migrate. Step 2: Add a timer in qemu-driver to get the 'info migrate' to check if the dirty-pages-rate updated every 1 second or 0.5 second when migration. Step 3: If updated, change the cpu throttle value according to the dirty-pages-rate and page-size by 'migrate_set_parameter cpu-throttle-increment'
I think this feature makes auto-converge smarter than leaving the cpu throttle value with default 20/10 or set by users. And also it can save time.
Libvirt design goal is to *not* implement such policies in our code. Instead we aim to expose the mechanisms that higher level applications can use to implement policies themselves. Both OpenStack and OVirt already use these mechanisms to apply migration policies. So any ideas like the ones you suggest should be proposed to the one or both of those apps as desired. Personally though I view post-copy migration as a more viable long term strategy, because it allows migration to complete in a predictable guaranteed timeframe without harming guest workloads to the extent that things like autoconverge do. Regards, Daniel -- |: https://berrange.com -o- https://www.flickr.com/photos/dberrange :| |: https://libvirt.org -o- https://fstop138.berrange.com :| |: https://entangle-photo.org -o- https://www.instagram.com/dberrange :|

At 2017-04-26 19:26:53, "Chao Fan" <fanc.fnst@cn.fujitsu.com> wrote:
Hi all,
When migrating a guest which consumes too much CPU & memory, dirty pages amount will increase significantly, so does the migration time, migration can not even complete, at worst.
So I made an RFC patch in QEMU to set cpu throttle value by workload when migration. The test result and the RFC patch are here: https://lists.gnu.org/archive/html/qemu-devel/2017-01/msg03479.html
But this idea was not accepted by QEMU community. So I want to do a similar feature in libvirt:
Hi, Fan
Step 1: Add --auto-converge-smart parameter to migrate. Step 2: Add a timer in qemu-driver to get the 'info migrate' to check if the dirty-pages-rate updated every 1 second or 0.5 second when migration. Step 3: If updated, change the cpu throttle value according to the dirty-pages-rate and page-size by 'migrate_set_parameter cpu-throttle-increment'
If dirty-pages-rate rising, we increase cpu-throttle-increment; if it falling after a while, would we decrease cpu-throttle-increment then? Regards, - Chen
I think this feature makes auto-converge smarter than leaving the cpu throttle value with default 20/10 or set by users. And also it can save time.
Any comments will be welcome.
Thanks, Chao Fan
-- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list

On Thu, Apr 27, 2017 at 02:24:25PM +0800, Chen Hanxiao wrote:
At 2017-04-26 19:26:53, "Chao Fan" <fanc.fnst@cn.fujitsu.com> wrote:
Hi all,
When migrating a guest which consumes too much CPU & memory, dirty pages amount will increase significantly, so does the migration time, migration can not even complete, at worst.
So I made an RFC patch in QEMU to set cpu throttle value by workload when migration. The test result and the RFC patch are here: https://lists.gnu.org/archive/html/qemu-devel/2017-01/msg03479.html
But this idea was not accepted by QEMU community. So I want to do a similar feature in libvirt:
Hi, Fan
Step 1: Add --auto-converge-smart parameter to migrate. Step 2: Add a timer in qemu-driver to get the 'info migrate' to check if the dirty-pages-rate updated every 1 second or 0.5 second when migration. Step 3: If updated, change the cpu throttle value according to the dirty-pages-rate and page-size by 'migrate_set_parameter cpu-throttle-increment'
If dirty-pages-rate rising, we increase cpu-throttle-increment; if it falling after a while, would we decrease cpu-throttle-increment then?
Hi Chen, Yes, that's what I want to do. The cpu throttle value is larger, the migration will be faster. On the other hand, the performance loss of the guest will be worse. It's a ballance problem. If dirty-pages-rate gets small, it proves the cpu throttle is suitable. So I think it's better to decrease cpu-throttle-increment to avoid more performance loss. Thanks, Chao Fan
Regards, - Chen
I think this feature makes auto-converge smarter than leaving the cpu throttle value with default 20/10 or set by users. And also it can save time.
Any comments will be welcome.
Thanks, Chao Fan
-- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list
participants (3)
-
Chao Fan
-
Chen Hanxiao
-
Daniel P. Berrange