AlloyDB Omni, just like PostgreSQL, supports the use of huge pages. This requires your machine to have huge pages enabled, and you also need to enable a database setting huge_pages.
Run the provided script to enable huge pages on your machine:
Add the following line to your postgresql.conf to enable huge pages:
huge_pages=on
Enable swapping
Swapping in the operating system allows to extend available physical memory by moving inactive memory pages between random access memory (RAM) and the hard disk to free up RAM space for active processes. AlloyDB Omni uses swapping when it is under high load and requires extra memory.
To check how much swapping space is enabled on your system, run the following:
cat/proc/meminfo|grepSwapTotal
The output looks similar to the following:
SwapTotal: 165748732 kB
To enable swapping on your operating system if the output value is 0, see the following:
If AlloyDB Omni encounters an unrecoverable error and crashes, it is helpful to have a core dump for analysis. A core dump is a snapshot of the memory of the AlloyDB Omni process at the point of its crash.
To set up core dumps, set up kernel.core_pattern as follows:
Use the sysctl command to configure run time kernel parameters.
To set the kernel.core_pattern immediately, use:
sysctl-wkernel.core_pattern="CORE_PATTERN"
Replace CORE_PATTERN with a core filename pattern such as "%e-%t.core".
The systemd-coredump handler allows further configuration of your coredump settings. The tool is installed by default in RHEL. On Debian and Ubuntu systems, run sudo apt install coredumpctl to install the tool.
When you start AlloyDB Omni, ensure that you pass the --ulimit=core:-1:-1 argument in the docker run command:
CONTAINER_NAME: the name of a new AlloyDB Omni container—for example, my-omni-1.
<code>NEW_PASSWORD: the password assigned to new container's postgres user after its creation.
Set up systemd units to run operations automatically
If you run AlloyDB Omni on a dedicated server, then you may want to configure certain operations to start automatically when the server boots up. One way to do this is through systemd units.
For example, the following steps configure systemd so that huge pages are enabled automatically whenever the server boots up.
Create a file in /etc/systemd/system/alloydb-setup-env.service:
[Unit]
Description=Setup huge pages for AlloyDB Omni
[Service]
Type=oneshot
ExecStart=/usr/bin/docker run --rm --privileged google/alloydbomni setup-host
[Install]
WantedBy=multi-user.target
[[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Hard to understand","hardToUnderstand","thumb-down"],["Incorrect information or sample code","incorrectInformationOrSampleCode","thumb-down"],["Missing the information/samples I need","missingTheInformationSamplesINeed","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2025-08-25 UTC."],[[["\u003cp\u003eAlloyDB Omni, like PostgreSQL, benefits from huge pages, which can be enabled on your machine with a provided script and by setting \u003ccode\u003ehuge_pages=on\u003c/code\u003e in your \u003ccode\u003epostgresql.conf\u003c/code\u003e file.\u003c/p\u003e\n"],["\u003cp\u003eSwapping allows AlloyDB Omni to use disk space as an extension of RAM under high load, and can be enabled on your OS if needed, with documentation linked for Debian, Ubuntu, and Red Hat Enterprise Linux 9.\u003c/p\u003e\n"],["\u003cp\u003eSetting up core dumps is recommended for analyzing unrecoverable errors and crashes in AlloyDB Omni, done via the \u003ccode\u003esysctl\u003c/code\u003e command to configure \u003ccode\u003ekernel.core_pattern\u003c/code\u003e with a core filename pattern, and can be enhanced with the systemd-coredump handler.\u003c/p\u003e\n"],["\u003cp\u003eIf running AlloyDB Omni on a dedicated server, \u003ccode\u003esystemd\u003c/code\u003e units can be set up to automate operations, such as enabling huge pages, whenever the server boots up.\u003c/p\u003e\n"]]],[],null,["# Set up AlloyDB Omni for production\n\nSelect a documentation version: 15.7.0keyboard_arrow_down\n\n- [Current (16.8.0)](/alloydb/omni/current/docs/configure-omni)\n- [16.8.0](/alloydb/omni/16.8.0/docs/configure-omni)\n- [16.3.0](/alloydb/omni/16.3.0/docs/configure-omni)\n- [15.12.0](/alloydb/omni/15.12.0/docs/configure-omni)\n- [15.7.1](/alloydb/omni/15.7.1/docs/configure-omni)\n- [15.7.0](/alloydb/omni/15.7.0/docs/configure-omni)\n- [15.5.5](/alloydb/omni/15.5.5/docs/configure-omni)\n- [15.5.4](/alloydb/omni/15.5.4/docs/configure-omni)\n- [15.5.2](/alloydb/omni/15.5.2/docs/configure-omni)\n\n\u003cbr /\u003e\n\nThis page shows common settings when using AlloyDB Omni for production workloads.\n\n\u003cbr /\u003e\n\n### Single-server\n\nEnable huge pages\n-----------------\n\nAlloyDB Omni, just like PostgreSQL, supports the use of huge pages. This requires your machine to have huge pages enabled, and you also need to enable a database setting `huge_pages`.\n\n1. Run the provided script to enable huge pages on your machine:\n\n ### Docker\n\n docker run --rm --privileged google/alloydbomni setup-host\n\n ### Podman\n\n podman run --rm --privileged google/alloydbomni setup-host\n\n2. Add the following line to your `postgresql.conf` to enable huge pages:\n\n huge_pages=on\n\nEnable swapping\n---------------\n\nSwapping in the operating system allows to extend available physical memory by moving inactive memory pages between random access memory (RAM) and the hard disk to free up RAM space for active processes. AlloyDB Omni uses swapping when it is under high load and requires extra memory.\n\nTo check how much swapping space is enabled on your system, run the following: \n\n cat /proc/meminfo | grep SwapTotal\n\nThe output looks similar to the following: \n\n SwapTotal: 165748732 kB\n\nTo enable swapping on your operating system if the output value is `0`, see the following:\n\n- [Debian](https://wiki.debian.org/Swap)\n- [Ubuntu](https://help.ubuntu.com/community/SwapFaq)\n- [Red Hat Enterprise Linux 9](https://docs.redhat.com/en/documentation/red_hat_enterprise_linux/9/html/managing_storage_devices/getting-started-with-swap_managing-storage-devices#creating-an-lvm2-logical-volume-for-swap_getting-started-with-swap)\n\nEnable core dumps\n-----------------\n\nIf AlloyDB Omni encounters an unrecoverable error and crashes, it is helpful to have a core dump for analysis. A core dump is a snapshot of the memory of the AlloyDB Omni process at the point of its crash.\n\nTo set up core dumps, set up `kernel.core_pattern` as follows:\n\n1. Use the `sysctl` command to configure run time kernel parameters.\n2. To set the `kernel.core_pattern` immediately, use:\n\n sysctl -w kernel.core_pattern=\"\u003cvar translate=\"no\"\u003eCORE_PATTERN\u003c/var\u003e\"\n\n Replace \u003cvar translate=\"no\"\u003eCORE_PATTERN\u003c/var\u003e with a core filename pattern such as \"%e-%t.core\".\n\n For more information on core filename patterns, see [How to set process core file names](https://access.redhat.com/solutions/901293#:%7E:text=an%20unknown%20key-,Resolution,-In%20current%20linux%22) for details.\n\n The [systemd-coredump handler](https://systemd.io/COREDUMP/) allows further configuration of your coredump settings. The tool is installed by default in RHEL. On Debian and Ubuntu systems, run `sudo apt install coredumpctl` to install the tool.\n\n When you start AlloyDB Omni, ensure that you pass the `--ulimit=core:-1:-1` argument in the `docker run` command: \n\n ### Docker\n\n docker run --name \u003cvar translate=\"no\"\u003eCONTAINER_NAME\u003c/var\u003e \\\n -e POSTGRES_PASSWORD=\u003cvar translate=\"no\"\u003eNEW_PASSWORD\u003c/var\u003e \\\n --ulimit=core:-1:-1 \\\n -p HOST_PORT:5432 -d google/alloydbomni\n\n Replace the following:\n - \u003cvar translate=\"no\"\u003eCONTAINER_NAME\u003c/var\u003e: the name of a new AlloyDB Omni container---for example, `my-omni-1`.\n - `\u003ccode\u003e`\u003cvar translate=\"no\"\u003eNEW_PASSWORD\u003c/var\u003e: the password assigned to new container's `postgres` user after its creation.\n\n ### Podman\n\n podman run --name \u003cvar translate=\"no\"\u003eCONTAINER_NAME\u003c/var\u003e \\\n -e POSTGRES_PASSWORD=\u003cvar translate=\"no\"\u003eNEW_PASSWORD\u003c/var\u003e \\\n --ulimit=core:-1:-1 \\\n -p HOST_PORT:5432 -d google/alloydbomni\n\n Replace the following:\n - \u003cvar translate=\"no\"\u003eCONTAINER_NAME\u003c/var\u003e: the name of a new AlloyDB Omni container---for example, `my-omni-1`.\n - `\u003ccode\u003e`\u003cvar translate=\"no\"\u003eNEW_PASSWORD\u003c/var\u003e: the password assigned to new container's `postgres` user after its creation.\n\nSet up systemd units to run operations automatically\n----------------------------------------------------\n\nIf you run AlloyDB Omni on a dedicated server, then you may want to configure certain operations to start automatically when the server boots up. One way to do this is through `systemd` units.\n\nFor example, the following steps configure `systemd` so that huge pages are enabled automatically whenever the server boots up.\n\n1. Create a file in `/etc/systemd/system/alloydb-setup-env.service`:\n\n [Unit]\n Description=Setup huge pages for AlloyDB Omni\n\n [Service]\n Type=oneshot\n\n ExecStart=/usr/bin/docker run --rm --privileged google/alloydbomni setup-host\n\n [Install]\n WantedBy=multi-user.target\n\n2. Enable the service as follows:\n\n sudo systemctl enable alloydb-setup-env.service\n\nWhat's next\n-----------\n\n- [Run and connect to AlloyDB Omni](/alloydb/omni/15.7.0/docs/run-connect)\n\n- [Manage AlloyDB Omni](/alloydb/omni/15.7.0/docs/manage)\n\n- [Create a read-only replica](/alloydb/omni/15.7.0/docs/set-up-read-replica)\n\n- [Manage backup and restore](/alloydb/omni/15.7.0/docs/backup-kubernetes)\n\n- [Create read pool instance in Kubernetes](/alloydb/omni/15.7.0/docs/kubernetes-read-pool)\n\n- [Use a sidecar container in Kubernetes](/alloydb/omni/15.7.0/docs/kubernetes-sidecar-container)"]]