You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@cloudstack.apache.org by Fariborz Navidan <md...@gmail.com> on 2019/03/02 18:51:27 UTC

CPU speed in service offering

Hi,

I am wondering how the cpu time usage is calculated for a VM. Is it in per
core basis or the total fraction of cpu a vm can use. For example, when we
set 2 cores and 2000 MHz, the VM receives total of 2000MHz of 4000MHz
processing power?

Thanks

Re: CPU speed in service offering

Posted by Ivan Kudryavtsev <ku...@bw-sw.com>.
I copied the query from my .mysql_history. Maybe it's RO view, but in MySQL
there are updateable views:
http://www.mysqltutorial.org/create-sql-updatable-views.aspx


вс, 3 мар. 2019 г., 7:55 Thomas Joseph <th...@gmail.com>:

> A view table is readonly, the table named 'service_offering' would be the
> one needs updating.
>
> mysql> desc service_offering;
>
> +--------------------+----------------------+------+-----+---------+----------------+
> | Field              | Type                 | Null | Key | Default |
> Extra          |
>
> +--------------------+----------------------+------+-----+---------+----------------+
> | id                 | bigint(20) unsigned  | NO   | PRI | NULL    |
> auto_increment |
> | cpu                | int(10) unsigned     | YES  |     | NULL
> |                |
> | speed              | int(10) unsigned     | YES  |     | NULL
> |                |
> | ram_size           | bigint(20) unsigned  | YES  |     | NULL
> |                |
> | nw_rate            | smallint(5) unsigned | YES  |     | 200
> |                |
> | mc_rate            | smallint(5) unsigned | YES  |     | 10
> |                |
> | ha_enabled         | tinyint(1) unsigned  | NO   |     | 0
> |                |
> | limit_cpu_use      | tinyint(1) unsigned  | NO   |     | 0
> |                |
> | host_tag           | varchar(255)         | YES  |     | NULL
> |                |
> | default_use        | tinyint(1) unsigned  | NO   |     | 0
> |                |
> | vm_type            | varchar(32)          | YES  |     | NULL
> |                |
> | sort_key           | int(32)              | NO   |     | 0
> |                |
> | is_volatile        | tinyint(1) unsigned  | NO   |     | 0
> |                |
> | deployment_planner | varchar(255)         | YES  |     | NULL
> |                |
>
> +--------------------+----------------------+------+-----+---------+----------------+
> 14 rows in set (0.00 sec)
>
> regards,
> Thomas
>
> On Sat, Mar 2, 2019 at 8:28 PM Ivan Kudryavtsev <ku...@bw-sw.com>
> wrote:
>
> > CPU freq is per-core. The only way is to fix it in the database and next
> > stop/start VMs.
> >
> > Here is the SQL expr like the following:
> >
> > update service_offering_view set limit_cpu_use=0 where name like 'abc%'
> and
> > domain_path='/cde/';
> >
> > сб, 2 мар. 2019 г. в 15:11, Fariborz Navidan <md...@gmail.com>:
> >
> > > Also, how do I disable cpu cap for existing vms?
> > >
> > > On Sat, Mar 2, 2019 at 11:35 PM Fariborz Navidan <
> mdvlinquest@gmail.com>
> > > wrote:
> > >
> > > > Hi,
> > > >
> > > > Indeed I didn't realized the answer. The one we set in a service
> > offering
> > > > is allocated for each core or in total for whole the VM?
> > > >
> > > > On Sat, Mar 2, 2019 at 10:35 PM Ivan Kudryavtsev <
> > > kudryavtsev_ia@bw-sw.com>
> > > > wrote:
> > > >
> > > >> Actually, it works like everyone expects. In case of KVM you can
> just
> > > take
> > > >> a look at running instance with ps xa. But, I don't recommend
> setting
> > > CPU
> > > >> cap, though... VM will experience CPU steal, and users will not be
> > > happy.
> > > >> Better to deploy nodes with low cpu frequency and many cores.
> > > >>
> > > >> Without capping, the frequency is only for the resource calculation,
> > > when
> > > >> VMs are deployed, specifically:
> > > >> node.core-freq > freq && aggregate-node-freq-avail - cores x freq >
> 0
> > ->
> > > >> permit
> > > >>
> > > >> сб, 2 мар. 2019 г., 13:51 Fariborz Navidan <md...@gmail.com>:
> > > >>
> > > >> > Hi,
> > > >> >
> > > >> > I am wondering how the cpu time usage is calculated for a VM. Is
> it
> > in
> > > >> per
> > > >> > core basis or the total fraction of cpu a vm can use. For example,
> > > when
> > > >> we
> > > >> > set 2 cores and 2000 MHz, the VM receives total of 2000MHz of
> > 4000MHz
> > > >> > processing power?
> > > >> >
> > > >> > Thanks
> > > >> >
> > > >>
> > > >
> > >
> >
> >
> > --
> > With best regards, Ivan Kudryavtsev
> > Bitworks LLC
> > Cell RU: +7-923-414-1515
> > Cell USA: +1-201-257-1512
> > WWW: http://bitworks.software/ <http://bw-sw.com/>
> >
>

