Skip to main content

AWS - Aurora PostgreSQL

Aurora PostgreSQL agent setup

For an overview of how the DBtune agent works, see agent Overview.

Prerequisites

Before starting the DBtune agent, ensure you have completed the database setup steps.

AWS IAM permissions

The AWS credentials provided to the agent need at least the following permissions:

rds:DescribeDBInstances
rds:ModifyDBParameterGroup
cloudwatch:GetMetricStatistics
ec2:DescribeInstanceTypes
pi:GetResourceMetrics (if Performance Insights is enabled)
rds:RebootDBInstance (if you want to perform tuning with restart)

Setting up the agent

Run the DBtune agent using Docker with Aurora-specific configuration:

docker run --restart always --detach \
-e DBT_POSTGRESQL_CONNECTION_URL="postgresql://..." \
-e DBT_RDS_DATABASE_IDENTIFIER={rds_database_identifier} \
-e DBT_RDS_PARAMETER_GROUP_NAME={parameter_group_name} \
-e DBT_AWS_REGION={aws_region} \
-e DBT_AWS_ACCESS_KEY_ID={aws_access_key_id} \
-e DBT_AWS_SECRET_ACCESS_KEY={aws_secret_access_key} \
-e DBT_DBTUNE_SERVER_URL=https://app.dbtune.com \
-e DBT_DBTUNE_API_KEY=your-dbtune-api-key \
-e DBT_DBTUNE_DATABASE_ID=your-dbtune-database-id \
public.ecr.aws/dbtune/dbtune/agent:latest --aurora
info

AWS credentials (DBT_AWS_ACCESS_KEY_ID and DBT_AWS_SECRET_ACCESS_KEY) are optional. If not provided, the agent will use the default AWS credential chain, which includes WebIdentity tokens.

For information about common environment variables (DBT_DBTUNE_* and DBT_POSTGRESQL_*), see agent overview - common environment variables.

AWS Aurora-specific environment variables

VariableDescription
DBT_RDS_DATABASE_IDENTIFIERIdentifier of the Aurora RDS instance you want to optimize.
DBT_RDS_PARAMETER_GROUP_NAMEName of the parameter group for the Aurora instance.
DBT_AWS_ACCESS_KEY_ID(Optional) AWS access key ID that DBtune will use to authenticate with AWS services.
DBT_AWS_SECRET_ACCESS_KEY(Optional) AWS secret access key that DBtune will use to authenticate with AWS services.
DBT_AWS_REGIONAWS region where your database is located.

Parameters tuned

DBtune supports multiple tuning modes that determine which parameters can be optimized. For a detailed explanation of tuning modes, see tuning modes.

Reload-only tuning mode

The following parameters are tuned in reload-only mode:

  1. work_mem
  2. random_page_cost
  3. seq_page_cost
  4. max_parallel_workers
  5. max_parallel_workers_per_gather

Restart tuning mode

The following parameter is tuned in restart mode, in addition to all reload-only parameters:

  1. shared_buffers