Skip to main content

PostgreSQL Monitor Variables

info

Note: Changes made to the configuration on this page must be explicitly loaded to the runtime to take effect. Please refer to the Admin Commands documentation for details on the LOAD and SAVE commands.

List of PostgreSQL Monitor Variables

NOTE: You can click on the variable name to jump to its definition

Variable NameDefault Value
pgsql-monitor_connect_interval120000
pgsql-monitor_connect_interval_window50
pgsql-monitor_connect_timeout600
pgsql-monitor_enabledtrue
pgsql-monitor_history7200000
pgsql-monitor_local_dns_cache_refresh_interval60000
pgsql-monitor_local_dns_cache_ttl300000
pgsql-monitor_local_dns_resolver_queue_maxsize128
pgsql-monitor_passwordmonitor
pgsql-monitor_ping_interval8000
pgsql-monitor_ping_interval_window10
pgsql-monitor_ping_max_failures3
pgsql-monitor_ping_timeout1000
pgsql-monitor_read_only_interval1000
pgsql-monitor_read_only_interval_window10
pgsql-monitor_read_only_max_timeout_count3
pgsql-monitor_read_only_timeout800
pgsql-monitor_threads2
pgsql-monitor_usernamemonitor
pgsql-monitor_writer_is_also_readertrue

pgsql-monitor_connect_interval

The interval at which the Monitor module of the proxy will try to connect to all the PostgreSQL servers in order to check whether they are available or not.

System VariableNamepgsql-monitor_connect_interval
DynamicYes
Permitted ValuesTypeInteger (milliseconds)
Default120000
Minimum100
Maximum604800000

pgsql-monitor_connect_interval_window

Sets the target completion window, expressed as a percentage of the interval, in which the checks should be completed. In other words, allows to configure the tasks batching, defining the burstiness of the scheduling.

System VariableNamepgsql-monitor_connect_interval_window
DynamicYes
Permitted ValuesTypeInteger (pct)
Default50
Minimum0
Maximum100

pgsql-monitor_connect_timeout

Connection timeout in milliseconds.

System VariableNamepgsql-monitor_connect_timeout
DynamicYes
Permitted ValuesTypeInteger (milliseconds)
Default600
Minimum100
Maximum600000

pgsql-monitor_enabled

It enables or disables PostgreSQL Monitor.

System VariableNamepgsql-monitor_enabled
DynamicYes
Permitted ValuesTypeBoolean
Defaulttrue

pgsql-monitor_history

The duration for which the events for the checks made by the Monitor module are kept. Such events include connecting to backend servers (to check for connectivity issues), querying them with a simple query (in order to check that they are running correctly) or checking their replication lag. These logs are kept in the following admin tables:

  • pgsql_server_connect_log
  • pgsql_server_ping_log
  • pgsql_server_replication_lag_log
System VariableNamepgsql-monitor_history
DynamicYes
Permitted ValuesTypeInteger (milliseconds)
Default7200000 (2h)
Minimum1000
Maximum604800000

pgsql-monitor_password

Specifies the password that the Monitor module will use to connect to the backends.

System VariableNamepgsql-monitor_password
DynamicYes
Permitted ValuesTypeString
Defaultmonitor

pgsql-monitor_ping_interval

The interval at which the Monitor module of the proxy will try to connect to all the PostgreSQL servers in order to check whether they are available or not.

System VariableNamepgsql-monitor_ping_interval
DynamicYes
Permitted ValuesTypeInteger (milliseconds)
Default8000
Minimum100
Maximum604800000

pgsql-monitor_ping_interval_window

Sets the target completion window, expressed as a percentage of the interval, in which the checks should be completed. In other words, allows to configure the tasks batching, defining the burstiness of the scheduling.

System VariableNamepgsql-monitor_ping_interval_window
DynamicYes
Permitted ValuesTypeInteger (pct)
Default10
Minimum0
Maximum100

pgsql-monitor_ping_max_failures

The maximum number of ping failures the Monitor module should tolerate before sending a signal to PgSQL_Hostgroups_Manager to kill all connections to the backend server.

System VariableNamepgsql-monitor_ping_max_failures
DynamicYes
Permitted ValuesTypeInteger
Default3
Minimum1
Maximum1000000

