[libvirt] [PATCH] Priority of vzctl create should be lower

Hi all About OpenVZ, it uses vzctl command that produces tar/gzip commands. I think we should lower these commands for running other procedures prior to them. This is the patch to achieve it with nice/ionice commands. From ff3cf022995ef541136bd40579af2eeb20aeafdb Mon Sep 17 00:00:00 2001 From: root <root@node13.nvlab.org> Date: Mon, 26 Oct 2009 02:44:43 +0000 Subject: [PATCH] lower priority for running tar and gzip during vzctl create --- src/openvz/openvz_driver.c | 8 ++++++++ 1 files changed, 8 insertions(+), 0 deletions(-) diff --git a/src/openvz/openvz_driver.c b/src/openvz/openvz_driver.c index f64ad1e..59d38ae 100644 --- a/src/openvz/openvz_driver.c +++ b/src/openvz/openvz_driver.c @@ -130,6 +130,14 @@ openvzDomainDefineCmd(virConnectPtr conn, } while (0) narg = 0; + + /* lower priority for running tar and gzip */ + ADD_ARG_LIT("nice"); + ADD_ARG_LIT("-n"); + ADD_ARG_LIT("19"); + ADD_ARG_LIT("ionice"); + ADD_ARG_LIT("-c3"); + ADD_ARG_LIT(VZCTL); ADD_ARG_LIT("--quiet"); ADD_ARG_LIT("create"); -- 1.5.3.4 ----- Yuji Nishida nishidy@nict.go.jp

Yuji NISHIDA wrote:
Hi all
About OpenVZ, it uses vzctl command that produces tar/gzip commands. I think we should lower these commands for running other procedures prior to them. This is the patch to achieve it with nice/ionice commands.
I'm not sure that this is such a good idea, as it is encoding policy into libvirt. There have been other requests for being able to set the priorities of certain domains, so it might make sense to have a more generic "priority" concept that could be set by the user. Then the user would specify how important a particular task is, and we wouldn't be putting any policy into libvirt itself. -- Chris Lalancette

Hi Chris, I think vzctl create command invokes processes which occupy CPU and Disk I/O. It seems clearly necessary for such commands to prevent from running prior to other processes. But I almost agree with you. We should have flexibility about it for users. As you said if it requires to encode policy into libvirt, we should avoid it still now. And I want to spend more time in writing some other patches :) ----- Yuji Nishida nishidy@nict.go.jp On 2009/10/26, at 21:15, Chris Lalancette wrote:
Yuji NISHIDA wrote:
Hi all
About OpenVZ, it uses vzctl command that produces tar/gzip commands. I think we should lower these commands for running other procedures prior to them. This is the patch to achieve it with nice/ionice commands.
I'm not sure that this is such a good idea, as it is encoding policy into libvirt. There have been other requests for being able to set the priorities of certain domains, so it might make sense to have a more generic "priority" concept that could be set by the user. Then the user would specify how important a particular task is, and we wouldn't be putting any policy into libvirt itself.
-- Chris Lalancette

On Mon, Oct 26, 2009 at 01:15:17PM +0100, Chris Lalancette wrote:
Yuji NISHIDA wrote:
Hi all
About OpenVZ, it uses vzctl command that produces tar/gzip commands. I think we should lower these commands for running other procedures prior to them. This is the patch to achieve it with nice/ionice commands.
I'm not sure that this is such a good idea, as it is encoding policy into libvirt. There have been other requests for being able to set the priorities of certain domains, so it might make sense to have a more generic "priority" concept that could be set by the user. Then the user would specify how important a particular task is, and we wouldn't be putting any policy into libvirt itself.
Agreed hardcoding a policy like this at the lowest level doesn't sound the right approach, Daniel -- Daniel Veillard | libxml Gnome XML XSLT toolkit http://xmlsoft.org/ daniel@veillard.com | Rpmfind RPM search engine http://rpmfind.net/ http://veillard.com/ | virtualization library http://libvirt.org/
participants (3)
-
Chris Lalancette
-
Daniel Veillard
-
Yuji NISHIDA