For AI agents: the complete documentation index is available at https://docs.us.ovhcloud.com/en/llms.txt, the full documentation bundle is available at https://docs.us.ovhcloud.com/en/llms-full.txt, and this page is available as Markdown at https://docs.us.ovhcloud.com/en/public-cloud/databases/postgresql-advanced-parameters-references.md.
  • English

PostgreSQL® - Advanced parameters references

View as Markdown

This guide lists most of the supported advanced parameters that allow you to configure your Cloud Databases for PostgreSQL® according to your use cases.

 

Requirements

 

Instructions

Warning

NOTE: The management of advanced parameters is not supported via Terraform.

Using the OVHcloud Control Panel

Please refer to this guide to find out how to change your advanced parameters from the OVHcloud Control Panel.

 

Using API

Please refer to this guide to find out how to change your advanced parameters from the OVHcloud API.

 

Advanced parameters for PostgreSQL®

You can find a complete list of configuration options via OVHcloud API. Below is a summary of most configuration options available for PostgreSQL® service:

Parameters
pg.autovacuum_analyze_scale_factor double min: 0 max: 1 Specifies a fraction of the table size to add to autovacuum_analyze_threshold when deciding whether to trigger an ANALYZE (e.g. 0.2 for 20% of the table size). The default is 0.2.
pg.autovacuum_analyze_threshold long min: 0 max: 2147483647 Specifies the minimum number of inserted, updated or deleted tuples needed to trigger an ANALYZE in any table. The default is 50.
pg.autovacuum_freeze_max_age long min: 200000000 max: 1500000000 Specifies the maximum age (in transactions) that a table's pg_class.relfrozenxid field can attain before a VACUUM operation is forced to prevent transaction ID wraparound within the table. The system launches autovacuum processes to prevent wraparound even when autovacuum is otherwise disabled. Changing this parameter causes a service restart.
pg.autovacuum_max_workers long min: 1 max: 20 Specifies the maximum number of autovacuum processes (other than the autovacuum launcher) that may be running at any time. The default is 3. Changing this parameter causes a service restart.
pg.autovacuum_naptime long min: 1 max: 86400 Specifies the minimum delay between autovacuum runs on any given database. The delay is measured in seconds. The default is 60.
pg.autovacuum_vacuum_cost_delay long min: -1 max: 100 Specifies the cost delay value that will be used in automatic VACUUM operations. If -1 is specified, the regular vacuum_cost_delay value will be used. The default is 2 (upstream default).
pg.autovacuum_vacuum_cost_limit long min: -1 max: 10000 Specifies the cost limit value that will be used in automatic VACUUM operations. If -1 is specified, the regular vacuum_cost_limit value will be used. The default is -1 (upstream default).
pg.autovacuum_vacuum_scale_factor double min: 0 max: 1 Specifies a fraction of the table size to add to autovacuum_vacuum_threshold when deciding whether to trigger a VACUUM (e.g. 0.2 for 20% of the table size). The default is 0.2.
pg.autovacuum_vacuum_threshold long min: 0 max: 2147483647 Specifies the minimum number of updated or deleted tuples needed to trigger a VACUUM in any table. The default is 50.
pg.bgwriter_delay long min: 10 max: 10000 Specifies the delay between activity rounds for the background writer in milliseconds. The default is 200.
pg.bgwriter_flush_after long min: 0 max: 2048 Whenever more than bgwriter_flush_after bytes have been written by the background writer, attempt to force the OS to issue these writes to the underlying storage. Specified in kilobytes. Setting of 0 disables forced writeback. The default is 512.
pg.bgwriter_lru_maxpages long min: 0 max: 1073741823 In each round, no more than this many buffers will be written by the background writer. Setting this to zero disables background writing. The default is 100.
pg.bgwriter_lru_multiplier double min: 0 max: 10 The average recent need for new buffers is multiplied by bgwriter_lru_multiplier to arrive at an estimate of the number that will be needed during the next round, (up to bgwriter_lru_maxpages). 1.0 represents a “just in time” policy of writing exactly the number of buffers predicted to be needed. Larger values provide some cushion against spikes in demand, while smaller values intentionally leave writes to be done by server processes. The default is 2.0.
pg.deadlock_timeout long min: 500 max: 1800000 This is the amount of time, in milliseconds, to wait on a lock before checking to see if there is a deadlock condition. The default is 1000 (upstream default).
pg.default_toast_compression string values: lz4, pglz Specifies the default TOAST compression method for values of compressible columns. The default is lz4. Only available for PostgreSQL® 14+.
pg.idle_in_transaction_session_timeout long min: 0 max: 604800000 Time out sessions with open transactions after this number of milliseconds
pg.jit boolean Controls system-wide use of Just-in-Time Compilation (JIT).
pg.log_autovacuum_min_duration long min: -1 max: 2147483647 Causes each action executed by autovacuum to be logged if it ran for at least the specified number of milliseconds. Setting this to zero logs all autovacuum actions. Minus-one disables logging autovacuum actions. The default is 1000.
pg.log_error_verbosity string values: DEFAULT, TERSE, VERBOSE Controls the amount of detail written in the server log for each message that is logged.
pg.log_line_prefix string values: '%m[%p]%q[user=%u,db=%d,app=%a]', '%t[%p]:[%l-1]user=%u,db=%d,app=%a,client=%h', 'pid=%p,user=%u,db=%d,app=%a,client=%h', 'pid=%p,user=%u,db=%d,app=%a,client=%h,txid=%x,qid=%Q' Choose from one of the available log formats.
pg.log_min_duration_statement long min: -1 max: 86400000 Log statements that take more than this number of milliseconds to run, -1 disables
pg.log_temp_files long min: -1 max: 2147483647 Log statements for each temporary file created larger than this number of kilobytes, -1 disables
pg.max_files_per_process long min: 1000 max: 4096 PostgreSQL® maximum number of files that can be open per process. The default is 1000 (upstream default). Changing this parameter causes a service restart.
pg.max_locks_per_transaction long min: 64 max: 6400 PostgreSQL® maximum locks per transaction. Changing this parameter causes a service restart.
pg.max_logical_replication_workers long min: 4 max: 64 PostgreSQL® maximum logical replication workers (taken from the pool of max_parallel_workers). The default is 4 (upstream default). Changing this parameter causes a service restart.
pg.max_parallel_workers long min: 0 max: 96 Sets the maximum number of workers that the system can support for parallel queries. The default is 8 (upstream default).
pg.max_parallel_workers_per_gather long min: 0 max: 96 Sets the maximum number of workers that can be started by a single Gather or Gather Merge node. The default is 2 (upstream default).
pg.max_pred_locks_per_transaction long min: 64 max: 5120 PostgreSQL® maximum predicate locks per transaction. The default is 64 (upstream default). Changing this parameter causes a service restart.
pg.max_prepared_transactions long min: 0 max: 10000 PostgreSQL® maximum prepared transactions. The default is 0. Changing this parameter causes a service restart.
pg.max_replication_slots long min: 8 max: 64 PostgreSQL® maximum replication slots. The default is 20. Changing this parameter causes a service restart.
pg.max_slot_wal_keep_size long min: -1 max: 2147483647 PostgreSQL® maximum WAL size (MB) reserved for replication slots. If -1 is specified, replication slots may retain an unlimited amount of WAL files. The default is -1 (upstream default). wal_keep_size minimum WAL size setting takes precedence over this.
pg.max_stack_depth long min: 2097152 max: 6291456 Maximum depth of the stack in bytes. The default is 2097152 (upstream default).
pg.max_standby_archive_delay long min: 1 max: 43200000 Max standby archive delay in milliseconds. The default is 30000 (upstream default).
pg.max_standby_streaming_delay long min: 1 max: 43200000 Max standby streaming delay in milliseconds. The default is 30000 (upstream default).
pg.max_wal_senders long min: 20 max: 64 PostgreSQL® maximum WAL senders. The default is 20. Changing this parameter causes a service restart.
pg.max_worker_processes long min: 8 max: 96 Sets the maximum number of background processes that the system can support. The default is 8. Changing this parameter causes a service restart.
pg.password_encryption string values: md5, scram-sha-256 Chooses the algorithm for encrypting passwords.
pg.pg_partman_bgw.interval long min: 3600 max: 604800 Sets the time interval in seconds to run pg_partman's scheduled tasks. The default is 3600.
pg.pg_partman_bgw.role string Controls which role to use for pg_partman's scheduled background tasks.
pg.pg_stat_monitor.pgsm_enable_query_plan boolean Enables or disables query plan monitoring. Changing this parameter causes a service restart. Only available for PostgreSQL® 13+.
pg.pg_stat_monitor.pgsm_max_buckets long min: 1 max: 10 Sets the maximum number of buckets. Changing this parameter causes a service restart. Only available for PostgreSQL® 13+.
pg.pg_stat_statements.track string values: all, none, top Controls which statements are counted. Specify top to track top-level statements (those issued directly by clients), all to also track nested statements (such as statements invoked within functions), or none to disable statement statistics collection. The default is top.
pg.temp_file_limit long min: -1 max: 2147483647 PostgreSQL® temporary file limit in KiB, -1 for unlimited
pg.timezone string PostgreSQL® service timezone
pg.track_activity_query_size long min: 1024 max: 10240 Specifies the number of bytes reserved to track the currently executing command for each active session. Changing this parameter causes a service restart.
pg.track_commit_timestamp string values: off, on Record commit time of transactions. Changing this parameter causes a service restart.
pg.track_functions string values: all, none, pl Enables tracking of function call counts and time used.
pg.track_io_timing string values: off, on Enables timing of database I/O calls. The default is off. When on, it will repeatedly query the operating system for the current time, which may cause significant overhead on some platforms.
pg.wal_sender_timeout long Terminate replication connections that are inactive for longer than this amount of time, in milliseconds. Setting this value to zero disables the timeout.
pg.wal_writer_delay long min: 10 max: 200 WAL flush interval in milliseconds. The default is 200. Setting this parameter to a lower value may negatively impact performance.
pgbouncer.autodb_idle_timeout long min: 0 max: 86400 If the automatically created database pools have been unused this many seconds, they are freed. If 0 then timeout is disabled. [seconds]
pgbouncer.autodb_max_db_connections long min: 0 max: 2147483647 Do not allow more than this many server connections per database (regardless of user). Setting it to 0 means unlimited.
pgbouncer.autodb_pool_mode string values: session, statement, transaction PGBouncer pool mode
pgbouncer.autodb_pool_size long min: 0 max: 10000 If non-zero then create automatically a pool of that size per user when a pool doesn't exist.
pgbouncer.max_prepared_statements long min: 0 max: 3000 PgBouncer tracks protocol-level named prepared statements related commands sent by the client in transaction and statement pooling modes when max_prepared_statements is set to a non-zero value. Setting it to 0 disables prepared statements. max_prepared_statements defaults to 100, and its maximum is 3000.
pgbouncer.min_pool_size long min: 0 max: 10000 Add more server connections to pool if below this number. Improves behavior when usual load comes suddenly back after period of total inactivity. The value is effectively capped at the pool size.
pgbouncer.server_idle_timeout long min: 0 max: 86400 If a server connection has been idle more than this many seconds it will be dropped. If 0 then timeout is disabled. [seconds]
pgbouncer.server_lifetime long min: 60 max: 86400 The pooler will close an unused server connection that has been connected longer than this. [seconds]
pgbouncer.server_reset_query_always boolean Run server_reset_query (DISCARD ALL) in all pooling modes
pglookout.max_failover_replication_time_lag long min: 10 max: 9223372036854776000 Number of seconds of master unavailability before triggering database failover to standby
shared_buffers_percentage double min: 20 max: 60 Percentage of total RAM that the database server uses for shared memory buffers. Valid range is 20-60 (float), which corresponds to 20% - 60%. This setting adjusts the shared_buffers configuration value. Changing this parameter causes a service restart.
timescaledb.max_background_workers long min: 1 max: 4096 The number of background workers for timescaledb operations. You should configure this setting to the sum of your number of databases and the total number of concurrent background workers you want running at any given point in time. Changing this parameter causes a service restart.
work_mem long min: 1 max: 1024 Sets the maximum amount of memory to be used by a query operation (such as a sort or hash table) before writing to temporary disk files, in MB. The default is 1MB + 0.075% of total RAM (up to 32MB).

 

Go further

Browse all the Databases guides.

Browse the rest of the OVHcloud US documentation for guides on our other products and services.

Learn more about Managed Databases on the OVHcloud US website.

OVHcloud Managed Databases and Analytics:

  • Grafana® is a registered trademark of Grafana Labs and is used with the permission of Grafana Labs. OVH SAS and its subsidiaries are not affiliated with or endorsed by Grafana Labs.
  • Kafka® is a registered trademark of The Apache Software Foundation and has been licensed for use by OVHcloud, who has no affiliation with and is not endorsed by The Apache Software Foundation.
  • MongoDB® is a registered trademark of MongoDB, Inc.
  • MySQL® is a registered trademark of Oracle and/or its affiliates.
  • PostgreSQL® is a registered trademark of the PostgreSQL Community Association of Canada.