This forum is currently locked. You can't register or post questions at this time. (read more)

Resource manager in shared CPU environment

All posts relating to Oracle database administration.

Moderator: Tim...

kwilson2013
Member
Posts: 5
Joined: Fri Apr 26, 2013 6:57 pm

Resource manager in shared CPU environment

Postby kwilson2013 » Fri Apr 26, 2013 7:31 pm

I was wondering if anyone had any experience with Oracle Database Resource Manager (ODRM) in a shared CPU environment. My understanding is that ODRM sees the system as 100% by comparing the active sessions that are requesting CPU to the cpu count parameter. Therefore, if you have the CPU_COUNT paramter set to 100, ODRM will not "kick in" until there are 100 active sessions requesting CPU on the database.

Resource Manager manages CPU usage by controlling the database load to a very precise level.
By default, this level is set to the number of CPUs. That means that on a 4 CPU server,
Resource Manager ensures that no more than 4 Oracle processes (more specifically, foregrounds
and non-critical, CPU-intensive backgrounds) are running at a time. By controlling the database
load, critical backgrounds are able to run in a timely manner and the load on the server is
regulated.


The above quote is from article: http://www.oracle.com/technetwork/datab ... 133705.pdf

My question is, how does ODRM handle a shared CPU environment among multiple LPARS? If the same workload (90 active sessions requesting cpu) on 100 CPUs the system is only 90% utilized (relatively good utilization) and ODRM is not kicked in. However the system could see that a different LPAR needs CPUs out of the pool. Now the same workload (90 active sessions requesting cpu) is running on 80 CPUS. This scenario has the system theoretically at 112% utilized (90 active sessions / 80 CPUs). Can ODRM recognize this as a fully utilized system or is this a system loophole that ODRM can not help with?

i am currently running Oracle 11.2.03.3. IBM 6.1 power 7 AIX 64 bit. With multiple LPARs with variable CPUs

Tim...
Site Admin
Posts: 18437
Joined: Mon Nov 01, 2004 5:56 pm
Location: England, UK
Contact:

Re: Resource manager in shared CPU environment

Postby Tim... » Fri Apr 26, 2013 10:05 pm

Hi.

I can't speak specifically of AIX and LPARs, but yes, Oracle will use all CPUs available on the physical box, or vCPUs on the VM, unless you tell it not to. You can limit it using instance caging.

http://www.oracle-base.com/articles/11g ... -11gr2.php

Cheers

Tim...
Tim...
Oracle ACE Director
Oracle ACE of the Year 2006 - Oracle Magazine Editors Choice Awards
OakTable Member
OCP DBA 7.3, 8, 8i, 9i, 10g, 11g
OCP Advanced PL/SQL Developer
Oracle Database: SQL Certified Expert
My website: http://www.oracle-base.com
My blog: http://www.oracle-base.com/blog

kwilson2013
Member
Posts: 5
Joined: Fri Apr 26, 2013 6:57 pm

Re: Resource manager in shared CPU environment

Postby kwilson2013 » Mon Apr 29, 2013 2:43 pm

Thanks Tim for your reply. i am really wondering about the CPU management parameter within Oracle Database Resource Manager (ODRM)rather than instance caging. For example, if i say consumer_group_x gets 30% and consumer_group_y gets 70% of the CPU resources. ODRM "guarantees" these percentages when the active sessions requesting CPU equals the CPU_COUNT initialization parameter. I am really questioning if ODRM will guarantee these percentages when there are not enough CPUs for a particular LPAR to get to the CPU_COUNT parameter.

Tim...
Site Admin
Posts: 18437
Joined: Mon Nov 01, 2004 5:56 pm
Location: England, UK
Contact:

Re: Resource manager in shared CPU environment

Postby Tim... » Mon Apr 29, 2013 3:39 pm

Hi.

Resource manager only comes into effect when CPU usage is maxed out, so there is not control of CPU (apart from instance caging), when the machine is not stressed.

With respect to instance caging, as mentioned in the article, this scales down all the percentages for normal resource consumer groups. If the physical machine has 8 cores and you use instance caging to limit the instance to 4 cores, specifying 50% in a consumer group means 2 cores, not 4, because it is based on the caged value, not on the total number available to the host.

Like I said before, I have no experience of LPARs, so I couldn't eve tell you what number of cores the LPAR sees, so I don;t have an idea of the impact of instance caging in this configuration.

Cheers

Tim...
Tim...
Oracle ACE Director
Oracle ACE of the Year 2006 - Oracle Magazine Editors Choice Awards
OakTable Member
OCP DBA 7.3, 8, 8i, 9i, 10g, 11g
OCP Advanced PL/SQL Developer
Oracle Database: SQL Certified Expert
My website: http://www.oracle-base.com
My blog: http://www.oracle-base.com/blog