pgsql-monitor_ping_timeout

How long the Monitor module will wait for a ping reply.

System VariableNamepgsql-monitor_ping_timeout
DynamicYes
Permitted ValuesTypeInteger (milliseconds)
Default1000
Minimum100
Maximum600000

pgsql-monitor_read_only_interval

Defines the frequency to perform the read_only check of a backend server (in milliseconds).

System VariableNamepgsql-monitor_read_only_interval
DynamicYes
Permitted ValuesTypeInteger (milliseconds)
Default1000
Minimum100
Maximum604800000

pgsql-monitor_read_only_interval_window

Sets the target completion window, expressed as a percentage of the interval, in which the checks should be completed. In other words, allows to configure the tasks batching, defining the burstiness of the scheduling.

System VariableNamepgsql-monitor_read_only_interval_window
DynamicYes
Permitted ValuesTypeInteger (pct)
Default10
Minimum0
Maximum100

pgsql-monitor_read_only_max_timeout_count

If the number of consecutive read_only checks timeouts (each exceeding pgsql-monitor_read_only_timeout) surpasses this value, the server is assumed to be read_only=1. This triggers hostgroup placement operations, if required, for all the hostgroups in which the server is configured, and that are present in the current pgsql_replication_hostgroups configuration.

System VariableNamepgsql-monitor_read_only_max_timeout_count
DynamicYes
Permitted ValuesTypeInteger (milliseconds)
Default3
Minimum1
Maximum999999

pgsql-monitor_read_only_timeout

The timeout for a single attempt at performing the read_only check on a backend server.

System VariableNamepgsql-monitor_read_only_timeout
DynamicYes
Permitted ValuesTypeInteger (milliseconds)
Default800
Minimum100
Maximum600000

pgsql-monitor_threads

Controls the number of threads within the Monitor Module thread pool. This variable isn't dynamic right now, which means that the value is fixed at startup. Due to the async nature of the monitoring design, and the control the module offers over the checks batching, a very small number of threads should be capable of monitoring a very large number of backend servers, without any compromises. For more information refer to the module general documentation.

System VariableNamepgsql-monitor_threads
DynamicNo
Permitted ValuesTypeInteger
Default2
Minimum2
Maximum256

pgsql-monitor_username

Specifies the username that the Monitor module will use to connect to the backends. The user needs only USAGE privileges to connect, ping and check read_only. For read_only this means that the user is required to have pg_monitor privileges.

System VariableNamepgsql-monitor_username
DynamicYes
Permitted ValuesTypeString
Defaultmonitor

pgsql-monitor_writer_is_also_reader

When a node changes its read_only value from 1 to 0, this variable determines if the node should be present in both hostgroups or not:

  • false: the node will be moved in writer_hostgroup and removed from reader_hostgroup.
  • true: the node will be copied in writer_hostgroup and it will also stay in reader_hostgroup.
System VariableNamepgsql-monitor_writer_is_also_reader
DynamicYes
Permitted ValuesTypeBoolean
Defaulttrue

pgsql-monitor_local_dns_cache_ttl

Time-to-live in milliseconds for cached DNS lookups in the monitor.

System VariableNamepgsql-monitor_local_dns_cache_ttl
DynamicYes
Permitted ValuesTypeInteger
Default300000
Minimum0
Maximum604800000

Description: Duration for which DNS resolution results are cached by the monitor.

pgsql-monitor_local_dns_cache_refresh_interval

Interval in milliseconds to refresh the local DNS cache.

System VariableNamepgsql-monitor_local_dns_cache_refresh_interval
DynamicYes
Permitted ValuesTypeInteger
Default60000
Minimum0
Maximum604800000

Description: Frequency at which the monitor refreshes its internal DNS cache.

pgsql-monitor_local_dns_resolver_queue_maxsize

Maximum size of the DNS resolver queue.

System VariableNamepgsql-monitor_local_dns_resolver_queue_maxsize
DynamicYes
Permitted ValuesTypeInteger
Default128
Minimum16
Maximum1024

Description: The maximum number of pending DNS resolution requests allowed in the monitor's queue.


Apply your changes: Remember to use the appropriate LOAD and SAVE commands to activate and persist your configuration. See the complete Admin Commands reference.