[pve-devel] [PATCH] implement cpuunit with cgroups

Alexandre DERUMIER aderumier at odiso.com
Tue Jun 2 08:27:38 CEST 2015


>>why *100 (description states value is already in %)?

I think that is cpuunit=1  for 1core ? (same than lxc) , so we need *100 to get it in %.


----- Mail original -----
De: "dietmar" <dietmar at proxmox.com>
À: "aderumier" <aderumier at odiso.com>, "pve-devel" <pve-devel at pve.proxmox.com>
Envoyé: Mardi 2 Juin 2015 08:18:17
Objet: Re: [pve-devel] [PATCH] implement cpuunit with cgroups

> - description => "Limit of CPU usage in per cent. Note if the computer has 2 
> CPUs, it has total of 200% CPU time. Value '0' indicates no CPU 
> limit.\n\nNOTE: This option is currently ignored.", 
> + description => "Limit of CPU usage in per cent. Note if the computer has 2 
> CPUs, it has total of 200% CPU time. Value '0' indicates no CPU limit.\n\n.", 
> minimum => 0, 
> default => 0, 
> }, 
> @@ -2562,6 +2562,10 @@ sub config_to_command { 
> push @$cmd, '--slice', "qemu"; 
> push @$cmd, '--unit', $vmid; 
> push @$cmd, '-p', "CPUShares=$cpuunits"; 
> + if ($conf->{cpulimit}) { 
> + my $cpulimit = $conf->{cpulimit} * 100; 

why *100 (description states value is already in %)? 

> + push @$cmd, '-p', "CPUQuota=$cpulimit"."\%"; 
> + } 
> 



More information about the pve-devel mailing list