Updated on 2025-05-29 GMT+08:00

Connection Settings

This section describes parameters related to client-server connection modes.

light_comm

Parameter description: Specifies whether the server uses the lightweight communications mode.

This parameter specifies whether the server uses the communication mode based on lightweight locks and non-blocking sockets.

Parameter type: Boolean.

Unit: none

Value range:

  • on: The lightweight communications mode is used.
  • off: The lightweight communications mode is not used.

Default value: off

Setting method: This is a POSTMASTER parameter. Set it based on instructions provided in Table 1.

Setting suggestion: Retain the default value.

Risks and impacts of improper settings: Change the parameter value after fully understanding the parameter meaning and verifying it through testing.

listen_addresses

Parameter description: Specifies the TCP/IP address of the client for a server to listen on.

This parameter specifies the IP address used by the GaussDB server for listening, for example, an IPv4 address or IPv6 address. Multiple NICs may exist on the host and each NIC can be bound to multiple IP addresses. This parameter specifies the IP addresses to which GaussDB is bound. The client can use the IP addresses specified by this parameter to connect to GaussDB or send requests to GaussDB.

Parameter type: string.

Unit: none

Value range:

  • Host name or IP address. Multiple values are separated with commas (,).
  • Asterisk (*), ::, or 0.0.0.0, indicating that all IP addresses will be listened on, which is not recommended due to potential security risks.
  • If the parameter is not specified, the server does not listen on any IP address. In this case, only UDSs can be used for database connections.

Default value:

After the cluster is installed, configure different default values based on the IP addresses of different instances in the public_cloud.conf file. The default value of CN is "localhost,IP address of the mgr.net NIC,IP address of the data.net NIC,IP address of the virtual.net NIC". The default value of DN is "IP address of the data.net NIC".

Setting method: This is a POSTMASTER parameter. Set it based on instructions provided in Table 1.

Setting suggestion: Retain the default value.

localhost indicates that only local loopback is allowed.

The public_cloud.conf file contains the following NIC information: mgr.net (management NIC), data.net (data NIC), and virtual.net (virtual NIC).

If an IPv6 address is used and the IP address is a fe80 address block, add '%zone index' during the configuration.

Risks and impacts of improper settings: Change the parameter value after fully understanding the parameter meaning and verifying it through testing.

listen_address_ext

Parameter description: Specifies the extended TCP/IP address of the client for a server to listen on. This parameter specifies the IP addresses used by the GaussDB server as the extended listening IP address.

Parameter type: string.

Unit: none

Value range: an IPv4 or IPv6 address. Multiple IP addresses are not supported.

Default value: "localhost".

Setting method: This is a SIGHUP parameter. Set it based on instructions provided in Table 1.

Setting suggestion: In BMS deployment mode, this parameter is automatically configured when the cluster is installed and started. You are advised not to manually configure this parameter.

  • The setting of the listen_address_ext parameter involves the network topology and configuration of the extended IP addresses of the entire cluster. Therefore, it must be set and reloaded by using the OM tool.
  • listen_address_ext is a network channel used to extend specific IP addresses. If this parameter is set to "*", "0.0.0.0", "localhost", "::-1", or "127.0.0.1", the setting does not take effect. If required, you are advised to set these addresses in listen_addresses.
  • listen_address_ext is used to configure distributed DNs. It does not take effect if it is configured for CNs.

Risks and impacts of improper settings: Change the parameter value after fully understanding the parameter meaning and verifying it through testing.

local_bind_address

Parameter description: Specifies the host IP address bound to the current node for connecting to other nodes in the cluster.

Parameter type: string.

Unit: none

Value range: an IPv4 or IPv6 address. Multiple IP addresses are not supported.

Default value:

After the cluster is installed, configure different default values based on the IP addresses of different instances in the public_cloud.conf file. The default value of CN/DN is "IP address of the data.net NIC".

The public_cloud.conf file contains the following NIC information: mgr.net (management NIC), data.net (data NIC), and virtual.net (virtual NIC).

Setting method: This is a POSTMASTER parameter. Set it based on instructions provided in Table 1.

Setting suggestion: Retain the default value.

Risks and impact of improper settings: This parameter is specified in the configuration file during installation. Do not modify this parameter unless necessary. Otherwise, database communications will be affected after the modification.

port

Parameter description: Specifies the TCP port listened on by the GaussDB.

Parameter type: integer.

Unit: none

