<div dir="ltr"><div><br></div><div>Hello Dmitriy Rabotyagov and Sean Mooney, very thank you for your sharing. </div><div><div dir="ltr" class="gmail_signature" data-smartmail="gmail_signature"><div dir="ltr">Nguyen Huu Khoi<br></div></div></div><br></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Thu, Mar 23, 2023 at 8:50 PM Nguyễn Hữu Khôi <<a href="mailto:nguyenhuukhoinw@gmail.com">nguyenhuukhoinw@gmail.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="auto"><div>Could you help me to explain how host cpu handle with cpu ratio?<br><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Thu, Mar 23, 2023, 7:10 PM Sean Mooney <<a href="mailto:smooney@redhat.com" target="_blank">smooney@redhat.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">generally you should not <br>
you can use it but the preferd way to do this is use<br>
cpu_shared_set and cpu_dedicated_set (in old releases you would have used vcpu_pin_set)<br>
<a href="https://docs.openstack.org/nova/latest/configuration/config.html#compute.cpu_shared_set" rel="noreferrer noreferrer" target="_blank">https://docs.openstack.org/nova/latest/configuration/config.html#compute.cpu_shared_set</a><br>
<a href="https://docs.openstack.org/nova/latest/configuration/config.html#compute.cpu_dedicated_set" rel="noreferrer noreferrer" target="_blank">https://docs.openstack.org/nova/latest/configuration/config.html#compute.cpu_dedicated_set</a><br>
<br>
if you dont need cpu pinning just use cpu_share_set to spcify the cores that can be sued for floatign vms<br>
when you use cpu_shared_set and cpu_dedicated_set any cpu not specified are reseved for host use.<br>
<br>
<a href="https://that.guru/blog/cpu-resources/" rel="noreferrer noreferrer" target="_blank">https://that.guru/blog/cpu-resources/</a> and <a href="https://that.guru/blog/cpu-resources-redux/" rel="noreferrer noreferrer" target="_blank">https://that.guru/blog/cpu-resources-redux/</a><br>
<br>
have some useful info but that mostly looking at it form a cpu pinning angel althoguh the secon one covers cpu_shared_set,<br>
<br>
the issue with usein <br>
<a href="https://docs.openstack.org/nova/latest/configuration/config.html#DEFAULT.reserved_host_cpus" rel="noreferrer noreferrer" target="_blank">https://docs.openstack.org/nova/latest/configuration/config.html#DEFAULT.reserved_host_cpus</a><br>
<br>
is that you have to multiple the number of cores that are resverved by the <br>
<a href="https://docs.openstack.org/nova/latest/configuration/config.html#DEFAULT.cpu_allocation_ratio" rel="noreferrer noreferrer" target="_blank">https://docs.openstack.org/nova/latest/configuration/config.html#DEFAULT.cpu_allocation_ratio</a><br>
<br>
which means if you decide to manage that via placement api by using <br>
<a href="https://docs.openstack.org/nova/latest/configuration/config.html#DEFAULT.initial_cpu_allocation_ratio" rel="noreferrer noreferrer" target="_blank">https://docs.openstack.org/nova/latest/configuration/config.html#DEFAULT.initial_cpu_allocation_ratio</a> instead<br>
then you need to update your nova.conf to modify the reservationfi you change the allocation ratio.<br>
<br>
if instead you use cpu_shared_set and cpu_dedicated_set<br>
you are specifying exactly which cpus nova can use and the allocation ration nolonger needs to be conisderd.<br>
<br>
in general you shoudl reserve the first core on each cpu socket for the host os.<br>
if you use hyperthreading then both hyperthread of the first cpu core on each socket shoudl be omitted<br>
form the cpu_shared_set and cpu_dedicated_set<br>
<br>
<br>
<br>
On Thu, 2023-03-23 at 14:44 +0700, Nguyễn Hữu Khôi wrote:<br>
> Hello guys.<br>
> I am trying google for nova host cpu reserve to prevent host overload but I<br>
> cannot find any resource about it. Could you give me some information?<br>
> Thanks.<br>
> Nguyen Huu Khoi<br>
<br>
</blockquote></div></div></div>
</blockquote></div>