Resource considerations for VM performance

This document describes the CPU resources and RAM size you should consider when installing AlloyDB Omni on VMs. This document assumes that you are familiar with PostgreSQL.

Instance sizing

Choosing the correct machine size for AlloyDB Omni is critical to get the best performance for your application. Bringing together the concepts in this document, the inputs to making a machine size decision are about ensuring the system has enough resources to service your application, such as the correct amount of CPU, RAM, and storage.

CPU resources

The instance should have enough CPU resources so that steady state operations can occur at or under 70% utilization. Having enough CPU resources leaves enough headroom for the instance to handle utilization spikes and to keep operating if your application utilization grows over time and ensures that you can perform periodic maintenance operations such as vacuum. Running at, or near, 100% utilization can lead to poor performance due to process or thread context switching or queuing effects in other parts of the system as they contend for scarce CPU resources.

If CPU resource utilization is consistently greater than 70% or has frequent, sustained spikes over 95%, consider moving to a larger instance size. Similarly, if steady state utilization is low, with peaks under 50%, consider downsizing to a smaller instance to realize some cost savings.

RAM size

The amount of system memory is an important factor for application performance. AlloyDB Omni performs dynamic memory management, which adapts to changing memory needs of the database. The maximum size of the buffer pool, without the columnar engine enabled, is 80% of the RAM available on the machine type used. As the database runs, AlloyDB Omni adjusts the buffer pool to accommodate queries that need additional memory, for example, analytical queries.

Buffer pool utilization is a key factor in system performance. You can look at the buffer pool hit rate to get an idea of how much data the application is accessing from the buffer pool while it is running. If the miss rate is high, consider increasing the amount of memory to make more RAM available to the buffer pool.

A database might have a large amount of data, but a smaller subset, called the working set, is actually used by the application. Use the appropriate instance size for your working set. For the best performance, use a working set that fits entirely in the buffer pool.