Re: CPU speed in service offering

Posted by Thomas Joseph <th...@gmail.com>.
A view table is readonly, the table named 'service_offering' would be the
one needs updating.

mysql> desc service_offering;
+--------------------+----------------------+------+-----+---------+----------------+
| Field              | Type                 | Null | Key | Default |
Extra          |
+--------------------+----------------------+------+-----+---------+----------------+
| id                 | bigint(20) unsigned  | NO   | PRI | NULL    |
auto_increment |
| cpu                | int(10) unsigned     | YES  |     | NULL
|                |
| speed              | int(10) unsigned     | YES  |     | NULL
|                |
| ram_size           | bigint(20) unsigned  | YES  |     | NULL
|                |
| nw_rate            | smallint(5) unsigned | YES  |     | 200
|                |
| mc_rate            | smallint(5) unsigned | YES  |     | 10
|                |
| ha_enabled         | tinyint(1) unsigned  | NO   |     | 0
|                |
| limit_cpu_use      | tinyint(1) unsigned  | NO   |     | 0
|                |
| host_tag           | varchar(255)         | YES  |     | NULL
|                |
| default_use        | tinyint(1) unsigned  | NO   |     | 0
|                |
| vm_type            | varchar(32)          | YES  |     | NULL
|                |
| sort_key           | int(32)              | NO   |     | 0
|                |
| is_volatile        | tinyint(1) unsigned  | NO   |     | 0
|                |
| deployment_planner | varchar(255)         | YES  |     | NULL
|                |
+--------------------+----------------------+------+-----+---------+----------------+
14 rows in set (0.00 sec)

regards,
Thomas

On Sat, Mar 2, 2019 at 8:28 PM Ivan Kudryavtsev <ku...@bw-sw.com>
wrote:

> CPU freq is per-core. The only way is to fix it in the database and next
> stop/start VMs.
>
> Here is the SQL expr like the following:
>
> update service_offering_view set limit_cpu_use=0 where name like 'abc%' and
> domain_path='/cde/';
>
> сб, 2 мар. 2019 г. в 15:11, Fariborz Navidan <md...@gmail.com>:
>
> > Also, how do I disable cpu cap for existing vms?
> >
> > On Sat, Mar 2, 2019 at 11:35 PM Fariborz Navidan <md...@gmail.com>
> > wrote:
> >
> > > Hi,
> > >
> > > Indeed I didn't realized the answer. The one we set in a service
> offering
> > > is allocated for each core or in total for whole the VM?
> > >
> > > On Sat, Mar 2, 2019 at 10:35 PM Ivan Kudryavtsev <
> > kudryavtsev_ia@bw-sw.com>
> > > wrote:
> > >
> > >> Actually, it works like everyone expects. In case of KVM you can just
> > take
> > >> a look at running instance with ps xa. But, I don't recommend setting
> > CPU
> > >> cap, though... VM will experience CPU steal, and users will not be
> > happy.
> > >> Better to deploy nodes with low cpu frequency and many cores.
> > >>
> > >> Without capping, the frequency is only for the resource calculation,
> > when
> > >> VMs are deployed, specifically:
> > >> node.core-freq > freq && aggregate-node-freq-avail - cores x freq > 0
> ->
> > >> permit
> > >>
> > >> сб, 2 мар. 2019 г., 13:51 Fariborz Navidan <md...@gmail.com>:
> > >>
> > >> > Hi,
> > >> >
> > >> > I am wondering how the cpu time usage is calculated for a VM. Is it
> in
> > >> per
> > >> > core basis or the total fraction of cpu a vm can use. For example,
> > when
> > >> we
> > >> > set 2 cores and 2000 MHz, the VM receives total of 2000MHz of
> 4000MHz
> > >> > processing power?
> > >> >
> > >> > Thanks
> > >> >
> > >>
> > >
> >
>
>
> --
> With best regards, Ivan Kudryavtsev
> Bitworks LLC
> Cell RU: +7-923-414-1515
> Cell USA: +1-201-257-1512
> WWW: http://bitworks.software/ <http://bw-sw.com/>
>

Re: CPU speed in service offering

Posted by Ivan Kudryavtsev <ku...@bw-sw.com>.
CPU freq is per-core. The only way is to fix it in the database and next
stop/start VMs.

Here is the SQL expr like the following:

update service_offering_view set limit_cpu_use=0 where name like 'abc%' and
domain_path='/cde/';

сб, 2 мар. 2019 г. в 15:11, Fariborz Navidan <md...@gmail.com>:

