Cores/Socket usage...

XZed

Member
Sep 20, 2009
74
0
6
Hello,

I was trying Proxmox w/ v1.3...

I never had too much time to study each function but i remember have read that :

"cpu number act as a ratio :

if you have 2 VM :

VM1 - CPU = 1

VM2 - CPU = 3

It means that :

If only one VM needs CPU, it can use 100% cpu host...

But let imagine that the 2 VM really need CPU resource, at this time :

VM1 = can't use more than 25% host cpu ( => ratio 1/(1+3) )

VM2 = can't use more than 75% host cpu ( => ratio 3/(1+3) )

So the cpu numbers used didn't refer to real physical host cpu but refer to a "ratio"

.

Now i decided to study deeply Proxmox and installed v1.4 so...

But now, the variable "cores/socket" appeared...

And it means this "ratio" function disappeared..

Let me explain :

I have 16 cores recognized by Proxmox on the physical host.

So i setup 2 vm with 4 cores each.

When i made cpu stress in order to have 100% cpu on all cores, in each VM :

Only 50% CPU of the physical cores are used (2 * 4 / 16)

It never uses all the physical cores % ....

So i tried to setup extra cores value (e.g : 16 cores for one vm and 8 cores for other vm) but vm became suddenly so slow...

Thank to explain me the cores mechanism... (perhaps i initially misunderstood the sockets functioning)...

Sincerely,
 
Now i decided to study deeply Proxmox and installed v1.4 so...

But now, the variable "cores/socket" appeared...

And it means this "ratio" function disappeared..

Why? cores*socket = numper of execution threads

So i setup 2 vm with 4 cores each.

When i made cpu stress in order to have 100% cpu on all cores, in each VM :

Only 50% CPU of the physical cores are used (2 * 4 / 16)

It never uses all the physical cores % ....

That is expected behavior. Same behaviour as before btw.

So i tried to setup extra cores value (e.g : 16 cores for one vm and 8 cores for other vm) but vm became suddenly so slow...

Never use more cores than you have!
 
Thanks for your answer dietmar.

But let me explain why all is "confused" for me :

i was already, previously, searching info about cpu units, etc...

And i found your previous post :

http://www.proxmox.com/forum/showthread.php?p=4647#post4647

So i remembered the "ratio" function for CPU variables...

And i also found this :

CPU Units is just a CPU priority parameter. Basicly, a VDS1 has a priority of 1000, a VDS2 has a priority of 2000, a VDS3 has a priority of 3000, and so forth. So, if there were only 2 VDS accounts on the entire server and they both had processes using 100% of the CPU, the VDS1 would get 25% of the CPU and the VDS3 would get 75% of the CPU (1000 + 3000 = 4000, 1000/4000=0.25, 3000/4000=0.75). But, not all VDS demand 100% of the CPU 100% of the time. So, a VDS1 could still get 100% of the CPU if no other VDS accounts on the system needed it, but that percentage would drop down as soon as another VDS needed the CPU.

(Source : http://forum.schmolie.com/index.php?showtopic=758 )

Le paramètre cpuunits n’empêche pas un serveur virtuel d’utiliser du temps CPU : si un serveur virtuel a besoin de temps CPU et qu’aucun autre n’en a besoin simultanément, OpenVZ accordera 100% du temps CPU au serveur qui en a besoin.

(Source : http://www.libresys.fr/2008/10/02/gerer-les-ressources-allouees-aux-serveurs-virtuels-openvz/ )

All these articles were confirmed by official documentation adviced in :

http://www.proxmox.com/forum/showthread.php?t=2230

And as you wrote on a previous post : that cpuunits had the same meaning for openvz and kvm, i applied it to my kvm vm...

Well, perhaps OpenVZ and KVM don't manage cores/socket parameter the same way...

So, finally you confirm me that for CPU or Memory :

i have to pre-allocate cpu/ram resources for each VM ?

(So no way to let a VM use "unused" resources ?)

Thanks again,

Sincerely,
 
By the way, question i would understand about core usage by proxmox :

Example given : i have 16 cores : i don't need to "reserve" at least one to PVE (but i suppose we need to do it for memory) ?
 
Well, perhaps OpenVZ and KVM don't manage cores/socket parameter the same way...

OpenVZ always use all cpus available. But --cpuunits are handled the same way.

i have to pre-allocate cpu/ram resources for each VM ?

Sorry, I don't understand that question.
 
Example given : i have 16 cores : i don't need to "reserve" at least one to PVE (but i suppose we need to do it for memory) ?

There is no need to reserve anything. Although, IMHO I would not overcommit a production system.
 
Ok,

I read many posts about overcommit and really want to try the experience :p...

I'm very sorry dietmar but i really think i read false things about cpu usage on kvm and it really confuse me...

To really resume what i understood.

Let's take a very simple example :

- server proxmox with 4 cores

- vm n°1 with 1 core setup

- vm n°2 with 1 core setup

(so 2 cores "free")

suppose vm n° 2 is idle (so quite no cpu usage)

and suppose that vm n°1 will run a task requiring 100% cpu usage.

what the various documentations suggest :

the vm n°1 will try to use all the 4 cores usage as no more resource is required by other vm (n°2) and as it's a "pain" to let 3 cores unused...

what you suggest :

the vm n°1 cpu usage will be limited to the number of cores setup (one in this example).

Your suggestion makes real sense to me but all of this became confuse to me when i began to read other documentations...
 
what the various documentations suggest :

the vm n°1 will try to use all the 4 cores usage...

I doubt that any documentation claims such thing.

what you suggest :

the vm n°1 cpu usage will be limited to the number of cores setup (one in this example).

1 core == 1 core
 
In what i quoted :

"CPU Units is just a CPU priority parameter. Basicly, a VDS1 has a priority of 1000, a VDS2 has a priority of 2000, a VDS3 has a priority of 3000, and so forth. So, if there were only 2 VDS accounts on the entire server and they both had processes using 100% of the CPU, the VDS1 would get 25% of the CPU and the VDS3 would get 75% of the CPU (1000 + 3000 = 4000, 1000/4000=0.25, 3000/4000=0.75). But, not all VDS demand 100% of the CPU 100% of the time. So, a VDS1 could still get 100% of the CPU if no other VDS accounts on the system needed it, but that percentage would drop down as soon as another VDS needed the CPU."

I thought that "100% of the CPU" referred to the global cores unified (all cores summed)...

OK, thank you,

Sincerely,