Value range: 1 to 65535

  • When setting the port number, ensure that the port number is not in use. When setting the port numbers of multiple instances, ensure that the port numbers do not conflict.
  • Ports 1 to 1023 are reserved for the OS. Do not use them.
  • When the cluster is installed using the configuration file, pay attention to the ports reserved in the communication matrix in the configuration file. For example, the DN needs to reserve dataPortBase + 1 as the port used by internal tools. Therefore, during cluster installation, the maximum value of port is 65532 for CNs, 65529 for DNs, and 65534 for GTMs. Ensure that the port number does not conflict with each other.

Default value: 5432 (The actual value is specified in the configuration file during installation.)

Setting method: This is a POSTMASTER parameter. Set it based on instructions provided in Table 1.

Setting suggestion: Retain the default value.

Risks and impact of improper settings: This parameter is specified in the configuration file during installation. Do not modify this parameter unless necessary. Otherwise, database communications will be affected after the modification.

max_connections

Parameter description: Specifies the maximum number of concurrent connections to the database. This parameter influences the concurrent processing capability of the cluster.

Parameter type: integer.

Unit: none

Value range: The minimum value is 10 (greater than the value of max_wal_senders). The theoretical maximum value is 262143. The actual maximum value is a dynamic value, which is calculated using the formula: 262143 – job_queue_processesautovacuum_max_workersmax_inner_tool_connectionsmax_concurrent_autonomous_transactionsAUXILIARY_BACKENDSAV_LAUNCHER_PROCSmin(max(newValue/4,64),1024). The values of job_queue_processes, autovacuum_max_workers, max_inner_tool_connections, and max_concurrent_autonomous_transactions depend on the settings of the corresponding GUC parameters. AUXILIARY_BACKENDS indicates the number of reserved auxiliary threads, which is fixed to 20. AV_LAUNCHER_PROCS indicates the number of reserved autovacuum launcher threads, which is fixed to 2. In min(max(newValue/4,64),1024), newValue indicates the new value.

For different memory specifications, the value range of this parameter in different instances is as follows:

Table 1 Value ranges of memory specifications for different instances in independent deployment mode

Memory Specifications

Value Range for CNs

Value Range for DNs

< 32 GB

[10,100]

[10,100]

[32GB,64GB)

[10,200]

[10,200]

[64GB,128GB)

[10,1000]

[10,2500]

[128GB,256GB)

[10,2000]

[10,6000]

[256GB,480GB)

[10,4000]

[10,12000]

≥ 480 GB

[10,8000]

[10,24000]

Table 2 Value ranges of memory specifications for different instances in hybrid deployment mode

Memory Specifications

Value Range for CNs

Value Range for DNs

< 64 GB

[10,100]

[10,100]

[64 GB,128 GB)

[10,200]

[10,1000]

[128 GB,256 GB)

[10,500]

[10,2000]

[256 GB,480 GB)

[10,1000]

[10,4000]

[480 GB,512 GB)

[10,2250]

[10,9000]

[512 GB,576 GB)

[10,2500]

[10,11000]

[576 GB,640 GB)

[10,3000]

[10,12000]

[640 GB,768 GB)

[10,3500]

[10,14000]

[768 GB,1024 GB)

[10,4000]

[10,16000]

[1024 GB,1536 GB)

[10,6000]

[10,21000]

≥ 1536 GB

[10,10000]

[10,33000]

Default value:

  • Independent deployment:

    CN: 8000 (60-core CPU/480 GB memory); 4000 (32-core CPU/256 GB memory); 2000 (16-core CPU/128 GB memory); 1000 (8-core CPU/64 GB memory); 100 (4-core CPU/32 GB memory and 4-core CPU/16 GB memory)

    DN: 24000 (60-core CPU/480 GB memory); 12000 (32-core CPU/256 GB memory); 6000 (16-core CPU/128 GB memory); 2500 (8-core CPU/64 GB memory); 100 (4-core CPU/32 GB memory and 4-core CPU/16 GB memory)

  • Hybrid deployment

    CN: 2500 (64-core CPU/512 GB memory); 1000 (32-core CPU/256 GB memory); 500 (16-core CPU/128 GB memory)

    DN: 11000 (64-core CPU/512 GB memory); 4000 (32-core CPU/256 GB memory); 2000 (16-core CPU/128 GB memory)

Setting method: This is a POSTMASTER parameter. Set it based on instructions provided in Table 1.