kwilson2013
Member
Posts: 5
Joined: Fri Apr 26, 2013 6:57 pm

Re: Resource manager in shared CPU environment

Postby kwilson2013 » Mon Apr 29, 2013 7:33 pm

Thank you for the quick reply.

I believe ODRM can control cpu usage by consumer group with the mgmt_p1 - mgmt_p8 parameters within the resource manager plan. But i maybe misunderstanding. As you see my understanding above in my last post, if i am misunderstanding can you explain what the mgmt_p1 - mgmt_p8 parameters do?

Management Attributes

Management attributes enable you to specify how CPU resources are to be allocated among consumer groups and subplans. Multiple levels of CPU resource allocation (up to eight levels) provide a means of prioritizing CPU usage within a plan. Consumer groups and subplans at level 2 get resources that were not allocated at level 1 or that were allocated at level 1 but were not completely consumed by the consumer groups or subplans at level 1. Similarly, resource consumers at level 3 are allocated resources only when some allocation remains from levels 1 and 2. The same rules apply to levels 4 through 8. Multiple levels not only provide a way of prioritizing, but they provide a way of explicitly specifying how all primary and leftover resources are to be used.

Use the management attributes MGMT_Pn, where n is an integer between 1 and 8, to specify multiple levels of CPU resource allocation. For example, use the MGMT_P1 directive attribute to specify CPU resource allocation at level 1 and MGMT_P2 directive attribute to specify resource allocation at level 2.

Use management attributes with parallel statement directive attributes, such as Degree of Parallelism Limit and Parallel Target Percentage, to control parallel statement queuing. When parallel statement queuing is used, management attributes are used to determine which consumer group is allowed to issue the next parallel statement. For example, if you set the MGMT_P1 directive attribute for a consumer group to 80, that group has an 80% chance of issuing the next parallel statement.


the above quote is from the administrator's guide on oracle 11.2.0.3

http://docs.oracle.com/cd/E11882_01/server.112/e25494/dbrm003.htm#CHDBFGGD

Tim...
Site Admin
Posts: 18437
Joined: Mon Nov 01, 2004 5:56 pm
Location: England, UK
Contact:

Re: Resource manager in shared CPU environment

Postby Tim... » Mon Apr 29, 2013 11:06 pm

Hi.

I'm not sure what you are asking, or misunderstanding...

Let's ignore LPARs and instance caging for the moment...

When using resource manager, you can control how CPU is prioritised *within* the instance. The important thing to remember here is resource manager only kicks in when the CPU is under stress. If the system is running at less than 100%, the resource manager does nothing because the system is not CPU bound. Here is the quote,

"The currently active resource plan does not enforce allocations until CPU usage is at 100%. If the CPU usage is below 100%, the database is not CPU-bound and hence there is no need to enforce allocations to ensure that all sessions get their designated resource allocation."


http://docs.oracle.com/cd/E11882_01/ser ... m#i1007556

So if the machine has 8 cores, resource manager will only kick in when that whole machine is being hammered!

If I want resource manager to kick in earlier, I have to limit the total amount of CPU available to the instance. I can do this with instance caging. If I limit the instance to 4 cores, the resource manager will kick in when the 4 cores used by the instance are at 100%.

Instance caging prioritises one instance over another. Resource manager prioritises the processes within the instance, relative to each other.

As I've said before, I know nothing about LPARs, so I can't comment how resource manager interacts with them. If an LPAR can see all cores on the physical hardware, then resource manager will not kick in until all cores are maxed. If the instance within the LPAR can only see a subset of the total cores, the resource manager will kick in earlier.

So instance caging prevents a single instance using more than the allocated cores. Resource manager only kicks in when the instance is using the maximum CPU it is iallowed to use, and then will prioritise the work within the instance.

If you are focusing on resource manager within the instance, you can allocate sessions to consumer groups, each with a different proportion of CPU, so you can assign relative priorities to groups of sessions. That is what the management attributes are for, but like I keep saying, they are all within the instance...

Cheers

Tim...
Tim...
Oracle ACE Director
Oracle ACE of the Year 2006 - Oracle Magazine Editors Choice Awards
OakTable Member
OCP DBA 7.3, 8, 8i, 9i, 10g, 11g
OCP Advanced PL/SQL Developer
Oracle Database: SQL Certified Expert
My website: http://www.oracle-base.com
My blog: http://www.oracle-base.com/blog

kwilson2013
Member
Posts: 5
Joined: Fri Apr 26, 2013 6:57 pm

Re: Resource manager in shared CPU environment

Postby kwilson2013 » Tue Apr 30, 2013 3:12 pm

Sorry Tim for the confusion.

