###################################################
## How to implement Oracle Instance Caging ##
###################################################
Instance Caging allows to dynamically limit the amount of CPUs used by each database instance. This option is specifically thought for shared environments where the database administrator has to guarantee resources to all the instances running on the same hardware.
-- Enable Resource Manager:
ALTER SYSTEM SET RESOURCE_MANAGER_PLAN = 'REAL_TIME_PLAN'; --or ALTER SYSTEM SET RESOURCE_MANAGER_PLAN = 'FORCE:REAL_TIME_PLAN';
FORCE option prevents that the scheduler window activates a different plan during the job execution.
For more info about Resource Manager visit ResourceManager Blog
-- Enable Instance Caging: ALTER SYSTEM SET CPU_COUNT=4 SCOPE=BOTH SID='*';
###################################################
## Instance Caging Test ##
###################################################
Hardware SUN 8 Cores 64 Threads
One test database capped to 16 CPU – 25% of total hardware capacity.
ALTER SYSTEM SET RESOURCE_MANAGER_PLAN = 'default_plan'; ALTER SYSTEM SET cpu_count=16 scope=both sid='*'; The load generator opens 70 sessions producing intensive CPU activity, which as shown by the reports below do not exceed the 25% od the total server capacity (%Usr column). Core Utilization for Integer pipeline Core,Int-pipe %Usr %Sys %Usr+Sys ------------- ------ ------ -------- 0,0 21.92 3.99 25.91 0,1 24.58 2.08 26.66 1,0 23.16 2.27 25.43 1,1 24.06 2.64 26.71 2,0 22.73 3.03 25.76 2,1 23.47 3.02 26.49 3,0 23.56 2.86 26.42 3,1 24.71 2.87 27.58 4,0 23.53 2.07 25.60 4,1 24.87 2.92 26.79 5,0 24.98 2.87 27.85 5,1 24.76 3.81 28.57 6,0 23.53 4.11 27.64 6,1 23.99 3.14 27.13 7,0 24.72 3.55 28.26 7,1 22.62 3.59 26.21 ------------- ------ ------ ------ Avg 22.36 3.05 25.41 If on the Wait Events is present "resmgr:cpu quantum", it means that Instance Caging throttled the amount of CPUs available to the system. INST_ID SID SQL_ADDR EVENT WAIT_CLASS STATE WAIT_MICRO REMAING TOT_TIME LAST_WAIT ------- ------ ---------------- ------------------------------ --------------- ------------------ ---------- ---------- ---------- ---------- 1 676 000000047ECC5BD0 resmgr:cpu quantum Scheduler WAITED KNOWN TIME 11599 11599 43834 2 624 000000047D7D38D0 resmgr:cpu quantum Scheduler WAITED KNOWN TIME 11599 11599 43834 2 395 000000047BCA97A8 resmgr:cpu quantum Scheduler WAITING 11669 -1 11668 0 1 300 000000047C8D6B38 resmgr:cpu quantum Scheduler WAITED KNOWN TIME 11677 11677 589 2 317 00 resmgr:cpu quantum Scheduler WAITED KNOWN TIME 11677 11677 589 1 649 000000047ECC5BD0 resmgr:cpu quantum Scheduler WAITING 14445 -1 14444 0 2 676 000000047D7D38D0 resmgr:cpu quantum Scheduler WAITING 14445 -1 14444 0 1 148 000000047C8D6B38 resmgr:cpu quantum Scheduler WAITING 14827 -1 14826 0 2 1413 000000047D7D36E0 resmgr:cpu quantum Scheduler WAITED KNOWN TIME 18824 18824 98023 1 148 000000047ECC4010 resmgr:cpu quantum Scheduler WAITED KNOWN TIME 18824 18824 98023 1 149 000000047C8D6B38 resmgr:cpu quantum Scheduler WAITING 19122 -1 19121 0 1 69 000000047C8D6B38 resmgr:cpu quantum Scheduler WAITING 19177 -1 19176 0 2 51 000000047BCA97A8 resmgr:cpu quantum Scheduler WAITING 19177 -1 19176 0 2 1106 000000047BCA97A8 PX Deq: Signal ACK RSG Other WAITING 112660 7340 120000 0
3 thoughts on “Oracle Instance Caging”