Customize your AlloyDB Omni installation

AlloyDB Omni is deployed through a Docker image, which allows different forms of customization. This page shows some of the common customizations that are used.

To get started quickly with AlloyDB Omni using the default configuration, see Quickstart: AlloyDB Omni.

Before you begin

The following table lists recommended hardware and software configuration for AlloyDB Omni.

OS/Platform Recommended hardware configuration Recommended software configuration
Linux
  • x86-64 or Arm (*) CPU with AVX2 support
  • 8GB of RAM for every CPU allocated to AlloyDB Omni
  • 20+ GB of disk space
  • Debian based OS (Ubuntu, etc.) or RHEL 9
  • Linux kernel version 6.1 or higher or any Linux kernel version older than 5.3 that has support for the MADV_COLLAPSE and MADV_POPULATE_WRITE directives
  • Cgroupsv2 enabled
  • Docker Engine 25.0.0+ or Podman 5.0.0+
  • macOS
  • Intel CPU with AVX2 support or M-chip
  • 8GB of RAM for every CPU allocated to AlloyDB Omni
  • 20+ GB of disk space
  • Docker Desktop 4.30 or higher
  • (*) Arm support is in Preview.

    AlloyDB Omni runs in a container. Install a container runtime like Docker or Podman on your machine before installing AlloyDB Omni.

    Single-server

    Mount an external data directory

    By default, the command in the Quickstart: Install AlloyDB Omni stores the database data in an area managed by Docker. This is convenient for getting started but makes it difficult to find and use the data directory. Instead, you can set up a bind mount to map the data directory to a known location on your disk.

    docker run --name CONTAINER_NAME \
    -e POSTGRES_PASSWORD=NEW_PASSWORD \
    -v DATA_DIR:/var/lib/postgresql/data \
    -p HOST_PORT:5432 -d google/alloydbomni
    

    Replace the following:

    • CONTAINER_NAME: The name to assign this new AlloyDB Omni container in your host machine's container registry—for example, my-omni.

    • NEW_PASSWORD: The password assigned the new container's postgres user after its creation.

    • DATA_DIR: The file system path that you want AlloyDB Omni to use for its data directory.

    • HOST_PORT: The TCP port on the host machine that the container should publish its own port 5432 to. To use the PostgreSQL default port on the host machine as well, specify 5432.

    Enable ulimits

    The ulimit parameters specify various process limits that the Docker container is allowed to use. For optimal performance, AlloyDB Omni adjusts process priorities to allow critical PostgreSQL processes to run with higher priority, that is they get a bigger allocation of available CPUs. To allow this, specify -20:-20, which removes limitations for the AlloyDB Omni container.

    docker run --name CONTAINER_NAME \
    -e POSTGRES_PASSWORD=NEW_PASSWORD \
    --ulimit=nice=-20:-20 \
    -p HOST_PORT:5432 -d google/alloydbomni
    

    Specify a logging driver

    By default, Docker does not perform log rotations. This can use up a lot of disk space, and eventually lead to disk space exhaustion. You can configure Docker to use a different logging driver. For example, to log to journald:

    docker run --name CONTAINER_NAME \
    -e POSTGRES_PASSWORD=NEW_PASSWORD \
    --log-driver=journald \
    -p HOST_PORT:5432 -d google/alloydbomni
    

    For more information about Docker and logging drivers, refer to Docker's documentation Configure logging drivers.

    You can also configure logging using PostgreSQL. For more information, refer to PostgreSQL documentation Error reporting and logging.