Advanced parameters for Public Cloud Databases for PostgreSQL
Objective
This guide lists all the supported advanced parameters that allow you to configure your Public Cloud Databases for PostgreSQL according to your use cases.
Requirements
- A Public Cloud project in your OVHcloud account.
- A database running on your OVHcloud Public Cloud Databases (this guide can help you to meet this requirement).
- Access to your OVHcloud Control Panel or to the OVHcloud API.
Instructions
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
Below you can find a summary of every configuration option available for a PostgreSQL service:
General parameters
| Parameters |
|---|
pg.autovacuum_analyze_scale_factor doublemin: 0 max: 1Specifies 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 longmin: 0 max: 2147483647Specifies 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 longmin: 200000000 max: 1500000000Specifies 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 longmin: 1 max: 20Specifies 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 longmin: 1 max: 86400Specifies 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 longmin: -1 max: 100Specifies 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 longmin: -1 max: 10000Specifies 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 doublemin: 0 max: 1Specifies 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 longmin: 0 max: 2147483647Specifies the minimum number of updated or deleted tuples needed to trigger a VACUUM in any table. The default is 50. |
pg.bgwriter_delay longmin: 10 max: 10000Specifies the delay between activity rounds for the background writer in milliseconds. The default is 200. |
pg.bgwriter_flush_after longmin: 0 max: 2048Whenever 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 longmin: 0 max: 1073741823In 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 doublemin: 0 max: 10The 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 longmin: 500 max: 1800000This 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 stringvalues: lz4, pglzSpecifies 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 longmin: 0 max: 604800000Time out sessions with open transactions after this number of milliseconds |
pg.jit booleanControls system-wide use of Just-in-Time Compilation (JIT). |
pg.log_autovacuum_min_duration longmin: -1 max: 2147483647Causes 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 stringvalues: DEFAULT, TERSE, VERBOSEControls the amount of detail written in the server log for each message that is logged. |
pg.log_line_prefix stringvalues: '%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 longmin: -1 max: 86400000Log statements that take more than this number of milliseconds to run, -1 disables |
pg.log_temp_files longmin: -1 max: 2147483647Log statements for each temporary file created larger than this number of kilobytes, -1 disables |
pg.max_files_per_process longmin: 1000 max: 4096PostgreSQL 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 longmin: 64 max: 6400PostgreSQL maximum locks per transaction. Changing this parameter causes a service restart. |
pg.max_logical_replication_workers longmin: 4 max: 64PostgreSQL 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 longmin: 0 max: 96Sets 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 longmin: 0 max: 96Sets 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 longmin: 64 max: 5120PostgreSQL maximum predicate locks per transaction. The default is 64 (upstream default). Changing this parameter causes a service restart. |
pg.max_prepared_transactions longmin: 0 max: 10000PostgreSQL maximum prepared transactions. The default is 0. Changing this parameter causes a service restart. |
pg.max_replication_slots longmin: 8 max: 64PostgreSQL maximum replication slots. The default is 20. Changing this parameter causes a service restart. |
pg.max_slot_wal_keep_size longmin: -1 max: 2147483647PostgreSQL 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 longmin: 2097152 max: 6291456Maximum depth of the stack in bytes. The default is 2097152 (upstream default). |
pg.max_standby_archive_delay longmin: 1 max: 43200000Max standby archive delay in milliseconds. The default is 30000 (upstream default). |
pg.max_standby_streaming_delay longmin: 1 max: 43200000Max standby streaming delay in milliseconds. The default is 30000 (upstream default). |
pg.max_wal_senders longmin: 20 max: 64PostgreSQL maximum WAL senders. The default is 20. Changing this parameter causes a service restart. |
pg.max_worker_processes longmin: 8 max: 96Sets 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 stringvalues: md5, scram-sha-256Chooses the algorithm for encrypting passwords. |
pg.pg_partman_bgw.interval longmin: 3600 max: 604800Sets the time interval in seconds to run pg_partman's scheduled tasks. The default is 3600. |
pg.pg_partman_bgw.role stringControls which role to use for pg_partman's scheduled background tasks. |
pg.pg_stat_monitor.pgsm_enable_query_plan booleanEnables or disables query plan monitoring. Changing this parameter causes a service restart. Only available for PostgreSQL 13+. |
pg.pg_stat_monitor.pgsm_max_buckets longmin: 1 max: 10Sets the maximum number of buckets. Changing this parameter causes a service restart. Only available for PostgreSQL 13+. |
pg.pg_stat_statements.track stringvalues: all, none, topControls 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 longmin: -1 max: 2147483647PostgreSQL temporary file limit in KiB, -1 for unlimited |
pg.timezone stringPostgreSQL service timezone |
pg.track_activity_query_size longmin: 1024 max: 10240Specifies 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 stringvalues: off, onRecord commit time of transactions. Changing this parameter causes a service restart. |
pg.track_functions stringvalues: all, none, plEnables tracking of function call counts and time used. |
pg.track_io_timing stringvalues: off, onEnables 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 longTerminate 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 longmin: 10 max: 200WAL flush interval in milliseconds. The default is 200. Setting this parameter to a lower value may negatively impact performance. |
pgbouncer.autodb_idle_timeout longmin: 0 max: 86400If 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 longmin: 0 max: 2147483647Do not allow more than this many server connections per database (regardless of user). Setting it to 0 means unlimited. |
pgbouncer.autodb_pool_mode stringvalues: session, statement, transactionPGBouncer pool mode |
pgbouncer.autodb_pool_size longmin: 0 max: 10000If non-zero then create automatically a pool of that size per user when a pool doesn't exist. |
pgbouncer.max_prepared_statements longmin: 0 max: 3000PgBouncer 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 longmin: 0 max: 10000Add 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 longmin: 0 max: 86400If 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 longmin: 60 max: 86400The pooler will close an unused server connection that has been connected longer than this. [seconds] |
pgbouncer.server_reset_query_always booleanRun server_reset_query (DISCARD ALL) in all pooling modes |
pglookout.max_failover_replication_time_lag longmin: 10 max: 9223372036854776000Number of seconds of master unavailability before triggering database failover to standby |
shared_buffers_percentage doublemin: 20 max: 60Percentage 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 longmin: 1 max: 4096The 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 longmin: 1 max: 1024Sets 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
Visit our dedicated Discord channel: https://discord.gg/ovhcloud. Ask questions, provide feedback and interact directly with the team that builds our databases services.
If you need training or technical assistance to implement our solutions, contact your sales representative or click on this link to get a quote and ask our Professional Services experts for a custom analysis of your project.
Join our community of users.