Ask Your Question
2

vCPU vs Physical CPU

asked 2013-08-19 00:41:36 -0500

How does OpenStack/KVM set the number of vCPUs based on the physical CPU on the physical machine?

In my case, I have two different model of Intel CPU, Xeon E5645 and Xeon E5-2690 for my compute-node servers:

I checked Intel website, there is 6 cores in Xeon E5645 while Xeon E5-2690 has 8 cores.

In the 'compute_nodes' table, it shows that there are 12 vCPU for the machine with Xeon E5645; whereas there are 16 vCPU in Xeon E5-2690.

--> It seems that the ratio is 1:2

How does it calculate?

Can I adjust it?

edit retag flag offensive close merge delete

Comments

Please rephrase the title into a question.

Stenstad gravatar imageStenstad ( 2013-08-19 03:09:10 -0500 )edit

what do you suggest? I have no idea!

brucelok gravatar imagebrucelok ( 2013-08-19 03:23:37 -0500 )edit

3 answers

Sort by ยป oldest newest most voted
6

answered 2013-08-19 03:01:16 -0500

Stenstad gravatar image

updated 2013-08-19 03:06:18 -0500

vCPUs are calculated based on what is reported in /proc/cpuinfo. You have hyperthreading enabled, thus you have X physical CPUs * Y cores * 2.

From what I've read, enabling hyperthreading is recommended on compute nodes, so your numbers seem fine.

This presentation explains a bit about overbooking:

http://www.slideshare.net/stackops/stackops-openstack-nova-sizing-service-definition

Also look at the "cpu_allocation_ration" option in nova.conf:

http://docs.openstack.org/trunk/openstack-compute/admin/content/corefilter.html

edit flag offensive delete link more

Comments

Thank you so much!

brucelok gravatar imagebrucelok ( 2013-08-19 03:11:01 -0500 )edit
1

answered 2018-06-20 06:34:41 -0500

chaman bharti gravatar image

You can print lscpu from the compute node, you will see below output as below:

[root@compute ~]# lscpu
Architecture:          x86_64
CPU op-mode(s):        32-bit, 64-bit
Byte Order:            Little Endian
CPU(s):                40
On-line CPU(s) list:   0-39
Thread(s) per core:    2
Core(s) per socket:    10
Socket(s):             2
NUMA node(s):          2
Vendor ID:             GenuineIntel

So CPU(s): is the vCPUs in Openstack.

Formula for calculation is as follows:

vCPUs=`Thread(s) per core * Core(s) per socket * Socket(s)

ie. vCPUs=2*10*2

However overcommited vCPU will be calculated as following:

 "OverCommited vCPU" = vCPU*OverCommitmentRatio

ie "OverCommited vCPU" = 40*16= 640

edit flag offensive delete link more
0

answered 2015-02-09 11:53:16 -0500

nutshi gravatar image

thanks ..http://docs.openstack.org/trunk/openstack-compute/admin/content/corefilter.html is not working

BTW here is a handy calculator for that https://www.mirantis.com/openstack-se...

edit flag offensive delete link more

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Get to know Ask OpenStack

Resources for moderators

Question Tools

1 follower

Stats

Asked: 2013-08-19 00:41:36 -0500

Seen: 15,624 times

Last updated: Jun 20 '18