Aiven for PostgreSQL
Aiven for 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 and agent prerequisites.
Setting up the agent
Run the DBtune agent using Docker with Aiven-specific configuration:
docker run --restart always --detach \
-e DBT_POSTGRESQL_CONNECTION_URL="postgresql://..." \
-e DBT_AIVEN_API_TOKEN=your-api-token \
-e DBT_AIVEN_PROJECT_NAME=your-project-name \
-e DBT_AIVEN_SERVICE_NAME=your-service-name \
-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 --aiven
For information about common environment variables (DBT_DBTUNE_* and DBT_POSTGRESQL_*), see agent overview - common environment variables.
Aiven-specific environment variables
Variable | Description |
---|---|
DBT_AIVEN_API_TOKEN | The token to call Aiven's API for your account. |
DBT_AIVEN_PROJECT_NAME | Name of the project within your service is running. |
DBT_AIVEN_SERVICE_NAME | Name of your Aiven PostgreSQL service. |
Parameters tuned
DBtune supports multiple tuning modes that determine which parameters can be optimized. For a detailed explanation of tuning modes, see tuning modes.
More parameters will be tuned by DBtune when Aiven opens them through their APIs. Check this page regularly for updates.
Reload-only tuning mode
The following parameters are tuned in reload-only mode:
work_mem
bgwriter_delay
bgwriter_lru_maxpages
max_parallel_workers
max_parallel_workers_per_gather
Restart tuning mode
The following parameter is tuned in restart mode, in addition to all reload-only parameters:
shared_buffers
We use the Aiven API to modify parameters, which limits the set of available parameters that we would normally tune for restart tuning mode.
Aiven-specific monitoring details
Metrics are collected every 30 seconds, rather than the standard 5 seconds. This is due to Aiven's API limitations. DBtune gathers these metrics by reading from system tables, as well as calling the Aiven API.
DBtune queries system metrics to ensure production safety. For up-to-date details, you can refer to the open-source agent.