Skip to main content
You can configure your PlanetScale for Postgres cluster settings in the “Parameters” tab on the Cluster configuration page for your database. The defaults for each parameter depend on the configuration of your cluster. The defaults have been chosen to optimize performance, resource usage, and connection handling for each cluster size. However, you are able to fine-tune each of these settings as needed.

Configuring parameter values

You must be a database or organization administrator to modify these settings.
  1. From the PlanetScale organization dashboard, select the desired database
  2. Navigate to the Cluster configuration page from the menu on the left
  3. Choose the branch whose parameters you’d like to configure in the “Branch” dropdown
  4. Select the Parameters tab
  5. Search for a specific parameter or scroll through the page to see all configurable parameters
  6. Update the value for the parameter(s) you wish to adjust
  7. Click “Queue parameter changes
  8. Once you’re ready to apply the changes, click “Apply changes

Tracking changes to parameters

You can click on the “Changes” tab on the Cluster configuration page to view a log of any changes made to your parameter settings. The log will include the settings affected, the original and updated values, status, user that made the changes, start time, and end time.
When updating a cluster’s size, some parameters will automatically be adjusted. Each cluster size is associated with default parameter settings, changing the cluster size will also update those defaults. The exception to this is if you manually override a default parameter setting. In that case, a cluster size adjustment will not automatically change that setting.

Parameter change types

PostgreSQL parameter changes fall into two categories based on how they are applied:
  • Reloadable changes: The parameter can be updated without restarting PostgreSQL, resulting in zero downtime
  • Restart-required changes: PostgreSQL requires a cluster restart for the parameter to take effect
Parameters that require a restart are marked with a ✅ in the “Restart Required” column in the parameter reference table below.

Restart behavior for production clusters

When you apply parameters that require a restart, PlanetScale performs a rolling restart process to minimize downtime:
  1. Configuration changes are first applied to replica instances and they are restarted
  2. Once replicas are ready, a switchover promotes one replica to become the new primary
  3. The configuration is applied to the former primary (now a replica) and it is restarted
Config change with restart This rolling restart process minimizes downtime, but there remains a brief several-second window of unavailability during the primary switchover. All direct database connections will be terminated during this process, so your application should implement connection retry logic. With the exception of the Number of processes parameter for PgBouncer, PgBouncer connections persist through all parameter changes and do not require reconnection. Some parameters are required by PostgreSQL to be applied to the primary before replicas, which may result in a slightly longer unavailability period.

Default parameter values

The following table shows the default values for parameters that are displayed by default to customers. You can find additional parameters in the search field.
ParameterRestart RequiredDescription
PgBouncer
Number of processes✅ (restarts PGBouncer only)Sets the number of PgBouncer processes that will run on each node in this branch’s cluster
default_pool_sizeSets the number of server connections to allow per user/database pair
max_client_connSets the maximum number of client connections allowed
max_db_client_connectionsSets the maximum number of client connections allowed per database (regardless of user). 0 is unlimited
max_db_connectionsSets the maximum number of server connections allowed per database (regardless of user). 0 is unlimited
max_prepared_statementsSets the maximum number of client-prepared statements available across server connections
max_user_connectionsSets the maximum number of server connections allowed per user (regardless of database). 0 is unlimited
server_lifetimeSets how long an unused server connection stays open
server_idle_timeoutSets how long an idle server connection stays open
Resource usage
effective_io_concurrencySets the number of simultaneous requests that can be handled efficiently by the disk subsystem
effective_cache_sizeSets the planner’s assumption about the total size of the data caches
huge_pagesControls whether huge pages are requested for the main shared memory area
maintenance_io_concurrencySets the number of simultaneous requests that can be handled efficiently by the disk subsystem for maintenance operations
maintenance_work_memSets the maximum memory to be used for maintenance operations
max_parallel_maintenance_workersSets the maximum number of parallel processes per maintenance operation
max_parallel_workersSets the maximum number of parallel workers that can be active at one time
max_parallel_workers_per_gatherSets the maximum number of parallel processes per executor node
max_worker_processesSets the maximum number of background processes that the cluster can support
shared_buffersSets the amount of memory the database server uses for shared memory buffers
work_memSets the amount of memory the database will use for internal operations like sorting and hashing
Write-ahead log
max_slot_wal_keep_sizeSets the maximum WAL size that can be reserved by replication slots
max_wal_sizeSets the WAL size that triggers a checkpoint
min_wal_sizeSets the minimum size to shrink the WAL to
wal_buffersSets the number of disk-page buffers in shared memory for WAL
wal_levelSets the level of information written to the WAL
Query tuning
deadlock_timeoutSets the maximum time to wait on a lock before checking for deadlocks
default_statistics_targetSets the default statistics target for table columns without a column-specific target set
random_page_costSets the planner’s estimate of the cost of a nonsequentially fetched disk page
seq_page_costSets the planner’s estimate of the cost of a sequentially fetched disk page
Connections and authentication
max_connectionsSets the maximum number of concurrent connections
Replication
hot_standby_feedbackSends feedback to the primary about queries being executed on the standby. Required for logical replication failover
max_logical_replication_workersSets the maximum number of logical replication workers
max_replication_slotsSets the maximum number of replication slots that the server can support
max_sync_workers_per_subscriptionSets the maximum number of synchronization workers per subscription
max_wal_sendersSets the maximum number of WAL senders
sync_replication_slotsEnables standbys to synchronize logical replication streams from the primary. Required for logical replication failover
Failover
failover_delaySets the time to wait before triggering a failover to drain inflight transactions
Statistics
track_io_timingEnables timing of database I/O calls. This may cause significant overhead
Logging
log_lock_waitsLogs the duration of lock waits that exceed the deadlock_timeout
log_min_duration_statementSets the minimum execution time above which all statements will be logged
Client connection defaults
shared_preload_librariesSpecifies shared libraries to preload into the server at server start
Autovacuum
autovacuum_vacuum_scale_factorSpecifies a fraction of the table size to add to autovacuum_vacuum_threshold when deciding whether to trigger a VACUUM
autovacuum_analyze_scale_factorSpecifies a fraction of the table size to add to autovacuum_analyze_threshold when deciding whether to trigger an ANALYZE

Need help?

Get help from the PlanetScale Support team, or join our GitHub discussion board to see how others are using PlanetScale.
I