Setting suggestion: Retain the default value of this parameter in the primary database node file. If this parameter is set to a smaller value, the number of available connections decreases. Before changing the value of this parameter, understand the parameter description and exercise caution to avoid risks caused by misoperations.

Risks and impacts of improper settings:

  • If the value of max_connections exceeds the maximum dynamic value, the CN and DN fail to be started and the error message "invalid value for parameter "max_connections"" is displayed. Alternatively, the memory fails to be allocated during the node startup and the error message "Cannot allocate memory" is displayed.
  • If the value of max_connections is not increased based on the external export specifications, the memory parameter is not adjusted in the same proportion. When the service load is heavy, the memory may be insufficient and the error message "memory is temporarily unavailable" is displayed.
  • In the hybrid deployment scenario, if the value of max_connections on the CN is greater than the value of max_connections divided by the number of CNs on the DN and the total pressure on the client exceeds the value of max_connections on the DN, the CN may fail to connect to the DN, and the error message "pooler... Too many clients already" is displayed.
  • If the number of connections of the administrator exceeds the value of max_connections, the administrator can still connect to the database after the connections are used up by common users. If the number of connections exceeds the value of sysadmin_reserved_connections, an error is reported. That is, the maximum number of connections of the administrator is equal to the value of max_connections + sysadmin_reserved_connections.
  • For common users, internal jobs use some connections. Therefore, the value of this parameter is slightly less than that of max_connections. The value depends on the number of internal connections.
  • After the thread pool is enabled, the maximum number of stream threads is determined by the value of max_connections. If the number of stream threads reaches the upper limit, the error message "Exceed stream thread pool limitation..." is reported. In this case, you can increase the value of max_connections to increase the upper limit. This is a POSTMASTER parameter. Therefore, you can estimate the number of stream threads based on service requirements. The formula is as follows: Total number of stream threads = Number of concurrent services x Number of stream threads consumed by each concurrently executed statement (which can be viewed in the execution plan).

max_inner_tool_connections

Parameter description: Specifies the maximum number of concurrent connections of a tool which is allowed to connect to the database. This parameter influences the concurrent connection capability of the GaussDB tool.

Parameter type: integer.

Unit: none

Value range: The minimum value is 1, the theoretical maximum value is 262143, and the actual maximum value is a dynamic value. The calculation formula is 262143 – job_queue_processesautovacuum_max_workersmax_connectionsmax_concurrent_autonomous_transactionsAUXILIARY_BACKENDSAV_LAUNCHER_PROCSmin(max(max_connections/4,64),1024). The values of job_queue_processes, autovacuum_max_workers, max_connections, and max_concurrent_autonomous_transactions depend on the setting of the corresponding GUC parameter. AUXILIARY_BACKENDS indicates that the number of reserved auxiliary threads is fixed to 20. AV_LAUNCHER_PROCS reserves two launcher threads for autovacuum.

Default value: 50. If the default value is greater than the maximum value supported by the kernel (determined when the gs_initdb command is executed), an error message is displayed.

Setting method: This is a POSTMASTER parameter. Set it based on instructions provided in Table 1.

Setting suggestion: Retain the default value of this parameter in the primary database node file.

Risks and impacts of improper settings: Change the parameter value after fully understanding the parameter meaning and verifying it through testing.

sysadmin_reserved_connections

Parameter description: Specifies the minimum number of connections reserved for administrators. You are advised not to set this parameter to a large value. This parameter is used together with the max_connections parameter. The maximum number of connections of the administrator is equal to the value of max_connections + sysadmin_reserved_connections.

  • When the thread pool function is enabled, if the thread pool is fully occupied, a processing bottleneck occurs. As a result, connections reserved by the administrator cannot be established. In this case, you can use gsql to establish connections through the port specified by the primary port number plus 1 and clear useless sessions.
  • When the reserved connections are used up, new connections will fail. In this case, you can only restart the cluster to restore the connections. Therefore, exercise caution when using the reserved connections.

Parameter type: integer.

Unit: none

Value range: 0 to MIN(262143, max_connections) (the smaller value between 262143 and max_connections). For details about how to calculate the value of max_connections, see max_connections.

Default value: 3

Setting method: This is a POSTMASTER parameter. Set it based on instructions provided in Table 1.

Setting suggestion: Retain the default value.

Risks and impacts of improper settings: Change the parameter value after fully understanding the parameter meaning and verifying it through testing.