> Also, how do I disable cpu cap for existing vms?
>
> On Sat, Mar 2, 2019 at 11:35 PM Fariborz Navidan <md...@gmail.com>
> wrote:
>
> > Hi,
> >
> > Indeed I didn't realized the answer. The one we set in a service offering
> > is allocated for each core or in total for whole the VM?
> >
> > On Sat, Mar 2, 2019 at 10:35 PM Ivan Kudryavtsev <
> kudryavtsev_ia@bw-sw.com>
> > wrote:
> >
> >> Actually, it works like everyone expects. In case of KVM you can just
> take
> >> a look at running instance with ps xa. But, I don't recommend setting
> CPU
> >> cap, though... VM will experience CPU steal, and users will not be
> happy.
> >> Better to deploy nodes with low cpu frequency and many cores.
> >>
> >> Without capping, the frequency is only for the resource calculation,
> when
> >> VMs are deployed, specifically:
> >> node.core-freq > freq && aggregate-node-freq-avail - cores x freq > 0 ->
> >> permit
> >>
> >> сб, 2 мар. 2019 г., 13:51 Fariborz Navidan <md...@gmail.com>:
> >>
> >> > Hi,
> >> >
> >> > I am wondering how the cpu time usage is calculated for a VM. Is it in
> >> per
> >> > core basis or the total fraction of cpu a vm can use. For example,
> when
> >> we
> >> > set 2 cores and 2000 MHz, the VM receives total of 2000MHz of 4000MHz
> >> > processing power?
> >> >
> >> > Thanks
> >> >
> >>
> >
>


-- 
With best regards, Ivan Kudryavtsev
Bitworks LLC
Cell RU: +7-923-414-1515
Cell USA: +1-201-257-1512
WWW: http://bitworks.software/ <http://bw-sw.com/>

Re: CPU speed in service offering

Posted by Fariborz Navidan <md...@gmail.com>.
Also, how do I disable cpu cap for existing vms?

On Sat, Mar 2, 2019 at 11:35 PM Fariborz Navidan <md...@gmail.com>
wrote:

> Hi,
>
> Indeed I didn't realized the answer. The one we set in a service offering
> is allocated for each core or in total for whole the VM?
>
> On Sat, Mar 2, 2019 at 10:35 PM Ivan Kudryavtsev <ku...@bw-sw.com>
> wrote:
>
>> Actually, it works like everyone expects. In case of KVM you can just take
>> a look at running instance with ps xa. But, I don't recommend setting CPU
>> cap, though... VM will experience CPU steal, and users will not be happy.
>> Better to deploy nodes with low cpu frequency and many cores.
>>
>> Without capping, the frequency is only for the resource calculation, when
>> VMs are deployed, specifically:
>> node.core-freq > freq && aggregate-node-freq-avail - cores x freq > 0 ->
>> permit
>>
>> сб, 2 мар. 2019 г., 13:51 Fariborz Navidan <md...@gmail.com>:
>>
>> > Hi,
>> >
>> > I am wondering how the cpu time usage is calculated for a VM. Is it in
>> per
>> > core basis or the total fraction of cpu a vm can use. For example, when
>> we
>> > set 2 cores and 2000 MHz, the VM receives total of 2000MHz of 4000MHz
>> > processing power?
>> >
>> > Thanks
>> >
>>
>

Re: CPU speed in service offering

Posted by Fariborz Navidan <md...@gmail.com>.
Hi,

Indeed I didn't realized the answer. The one we set in a service offering
is allocated for each core or in total for whole the VM?

On Sat, Mar 2, 2019 at 10:35 PM Ivan Kudryavtsev <ku...@bw-sw.com>
wrote:

> Actually, it works like everyone expects. In case of KVM you can just take
> a look at running instance with ps xa. But, I don't recommend setting CPU
> cap, though... VM will experience CPU steal, and users will not be happy.
> Better to deploy nodes with low cpu frequency and many cores.
>
> Without capping, the frequency is only for the resource calculation, when
> VMs are deployed, specifically:
> node.core-freq > freq && aggregate-node-freq-avail - cores x freq > 0 ->
> permit
>
> сб, 2 мар. 2019 г., 13:51 Fariborz Navidan <md...@gmail.com>:
>
> > Hi,
> >
> > I am wondering how the cpu time usage is calculated for a VM. Is it in
> per
> > core basis or the total fraction of cpu a vm can use. For example, when
> we
> > set 2 cores and 2000 MHz, the VM receives total of 2000MHz of 4000MHz
> > processing power?
> >
> > Thanks
> >
>

Re: CPU speed in service offering

Posted by Ivan Kudryavtsev <ku...@bw-sw.com>.
Actually, it works like everyone expects. In case of KVM you can just take
a look at running instance with ps xa. But, I don't recommend setting CPU
cap, though... VM will experience CPU steal, and users will not be happy.
Better to deploy nodes with low cpu frequency and many cores.

Without capping, the frequency is only for the resource calculation, when
VMs are deployed, specifically:
node.core-freq > freq && aggregate-node-freq-avail - cores x freq > 0 ->
permit

сб, 2 мар. 2019 г., 13:51 Fariborz Navidan <md...@gmail.com>:

> Hi,
>
> I am wondering how the cpu time usage is calculated for a VM. Is it in per
> core basis or the total fraction of cpu a vm can use. For example, when we
> set 2 cores and 2000 MHz, the VM receives total of 2000MHz of 4000MHz
> processing power?
>
> Thanks
>