In our AIX LPAR configuration, our primary production box, p1, is guaranteed 20 CPUs (80 cores) and has the ability to grow to 25 CPUs (100 cores). on our second server, p2, is guaranteed 10 CPUs (40 cores) and can grow to 15 CPUs (60 cores). i have each instance's cpu_count initialization parameter set to the max cores.

In this configuration, p1 is able to grow to its max ,25 CPUs, when p2 is not busy, and vice versa, p2 is able to grow to its max, 15 CPUs, when p1 is not busy. However, if both are busy, neither p1 or p2 can grow to its max and both can only get what is guaranteed.

I am really asking, how does ODRM define a 100% utilized system. Is it based off how many CPUs are available or a fixed amount?

If the answer to the above question is a fixed amount, then Oracle will only see the system as 100% busy when all 100 cores are busy. so if only 80 cores are available and all 80 cores are active, Oracle will still only see this as 80%. (80/100)

If the answer to the above question is what is available, then Oracle will see the system as busy when all available cores are busy regardless whether the available CPUs are 100 or 80. So if only 80 cores are available and all 80 cores are active. Oracle will still see this as 100%. (80/80)



so back to ODRM........

So like my I said my understanding is that Oracle sees a server as being 100% fully utilized when the number of active sessions requesting cpu equal the value of the cpu_count initialization parameter. So for server p1, 100 sessions need to request CPU in order for ODRM to see the box is hammered and will begin allocating CPUs to the consumer group as specified in the mgmt_p1 - mgmt_p2 parameters within the resource plan. The same applies to the server, p2. However, on p2, only 60 active sessions requesting CPUs are needed for ODRM to recognize a fully utilized server. If the sessions are below the cpu_count, ODRM will not kick in and each consumer group will use as much CPU as needed.

To further my example, if p1 is able to get all 100 cores but only has 90 active sessions requesting CPUs. ODRM sees the box as only 90% utilized and does not need to allocate the CPUs as specified in the mgmt_p1 - mgmt_p2 parameters.

However, in the LPAR configuration, server p1 is not guaranteed 100 cores it is only guaranteed 80 cores. If p1 can only get the guaranteed 80 cores but still maintain the same workload, 90 active sessions requesting CPUs. As far as ODRM calculations are concerned, the box is still 90% utilized (90 active sessions / 100 cpu count) and the box is not "hammered" and less than 100% utilized. But the box is really ~113% utilized (90 active sessions / 80 cores). So in this scenario, does ODRM start prioritizing CPUs as specified in the mgmt_p1 - mgmt_p2 parameters within the resource plan?

Tim...
Site Admin
Posts: 18437
Joined: Mon Nov 01, 2004 5:56 pm
Location: England, UK
Contact:

Re: Resource manager in shared CPU environment

Postby Tim... » Tue Apr 30, 2013 4:16 pm

Hi.

From what you've said, it sounds to me like resource manager will almost never be in a position to see the LPAR at 100%, so it will never kick in and manage your resources. If the database has a CPU count of 25, then resource manager will only kick in when all 25 are being hammered. If the machine is busy, so only 20 are available, resource manager will not know this.

I think you really need to confirm this with Oracle support, as they can probably point you at some AIX specific cases. It is possible they will recommend a best practice for this type of configuraiton.

Cheers

Tim...
Tim...
Oracle ACE Director
Oracle ACE of the Year 2006 - Oracle Magazine Editors Choice Awards
OakTable Member
OCP DBA 7.3, 8, 8i, 9i, 10g, 11g
OCP Advanced PL/SQL Developer
Oracle Database: SQL Certified Expert
My website: http://www.oracle-base.com
My blog: http://www.oracle-base.com/blog

kwilson2013
Member
Posts: 5
Joined: Fri Apr 26, 2013 6:57 pm

Re: Resource manager in shared CPU environment

Postby kwilson2013 » Tue Apr 30, 2013 4:48 pm

yes that is what i am think too...Thank you very much for your quick replies and your patience.

Tim...
Site Admin
Posts: 18437
Joined: Mon Nov 01, 2004 5:56 pm
Location: England, UK
Contact:

Re: Resource manager in shared CPU environment

Postby Tim... » Tue Apr 30, 2013 5:23 pm

No problem. :)
Tim...
Oracle ACE Director
Oracle ACE of the Year 2006 - Oracle Magazine Editors Choice Awards
OakTable Member
OCP DBA 7.3, 8, 8i, 9i, 10g, 11g
OCP Advanced PL/SQL Developer
Oracle Database: SQL Certified Expert
My website: http://www.oracle-base.com
My blog: http://www.oracle-base.com/blog


Return to “Oracle Database Administration”

Who is online

Users browsing this forum: No registered users and 3 guests

cron