[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Xen-users] CPU scheduling and allocated all VCPU.



On 02/07/14 02:18, Sophie wrote:

On 2014-07-01 14:32, Austin S Hemmelgarn wrote:

On 2014-07-01 08:07, Sophie wrote:
Hi, We have lots of virtual machines running our Oracle Virtual Manager setup ( Oracle Linux with Xen) on x86. When I've setup new VMs I've always assigned CPUs to them instead of sharing them because all our VMs run RHEL and Oracle 11g. In my opinion this ensures they have all CPU cycles dedicated without any chance they'll be starved. Their combined SGA and PGA usually total 3Gb and I've allocated 4Gb of dedicated RAM. Our DBA team, who were new to XEN and visualization seem to have a heightened interest in XEN and have asked me this: ** Why don't we allocated 32 VCPUS to all virtual machines so that they can share all resources and when they need CPUs they can access those that were sitting idle ** Their logic was VCPUs could be better distributed like this. My question to you is what do you think? Thanks, Sophie
I think that they have failed to understand that when you don't bind
VCPUs to physical CPUs, xen automatically load-balances the VCPUs
dynamically.  Personally, I would keep the same number of VCPUs assigned
to each VM, but not pin them to specific physical CPUs (with the notable
exception of giving Domain-0 pinned VCPUs, and making sure that the VM's
don't run on those physical CPUs).  In my experience, this tends to get
better performance with I/O heavy workloads such as most database work.
 I would not, however, suggest over-provisioning VCPUs by more than
twice the number of physical CPUs.

From available 64 pCPU assign 4 vCPU to each of 15 VM, (and 4 pCPU to dom0), so that all pCPU are allocated (an example of what you do now).
At any one time, 10 pCPU could be idle, this is the same problem with using 15 physical machines each with a single 4 core CPU.
Maybe better to allocate 6vCPU to each of 15VM (sharing pCPU 4-63), with 4vCPU to dom0 (dedicated pCPU 0-3). Now instead of 10 idle pCPU, the really busy VM's can use the spare pCPU's, but no single VM can steal all available CPU time. Unless of course all of your VM's are 100% busy at the same time, then you might degrade performance.

I have seen the argument that it might be better to use the xen cpu credit scheduler as a more fine grained approach to sharing pCPU's, but I've never actually used that.

BTW, I collect the value for CPU time from xm list every few minutes. If CPU time used is 500 seconds in the last 5 minutes, and I allocated 4 vCPU's, then I see the actual CPU consumption is 500/300 or on average, only 1.7 CPU's was required. Doing this can help you see which VM's might benefit from more available pCPU's, or really don't need the number you have already allocated.

If I have 4 VM's that use only 10 seconds CPU time per 5 minutes, I can easily allocate all 4 to a single pCPU ... etc.

Regards,
Adam

--
Adam Goryachev Website Managers www.websitemanagers.com.au
_______________________________________________
Xen-users mailing list
Xen-users@xxxxxxxxxxxxx
http://lists.xen.org/xen-users

 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.