[nova]host cpu reserve

Nguyễn Hữu Khôi nguyenhuukhoinw at gmail.com
Thu Mar 23 13:57:42 UTC 2023


Hello Dmitriy Rabotyagov and Sean Mooney, very thank you for your sharing.
Nguyen Huu Khoi


On Thu, Mar 23, 2023 at 8:50 PM Nguyễn Hữu Khôi <nguyenhuukhoinw at gmail.com>
wrote:

> Could you help me to explain how host cpu handle with cpu ratio?
>
> On Thu, Mar 23, 2023, 7:10 PM Sean Mooney <smooney at redhat.com> wrote:
>
>> generally you should not
>> you can use it but the preferd way to do this is use
>> cpu_shared_set and cpu_dedicated_set (in old releases you would have used
>> vcpu_pin_set)
>>
>> https://docs.openstack.org/nova/latest/configuration/config.html#compute.cpu_shared_set
>>
>> https://docs.openstack.org/nova/latest/configuration/config.html#compute.cpu_dedicated_set
>>
>> if you dont need cpu pinning just use cpu_share_set to spcify the cores
>> that can be sued for floatign vms
>> when you use cpu_shared_set and cpu_dedicated_set any cpu not specified
>> are reseved for host use.
>>
>> https://that.guru/blog/cpu-resources/ and
>> https://that.guru/blog/cpu-resources-redux/
>>
>> have some useful info but that mostly looking at it form a cpu pinning
>> angel althoguh the secon one covers cpu_shared_set,
>>
>> the issue with usein
>>
>> https://docs.openstack.org/nova/latest/configuration/config.html#DEFAULT.reserved_host_cpus
>>
>> is that you have to multiple the number of cores that are resverved by
>> the
>>
>> https://docs.openstack.org/nova/latest/configuration/config.html#DEFAULT.cpu_allocation_ratio
>>
>> which means if you decide to manage that via placement api by using
>>
>> https://docs.openstack.org/nova/latest/configuration/config.html#DEFAULT.initial_cpu_allocation_ratio
>> instead
>> then you need to update your nova.conf to modify the reservationfi you
>> change the allocation ratio.
>>
>> if instead you use cpu_shared_set and cpu_dedicated_set
>> you are specifying exactly which cpus nova can use and the allocation
>> ration nolonger needs to be conisderd.
>>
>> in general you shoudl reserve the first core on each cpu socket for the
>> host os.
>> if you use hyperthreading then both hyperthread of the first cpu core on
>> each socket shoudl be omitted
>> form the cpu_shared_set and cpu_dedicated_set
>>
>>
>>
>> On Thu, 2023-03-23 at 14:44 +0700, Nguyễn Hữu Khôi wrote:
>> > Hello guys.
>> > I am trying google for nova host cpu reserve to prevent host overload
>> but I
>> > cannot find any resource about it. Could you give me some information?
>> > Thanks.
>> > Nguyen Huu Khoi
>>
>>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.openstack.org/pipermail/openstack-discuss/attachments/20230323/6dd98c7c/attachment.htm>


More information about the openstack-discuss mailing list