Configuring EDB Postgres Tuner
To run EDB Postgres Tuner, you need to add it to the shared_preload_libraries
and create the extension in the database. EDB Postgres Tuner can then gather metrics to make tuning recommendations.
In the
postgresql.conf
file, addedb_pg_tuner
to theshared_preload_libraries
parameter:Note
If
shared_preload_libraries
has other extensions, then you can addedb_pg_tuner
to the list. The order doesn't matter.Restart Postgres.
Create the EDB Postgres Tuner extension in your database with the following command:
Parameters
The following custom GUCs control the EDB Postgres Tuner extension behavior. If you modify these parameters, then reload Postgres to apply the changes.
edb_pg_tuner.autotune
— Applies tuning recommendations automatically. The default isfalse
.edb_pg_tuner.naptime
— Sets the interval between each check in seconds. The default is 600 seconds (10 minutes).edb_pg_tuner.max_wal_size_limit
— Sets the maximum value for themax_wal_size
recommendation. The default is0
, which sets no limit.
The following custom GUCs control the EDB Postgres Tuner work_mem
tuning behavior for Postgres 14 and higher.
edb_pg_tuner.tune_work_mem
— Dynamically increase the work mem for queries with disk spill to improve performance. The default is true.edb_pg_tuner.work_mem_pool
— Maximum additional work_mem reserve that is allocated to queries with disk spill. The default is 2GB.edb_pg_tuner.log_min_duration
— Execution time threshold in ms for statistics logging. The default is 0, which logs everything. The value -1 will turn off logging.edb_pg_tuner.buffer_size
— Maximum query count for tracking statistics. The default is 5000.
Recommended GUCs
EDB Postgres Tuner can recommend the following GUCs. The static
category provides fixed recommendation settings. The dynamic
category uses specific algorithms to suggest a better setting according to your workload or hardware resources.
GUC | Category | Recommendation | Version |
---|---|---|---|
autovacuum | static | on | |
checkpoint_completion_target | static | 0.9 | |
effective_cache_size | dynamic | based on resources | |
enable_async_append | static | on | |
enable_bitmapscan | static | on | |
enable_gathermerge | static | on | |
enable_group_by_reordering | static | on | |
enable_hashagg | static | on | |
enable_hashjoin | static | on | |
enable_incremental_sort | static | on | 13+ |
enable_indexonlyscan | static | on | |
enable_indexscan | static | on | |
enable_material | static | on | |
enable_memoize | static | on | 14+ |
enable_mergejoin | static | on | |
enable_nestloop | static | on | |
enable_parallel_append | static | on | 11+ |
enable_parallel_hash | static | on | 11+ |
enable_partition_pruning | static | on | 11+ |
enable_partitionwise_aggregate | static | on | |
enable_partitionwise_join | static | on | |
enable_seqscan | static | on | |
enable_sort | static | on | |
enable_tidscan | static | on | |
fsync | static | on | |
full_page_writes | static | on | |
log_checkpoints | static | on | |
max_wal_size | dynamic | based on workload | |
maintenance_work_mem | dynamic | based on resources | |
parallel_leader_participation | static | on | |
seq_page_cost | static | 1.0 | |
shared_buffers | dynamic | based on resources | |
track_activities | static | on | |
track_counts | static | on | |
zero_damaged_pages | static | on |
Note
If edb_pg_tuner.autotune
is enabled on EDB Postgres Advanced Server 15 or later, any GUC that requires a restart is set when the service starts. Hence, you don't need to restart the service to apply the recommendations.
On earlier EDB Postgres Advanced Server versions (14 and earlier), you do need to restart the service.
- On this page
- Parameters
- Recommended GUCs
Could this page be better? Report a problem or suggest an addition!