Oracle and Virtual CPU's

2014-02-04 Thread KarlKingston
Running Oracle 11 on Linux on z.   Z/VM LPAR assigned 4 IFL's.

We have a linux guest that got really busy for about 10-15 minutes
nightly.   Oracle process. Guest has 2 virtual CPU's defined.

1) Our Oracle DBA (consultant and I believe he is coming from an intel
world) says we need more CPU's.   I say no.   Who's right and why?

2) on another guest on the same LPAR, we have 4 CPU's defined just to run
Oracle (for PeopleSoft).  I've never seen the CPU's 250% (out of 400%).
Should we drop it down to 3 (The oracle DBA says no and wants more).

Thanks!




--
For LINUX-390 subscribe / signoff / archive access instructions,
send email to lists...@vm.marist.edu with the message: INFO LINUX-390 or visit
http://www.marist.edu/htbin/wlvindex?LINUX-390
--
For more information on Linux on System z, visit
http://wiki.linuxvm.org/


Re: Oracle and Virtual CPU's

2014-02-04 Thread David Boyes
 We have a linux guest that got really busy for about 10-15 minutes
 nightly.   Oracle process. Guest has 2 virtual CPU's defined.
 
 1) Our Oracle DBA (consultant and I believe he is coming from an intel
 world) says we need more CPU's.   I say no.   Who's right and why?

This is not a problem unique to VM -- VMWare and Xen suffer the same issue.

You're both partially right. The workload may need more REAL CPUs (in that 
there may not be enough real cycles available to meet the demand at a point in 
time), but defining more virtual CPUs will probably make the problem worse 
(your dispatch timeslice for the whole virtual machine is divided as equally as 
possible between the # of virtual CPUs defined, so defining more virtual CPUs 
actually DECREASES the amount of processing time available to each virtual CPU 
per timeslice). It also depends a lot on what the Oracle instance is being 
asked to do - some activities in Oracle aren't really very MP-friendly, so even 
if you DID add the virtual CPUs, it wouldn't make any difference because the 
code won't care (the task is scheduled on a virtual CPU and just runs until the 
timeslice is exhausted). If you have lots of tasks like that, the number of 
CPUs is irrelevant; the code is only going to use one at a time. 

Monitor data on the VM side will tell you more about how the real CPUs are 
being used in total; the performance data inside the VM will tell you how Linux 
is allocating workload to the virtual CPUs it sees, but that data alone is 
totally unreliable for capacity planning. It can only reliably see the division 
of labor, not the overall available machine usage. 

 2) on another guest on the same LPAR, we have 4 CPU's defined just to run
 Oracle (for PeopleSoft).  I've never seen the CPU's 250% (out of 400%).
 Should we drop it down to 3 (The oracle DBA says no and wants more).

See above. If he's just looking at data from inside the virtual machine, more 
virtual CPUs make the problem worse. 

Ask him what the problem workload is. If it's single long-running queries 
(Peoplesoft does a lot of those, and they're often stupidly constructed), more 
CPUs won't help. He'll likely get more bang for the buck optimizing the queries 
or adding indexes, but that's more work for him. 

--
For LINUX-390 subscribe / signoff / archive access instructions,
send email to lists...@vm.marist.edu with the message: INFO LINUX-390 or visit
http://www.marist.edu/htbin/wlvindex?LINUX-390
--
For more information on Linux on System z, visit
http://wiki.linuxvm.org/


Re: Oracle and Virtual CPU's

2014-02-04 Thread Stewart, Lee
Oracle DBA == more
;-)

Lee Stewart ● VM System Support ● Visa ● Phone:  6(750)4601 - +1-303-389-4601 ● 
lstew...@visa.com

-Original Message-
From: Linux on 390 Port [mailto:LINUX-390@VM.MARIST.EDU] On Behalf Of 
karlkings...@ongov.net
Sent: Tuesday, February 04, 2014 9:23 AM
To: LINUX-390@VM.MARIST.EDU
Subject: Oracle and Virtual CPU's

Running Oracle 11 on Linux on z.   Z/VM LPAR assigned 4 IFL's.

We have a linux guest that got really busy for about 10-15 minutes
nightly.   Oracle process. Guest has 2 virtual CPU's defined.

1) Our Oracle DBA (consultant and I believe he is coming from an intel
world) says we need more CPU's.   I say no.   Who's right and why?

2) on another guest on the same LPAR, we have 4 CPU's defined just to run 
Oracle (for PeopleSoft).  I've never seen the CPU's 250% (out of 400%).
Should we drop it down to 3 (The oracle DBA says no and wants more).

Thanks!




--
For LINUX-390 subscribe / signoff / archive access instructions, send email to 
lists...@vm.marist.edu with the message: INFO LINUX-390 or visit
http://www.marist.edu/htbin/wlvindex?LINUX-390
--
For more information on Linux on System z, visit http://wiki.linuxvm.org/

--
For LINUX-390 subscribe / signoff / archive access instructions,
send email to lists...@vm.marist.edu with the message: INFO LINUX-390 or visit
http://www.marist.edu/htbin/wlvindex?LINUX-390
--
For more information on Linux on System z, visit
http://wiki.linuxvm.org/


Re: Oracle and Virtual CPU's

2014-02-04 Thread Ivica Brodaric
On Wed, Feb 5, 2014 at 5:49 AM, David Boyes dbo...@sinenomine.net wrote:

 your dispatch timeslice for the whole virtual machine is divided as
 equally as possible between the # of virtual CPUs defined, so defining more
 virtual CPUs actually DECREASES the amount of processing time available to
 each virtual CPU per timeslice


That is not really correct. If that was true, you'd never be able to go
over 100%. Each virtual CPU is separately dispatchable and competes with
all other VCPUs from all other guests for a timeslice on a logical
processor. SHARE value is taken into account by dispatcher to determine the
relative priority of all VCPUs for that guest. That will determine how
often in a given period of time will that guest get a timeslice on any of
its VCPUs. If you want to turn single-VCPU guest into a multi-VCPU one, you
need to multiply the relative SHARE value by the number of VCPUs that you
defined for a guest in hope that each VCPU gets about the same number of
timeslices in a given period of time as the single one was getting on a
single-VCPU guest.

Adding a virtual CPUs to a guest increases the ratio of total number of
VCPUs per logical processor and puts unnecessary burden on dispatcher if it
(additional VCPU) is not effectively used. There is a finite number of time
slices on all logical processors put together and with more VCPUs, the
competition for those timeslices is higher. You should add another VCPU to
a guest only if the processes running in it can effectively use it.

Let's not forget that if you run in a LPAR that uses shared physical
processors, then LPAR's logical processors compete for a timeslice (or
running time) on a physical processor with other LPARs that use shared
processors. CPU percentages may be misleading in that environment unless
you have a good monitoring tool. CPU seconds per minute may be a better
gauge.

Ivica Brodaric

--
For LINUX-390 subscribe / signoff / archive access instructions,
send email to lists...@vm.marist.edu with the message: INFO LINUX-390 or visit
http://www.marist.edu/htbin/wlvindex?LINUX-390
--
For more information on Linux on System z, visit
http://wiki.linuxvm.org/