Skip to main content

PostgreSQL settings

PostgreSQL settings affect database cluster health and performance. When creating a cluster, the settings are set to default values. Default values are selected to ensure high cluster performance and differ depending on the cluster configuration and the version of PostgreSQL.

You can:

  • view the default setting values and change them when creating a cluster;
  • or view settings and edit them in an existing cluster.

We recommend changing setting values only when necessary—incorrect values can make the cluster inoperable or reduce its performance.

When scaling a cluster, the values of some settings are automatically replaced with default values. You can view the list of such settings in the Automatic settings change when scaling a cluster subsection.

View settings

You can view the list of settings available for modification when creating a cluster or editing settings.

If you have changed the settings, you can separately view a list of settings whose values differ from the default values.

For a detailed description of all settings, see the Server Configuration section of PostgreSQL documentation.

  1. In the control panel, in the top menu, click Products and select Cloud Databases.
  2. Open the Active tab.
  3. Open the cluster page → Settings tab.
  4. In the DBMS settings block, click Edit.
  5. Optional: to view only settings where you changed the default value, select the Show changed parameters checkbox.
  6. View settings.

Change settings

carefully

We recommend changing setting values only when necessary—incorrect values can make the cluster inoperable or reduce its performance.

After changing some settings, the cluster will automatically reboot and will be unavailable during the reboot. The reboot will start immediately after saving the changes. You can view the list of such settings in the List of settings that require reboot subsection.

  1. In the control panel, in the top menu, click Products and select Cloud Databases.
  2. Open the Active tab.
  3. Open the cluster page → Settings tab.
  4. In the DBMS settings block, click Edit.
  5. Specify new values.
  6. Click Save.

List of settings that require a restart

  • autovacuum_freeze_max_age;
  • autovacuum_max_workers;
  • autovacuum_multixact_freeze_max_age;
  • huge_pages;
  • max_connections;
  • max_files_per_process;
  • max_locks_per_transaction;
  • max_logical_replication_workers;
  • max_pred_locks_per_transaction;
  • max_prepared_transactions;
  • max_wal_senders;
  • max_worker_processes;
  • old_snapshot_threshold;
  • pg_stat_statements.max;
  • shared_buffers ;
  • shared_preload_libraries;
  • timezone;
  • track_activity_query_size.

Automatic settings adjustment during cluster scaling

DBMS settings have acceptable value limits. If, during cluster resizing, setting values fall outside the acceptable limits, such values are automatically replaced with default values so that the cluster can operate.

Once the cluster is resized and changes its status to ACTIVE, you can change the settings and set new values.

List of settings that are reset to default values during cluster scaling:

  • autovacuum_max_workers;
  • effective_cache_size;
  • maintenance_work_mem;
  • max_parallel_workers;
  • max_wal_size;
  • max_worker_processes;
  • shared_buffers;
  • vacuum_cost_limit;
  • work_mem.

Configuring huge_pages

For your information

The huge_pages setting is available for PostgreSQL versions 15 and higher.

In Managed Databases for PostgreSQL, you can enable and disable the Huge Pages technology using the huge_pages setting.

Huge Pages is a memory management technology that allows using larger memory pages than standard ones. The standard memory page size is 4 KB. After enabling the huge_pages setting, 2 MB memory pages are available. The Huge Pages technology can be used, for example, for shared buffers. This technology helps reduce overhead on compute resources: vCPU and RAM.

Possible values are on and off. The default value is off. If you change the setting value, the cluster will automatically restart and will be unavailable during the restart. The restart will begin immediately after saving the changes.

If the huge_pages setting is enabled, but shared memory limits do not allow using Huge Pages, the cluster will switch to the ERROR status. In this case, we recommend reducing the value of the shared_buffers setting.