service_reserved_connections

Parameter description: Specifies the minimum number of connections reserved for background O&M users (with the persistence attribute). A large value is not recommended. This parameter is used together with max_connections. The maximum number of connections of an O&M user can be calculated as follows: max_connections + service_reserved_connections.

Parameter type: integer.

Unit: none

Value range: 0 to 262143

Default value: 10

Setting method: This is a POSTMASTER parameter. Set it based on instructions provided in Table 1.

Setting suggestion: Retain the default value.

Risks and impacts of improper settings: If this parameter is set to a small value, the O&M user (with the persistence attribute) cannot connect to the database and jobs cannot be executed when the number of connections reaches the maximum (max_connections). If the value is too large, there are too many idle resources.

extip_reserved_connections

Parameter description: Specifies the minimum number of common gsql service connections reserved for a user on the extended IP address specified by listen_address_ext. This parameter is used together with max_connections. The maximum number of connections of a corresponding service can be calculated as follows: max_connections + service_reserved_connections.

This parameter is valid only when a specific IP address of listen_address_ext is configured for a distributed DN.

Parameter type: integer.

Unit: none

Value range: 0 to MIN(262143, max_connections) (the smaller value between 262143 and max_connections). For details about how to calculate the value of max_connections, see max_connections.

Default value: 5

Setting method: This is a POSTMASTER parameter. Set it based on instructions provided in Table 1.

Setting suggestion: Retain the default value.

Risks and impacts of improper settings: Change the parameter value after fully understanding the parameter meaning and verifying it through testing.

unix_socket_directory

Parameter description: Specifies the UDS directory for the GaussDB server to listen to connections from the client. Only the SYSADMIN user can access this parameter.

Parameter type: string.

Unit: none

Value range: valid path of a directory.

The parameter length limit varies by the maximum length of a path of a directory in the OS. In the Linux OS, the length of a socket path name (combination of a socket directory and a socket file name) cannot exceed 107 bytes, and the length of a directory cannot exceed 92 bytes. If this limit is exceeded, the error "Unix-domain socket path "xxx" is too long" will be reported.

Default value: "". The actual value is specified by tmpMppdbPath in the configuration file during installation.

Setting method: This is a POSTMASTER parameter. Set it based on instructions provided in Table 1.

Setting suggestion: Retain the default value.

Risks and impact of improper configuration: If the configuration is incorrect (for example, the length exceeds the limit or the directory is invalid), the process cannot be started properly. You can retrieve the system_call log in the CM Agent directory to locate configuration issues.

unix_socket_group

Parameter description: Specifies the group of the UDS (the user of a socket is the user who starts the server). This parameter can work with unix_socket_permissions to control socket access.

Parameter type: string.

Unit: none

Value range: existing user groups in the system.

Default value: "", indicating the default group of the current user.

Setting method: This is a POSTMASTER parameter. Set it based on instructions provided in Table 1.

Setting suggestion: Retain the default value.

Risks and impacts of improper settings: Change the parameter value after fully understanding the parameter meaning and verifying it through testing.

unix_socket_permissions

Parameter description: Specifies access permissions on the UDS.

The UDS uses the usual permission set of the Unix file system. The value of this parameter should be a number (acceptable for the chmod and umask commands). If a user-defined octal format is used, the number must start with 0.

Parameter type: integer.

Unit: none

Value range: 0000 to 0777

In the Linux OS, a document has one document attribute and nine permission attributes, which are the read (r), write (w), and execute (x) permissions of the owner, group, and others groups.

The r, w, and x permissions are represented by the following numbers:

r: 4

w: 2

x: 1

-: 0

The three attributes in a group are accumulative.

For example, -rwxrwx--- indicates the following permissions:

owner = rwx = 4+2+1 = 7

group = rwx = 4+2+1 = 7

others = --- = 0+0+0 = 0

The permission of the file is 0770.

Default value: 0700

Setting method: This is a POSTMASTER parameter. Set it based on instructions provided in Table 1.

Setting suggestion: You are advised to set it to 0770 (only allowing access from users connecting to the database and users in the same group as them) or 0700 (only allowing access from users connecting to the database).

Risks and impacts of improper settings: Change the parameter value after fully understanding the parameter meaning and verifying it through testing.

application_name

Parameter description: Specifies the client name used in the current connection request.

Parameter type: string.

Unit: none

