Friday, February 7, 2020

CPU Conundrum in Oracle 19c

If you have managed Oracle databases on any kind of hardware, you know how important the CPU is for the optimal performance of database. Over the years, Oracle has tried hard to come up with efficient strategies to make sure that CPU is utilized efficiently or caged properly.

Configuring the machine to optimally leverage CPU is a big ask. Normally onn top of the Bare Metal or Virtual instances, each instance of an Oracle database is configured to use a number of vCPUs by enabling Oracle Database Resource Manager (DBRM) and setting the CPU_COUNT parameter. If DBRM is not configured, the CPU_COUNT setting simply reflects the total vCPUs on the system. Enabling DBRM allows the CPU_COUNT setting to control the number of vCPUs available to the database. This applies at both the CDB (Container Database) and PDB (Pluggable Database) levels.

The most common approach to managing CPU resources is to NOT over-provision and simply allocate CPU according to what’s available. Whether CPU is allocated to Virtual Machines that each contain a single database, or CPU is allocated to individual databases residing on a single Virtual Machine, the result is the same.

Oracle offers the ability to configure “shares” for each Pluggable Database within a Container Database.  Each instance of a Container Database is given an amount of vCPU to use by enabling DBRM and setting CPU_COUNT. The Pluggable Databases within that Container Database are then given “shares” of the vCPU available to the Container Database. Each Pluggable Database then receives the designated share of CPU resources, and the system is not over-subscribed.

DBRM constantly monitors demand for CPU resources within each Pluggable Database, as well as the overall availability of CPU resources at the Container Database level. DBRM allows each Pluggable Database to automatically and immediately scale up to use more CPU resources if available in the Container Database. The ability to use Dynamic CPU Scaling is a new feature of Oracle Database 19c that allows Pluggable Databases to automatically scale CPU resources up and down in response to user demand.

No comments: