Consolidation is very popular word today to save costs:
buy one huge server with a lot of CPU, memory, huge storage, fast network
put as many as possible databases on it
- utilize it as efficient as possible
But consolidation brings problem how to share resources between databases:
CPU (this article is related only to this resource)
As default an Oracle database can see/use all CPUs on a host. In 11.2G there is new option called “Instance Caging” which enables to limit number of CPUs which can be seen/used by a database.
Enabling Instance Caging
1. Manually set dynamic parameter cpu_count on instance level. As default this parameter is set to maximum number of cpu available on a hosts.
alter system set cpu_count=2;
2. Enable any resource manager plan that manages CPU. Most easy is to turn on default Oracle plan DEFAULT_PLAN.
alter system set resource_manager_plan=DEFAULT_PLAN;
Monitoring Instance Caging
Checking if Instance Caging is enabled
1.Ccheck if cpu_count is set
select value from v$parameter where name = 'cpu_count' and (isdefault ='FALSE' or ismodified != 'FALSE');
2. Check if Resource Manager is on and managing CPU
select name from v$rsrc_plan where is_top_plan = 'TRUE' and cpu_managed ='ON';
There are generally 2 ways to distribute your CPU between databases
Partitioning – sum of all CPUs assigned to all your databases equals number of CPUs on a host. Databases don’t interfere with each other.
Over-provisioning – sum of all CPUs assigned to all your databases is higher that number of CPUs on a host. Databases can impact on each other performance.
Partitioning is recommended on production hosts
Over provisioning is recommended on less critical systems like development
Important note – Instance caging hasn’t got any impact on licensing model. You still need to pay for all CPUs on a host which is available for Oracle software.
Alternatives to Instance Caging
Alternative methods to control CPU usage are:
Hard partitioning – partition your hardware on many separate boxes. Install databases on separate boxes. Requires advanced hardware to be used – supported on Solaris, AIX, HP-unix. Disadvantages high costs, dedicated vendor, complex to managed.
O/S Workload Managers – many operating system delivers own software to manage CPU usage and other resources like AIX Workload Manager, the HP-UX Workload Manager, and the Solaris Resource. Disadvantages you need to learn of them, each can work different per O/S, not available on all platforms.
Virtualization – additional layer to partition hardware using software level. Disadvantage too complex versus Instance Caging and lose IO performance for databases.
Have a fun 🙂