Value range: valid client name. The actual query result depends on the client used for queries or user configurations.

When a standby node requests to replicate logs on the primary node, if this parameter is not an empty string, it is used as the name of the streaming replication slot of the standby node on the primary node. In this case, if the length of this parameter exceeds 61 bytes, only the first 61 bytes are used as the streaming replication slot name.

Default value: "" (The actual value is the name of the application connected to the backend.)

Setting method: This is a USERSET parameter. Set it based on instructions provided in Table 1. Note that after the client is connected, this parameter is set to the client name and the client level. Therefore, only the session-level parameters take effect. Other methods do not take effect because they are lower than the client level.

Setting suggestion: Retain the default value.

Risks and impacts of improper settings: The database depends on application_name to identify some internal processes. If you set application_name to the same name as an internal process, unexpected behavior may occur.

connection_info

Parameter description: Specifies the database connection information, including the driver type, driver version, driver deployment path, and process owner.

Parameter type: string.

Unit: none

Value range: a string.

Default value: "", indicating that the driver connected to the database does not support automatic setting of the connection_info parameter or the parameter is not set by users in applications.

The following is an example of the concatenated value of connection_info:
1
{"driver_name":"ODBC","driver_version": "(GaussDB XXX.XXX.XXX build 290d125f) compiled at 2020-05-08 02:59:43 commit 2143 last mr 131 release","driver_path":"/usr/local/lib/gsqlodbcw.so","os_user":"omm"}

By default, driver_name and driver_version are displayed. The displays of driver_path and os_user are controlled by users. For details, see "Application Development Guide > Development Based on JDBC > Connecting to the Database" in Developer Guide and "Application Development Guide > Development Based on ODBC > Configuring a Data Source in the Linux OS" in Developer Guide.

Setting method: This is a USERSET parameter used for O&M. You are advised not to set the parameter.

Setting suggestion: Retain the default value.

Risks and impacts of improper settings: Change the parameter value after fully understanding the parameter meaning and verifying it through testing.

backend_version

Parameter description: Specifies the version number of the synchronous connection between CNs or between a CN and a DN. This parameter involves the version number and cannot be set randomly.

Parameter type: integer.

Unit: none

Value range: 0 to 100000

Setting method: This is a USERSET parameter. Set it based on instructions provided in Table 1.

Setting suggestion: Retain the default value.

Risks and impacts of improper settings: If the settings are incorrect, the versions of different nodes are inconsistent.

check_disconnect_query

Parameter description: Specifies whether to terminate the execution of statements on the GaussDB server after the client is disconnected abnormally (for example, socketTimeout is triggered by JDBC, rwtimeout is triggered by libpq and the connection is closed, or the client process is terminated during service running).

Parameter type: Boolean.

Unit: none

Value range:

  • on: indicates that the GaussDB server stops running the corresponding statements after the client is disconnected unexpectedly.
  • off: indicates that the GaussDB server does not stop running the corresponding statements after the client is disconnected unexpectedly.

Default value: on

Setting method: This is a POSTMASTER parameter. Set it based on instructions provided in Table 1.

Setting suggestion: Retain the default value.

Risks and impacts of improper settings: Change the parameter value after fully understanding the parameter meaning and verifying it through testing.

The GaussDB signal mechanism is designed as follows: After a signal is received, only the corresponding interrupt position is marked as true, and the actual processing is performed only when the interrupt function is executed. When system resources encounter a bottleneck (for example, the CPU usage is too high, the memory is insufficient, the disk I/O is fully loaded, or the NIC receiving and sending buffer is fully loaded due to network problems), a delay may occur from the time when a signal is received to the time when the signal is processed. As a result, the time required for processing the signal increases.

connection_reject_nodes

Parameter description: Specifies the blacklist of CNs/DNs that reject connections from other CNs. The blacklists are separated by commas (,), for example, 'cn_5001,cn_5002'. When a CN (for example, cn_5001) in the blacklist attempts to connect to the local node, the connection will be rejected and the error message "Reject cn_5001 connection" will be displayed.

Parameter type: string.

Unit: none

Value range: a character string consisting of several node names and commas (,).

Default value: ""

Setting method: This is a SIGHUP parameter. Set it based on instructions provided in Table 1.

Setting suggestion: Retain the default value.

Risks and impacts of improper settings: If this parameter is set to a node name, other nodes will reject the connection request. As a result, a connection error is reported.