To configure a YugabyteDB deployment, you can use smart defaults to manage some performance features and guardrails. These defaults take into account the amount of RAM and cores available to optimize resources available to the cluster.

Memory division smart defaults

Use the use_memory_defaults_optimized_for_ysql flag to automatically set defaults for how much memory is made available to YugabyteDB processes that run on the nodes of your cluster. These defaults take into account the amount of RAM and cores available, and are optimized for using YSQL.

When the flag is false, the defaults are more suitable for YCQL but do not take into account the amount of RAM and cores available.

Split of memory between processes on nodes

If use_memory_defaults_optimized_for_ysql is true, then the memory division flag defaults change to provide much more memory for PostgreSQL; furthermore, they optimize for the node size.

If these defaults are used for both TServer and Master, then a node's available memory is partitioned as follows:

node RAM GiB (M): M  ≤  4 4 < M  ≤  8 8 < M  ≤  16 16 < M
TServer % 45% 48% 57% 60%
Master % 20% 15% 10% 10%
PostgreSQL % 25% 27% 28% 27%
other % 10% 10% 5% 3%

To read this table, take your node's available memory in GiB, call it M, and find the column who's heading condition M meets. For example, a node with 7 GiB of available memory would fall under the column labeled "4 < M ≤ 8" because 4 < 7 ≤ 8. The defaults for --default_memory_limit_to_ram_ratio on this node will thus be 0.48 for TServers and 0.15 for Masters. The PostgreSQL and other percentages are not set via a flag currently but rather consist of whatever memory is left after TServer and Master take their cut. There is currently no distinction between PostgreSQL and other memory except on YugabyteDB Aeon where a cgroup is used to limit the PostgreSQL memory.

For comparison, when --use_memory_defaults_optimized_for_ysql is false, the split is TServer 85%, Master 10%, PostgreSQL 0%, and other 5%.

Split of memory within processes

Some defaults for the split of memory within processes (as opposed to between processes on a node) are also affected by the --use_memory_defaults_optimized_for_ysql setting.

The defaults for the split of memory within a TServer that change when --use_memory_defaults_optimized_for_ysql is true do not depend on the node size, and are described in the following table:

flag default
--db_block_cache_size_percentage 32
--tablet_overhead_size_percentage 10

The default value of --db_block_cache_size_percentage has been picked to avoid oversubscribing memory on the assumption that 10% of memory is reserved for per-tablet overhead. (Other TServer components and overhead from TCMalloc consume the remaining 58%.)

Currently, the defaults for the split of memory within a Master process do not depend on node size, and are not affected by the --use_memory_defaults_optimized_for_ysql setting. This could change in future releases.