Instance Caging

Since Oracle Database 11g Release 2 there is a feature called “Instance Caging” managing and limiting the number of CPUs used by a database. This feature is very helpful if you administrating a RAC cluster and want to limit the CPU-resources per databases. Comparing to the “normal resource manager-way” where you define a percentage value at the resource manager it keeps it simpler and you don’t have to create a complex resource plan.

In my case my server is using two sockets with an Intel Xeon CPU E5-2660. In total I have 16-physical cores. Hyper threading technology is activated, this means the OS will see double amount of cores – we see 32 logical.

oracle@myserver:/opt/oracle# cat /proc/cpuinfo | grep processor | wc -l
32

 

Additionally you can check within the database how many cores are visible to the database:

SQL> show parameter cpu_count
NAME TYPE VALUE
------------------------------------ ----------- ------------------------------
cpu_count integer 32

Now you configure the limitation for the instances.

ALTER SYSTEM SET CPU_COUNT=4 SCOPE=both SID = '*';  -- SID means apply config to all instances
ALTER SYSTEM SET RESOURCE_MANAGER_PLAN='default_plan' SCOPE=both SID='*';

You should double-check if parameters are set correctly.

SQL> show parameter cpu_count
NAME TYPE VALUE
------------------------------------ ----------- ------------------------------
cpu_count integer 4

Finished ! Now the instance of your database is only using 4 instead 32 cores of your server. The other 28 cores are left for other databases or for the system itself.

Some recommendations:

  • If you assign more cores to your databases like you have in total then you “Over-provisioning” your CPU capabilities. If all databases are busy it would be very harmful to your system. Configuration is used for development, testing or non-production systems.
  • If you assigned equal number of cores which are available to your databases it’s called “Partitioning”. Then it’s unlikely that one instance can influence other instances on that server. Configuration is used for production systems.

Sources: Oracle White Paper – Instance Caging

Schreibe einen Kommentar