VMware Cloud Community
kvAmarnath
Contributor
Contributor

How does CPU Allocation happens in VMWare Instance

Hi All,

I have been given a VMWare instance on which we have Windows Server 2003 running.

The specifications given to us is Intel Quad COre processors (2 processors) and they said 1.2 core has been allocated to us.

I have no Idea about this 1.2 core. Can anyone explain about this? I do remember that they said that I cam use a max of 60%.

I am running a test which is CPU intensive.

My one process is taking 30 minutes to complete.

So, I have run 2 processes which takes 30 minutes to complete when I run one after the other.

When I ran them simultaneously, both the processes completed in 1 hour (approx). But what still bothers me is each process took 1 hour to complete..

What is happening here...When I am having a 2 processors with 8 cores then why process is taking twice the time to complete.

Does this means that what has been assigned to me is equal to running on a dedicated machine with single processor.

The same is th case when I run 3 processes, each process is taking 1 1/2 hr to complete and 4 processes are ting 2 hours each to complete....

It would e really helpful if you can give your views and also share any links or documents about how the cpu allocation works in VMWare. I am new to VMWare and without knowing this information my testing will be of no use as I need to make more use of parallelism

0 Kudos
7 Replies
AsherN
Enthusiast
Enthusiast

Multi vCPU may actually slow things down in VMWare. The processes wait until 2 cores are available before running any instruction.

I don't get the 1.2 core and 60%

0 Kudos
Texiwill
Leadership
Leadership

Hello,

There is a direct map between the number of vCPUs in a VM and the cores they use. 1 vCPU - 1 Core, 2 vCPU - 2 Core, etc. THere is no way to get partial cores. What they may be referring to however, is CPU limits within your 'Resource Pool'. You may be limited as to how much CPU you can access at any given time.

If your application is multithreaded then multiple vCPUs make sense, otherwise they actually hurt things as described previously.

I would check your vCPU count from within the Guest, then verify if your app it multithreaded. If it is not, ask to go back to 1 vCPU. If it is multithreaded then I would ask what the resource limits are.


Best regards,
Edward L. Haletky VMware Communities User Moderator, VMware vExpert 2009

Now Available: 'VMware vSphere(TM) and Virtual Infrastructure Security'[/url]

Also available 'VMWare ESX Server in the Enterprise'[/url]

Blogging: The Virtualization Practice[/url]|Blue Gears[/url]|TechTarget[/url]|Network World[/url]

Podcast: Virtualization Security Round Table Podcast[/url]|Twitter: Texiwll[/url]

--
Edward L. Haletky
vExpert XIV: 2009-2023,
VMTN Community Moderator
vSphere Upgrade Saga: https://www.astroarch.com/blogs
GitHub Repo: https://github.com/Texiwill
0 Kudos
kvAmarnath
Contributor
Contributor

My application is CPU intensive and is multithreaded application.

What I could actually see are 2 CPU in the task manager...

I was only give information that I can use a max of 60%

We earlier had an AIX environment with 4 Processors (2 core each).

They did some calculation based on the Max Processor utilization, Cint Rate (not sure about this), Processor spec rate, they have arrived to 1.2 Core. I am still confused of it.

Now the problem I am facing is...

2 CPU I can see in task manager. Does that mean 2 physical processors or is it 2 vCPU which can be 2 cores assigned to this VM Instance?

Here depending on the number of CPU allocated to VMWare, I can either run 1 process with 2 thread (Parallel) or I can run 2 processes in serial.

I have tested both of them. In neither case, I am not at benefit.

1 process when run is taking 1/2 Hour.

2 processes running simultaneously is taking 1 hour for each process to complete.

Now, the Question is what could be wrong over here? I could see 2 CPUs, so even if 1 process runs in each CPU; The process should be completed in 45 mins (approx) considering that some amount of CPU will be used for other operations...

The other Question I have is, As I can see 2 CPUs, how much of it is eqivalent to in a dedicated system. is it one processor ?

I cannot decide on what is the problem which is causing for the double the time to complete the processes.

My understanding / assumption is that, I am basically utilizing the amount of processor which is equivalent to 1 processor on a physical-dedicated server ( my assumption si 2 cores)

0 Kudos
AsherN
Enthusiast
Enthusiast

I think I get it.

Based on the physical machine analysis, ir has been determined that you require 20 percent more power than a single core can deliver, so you have been assigned 2 cores but restricted to 60% of total available cycles.

Because the VM needs to wait for both processors, you don't use the extra 20%.

I'd ask for a single vCPU. As the host gets more loaded, that wait time will get longer

Serge Adam

Manager, Information Technology

277 Basaltic Road

Concord ON L4K 5V3

toll free: +1 (800) 545-5584 x2277

tel: +1 (905) 761-8004

mobile: +1 (416) 346-1611

fax: +1 (905) 695-0266

email: serge@fmed.com

http://www.futuremed.ca/

http://www.dismed.com/

kvAmarnath
Contributor
Contributor

THanks a lot for the information.

What I basically understood from your reply is..

The number of CPUs that I see in my guest are actually 2 cores and not a CPU.

Assigning a vCPU means an entire CPU (Processor) for the Guest.

So, If I have a server with 2 processors (4 cores), then assigning a vCPU means one entire processor. SO, I can use all four cores. Is my understanding right.

0 Kudos
AsherN
Enthusiast
Enthusiast

No. A vCPU is a single core

Serge Adam

Manager, Information Technology

277 Basaltic Road

Concord ON L4K 5V3

toll free: +1 (800) 545-5584 x2277

tel: +1 (905) 761-8004

mobile: +1 (416) 346-1611

fax: +1 (905) 695-0266

email: serge@fmed.com

http://www.futuremed.ca/

http://www.dismed.com/

0 Kudos
FrankIJskes
Contributor
Contributor

is on the right track.

But what can be done under AIX is not possible under VMware.

In AIX you get assigned a maximum cpu-load number and under heavy load, you get that. If more CPU is available and your process could benefit this, AIX gives you more cpu power.

VMware uses a totaly different design. Every virutal gets a schedule on which it can do its things. As soon as the virtual is scheduled in, it will get all the resources it was configured for. So 2 cpu's in your case. That would mean the vritual has to wait until 2 cpu's are free.If you

don't use the cpu's in that moment you will have wasted 2 cpu's in that

moment.. There is great documentation about the scheduling system, and we found that reducing all our virtuals from using 2 cpu's to 1, we got a performance boost on all virtuals. We then tuned some to get 1 additional cpu, and now our system is performing verynicely (if we did not use virtualizationour systems would be faster, but that would have cost way more)

I guess your vmware administrator thinks that by limiting your GHZ to the same it was under AIX, you will have the same performance.But this is not hte case.

If the vmware host is overloaded, you have some others issues to resolve. I suggestyou go back to the administrator and have him set you up to full usage or just 1 cpu. Really, if you scarsely need this second cpu, you will see an increased performancewhen going back to 1.

0 Kudos