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 in Table 1.
Setting suggestion: none
Risks and impacts of improper settings: none
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. 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. This parameter must be used together with valid addresses (for example, the local IP address). Otherwise, the build may fail. In primary/standby mode, if the value is set to \* or 0.0.0.0, the value of localport in the gaussdb.conf file of the database on the primary node cannot be the value of dataPortBase plus 1. Otherwise, the database cannot be started.
- If the parameter value is invalid (for example, the parameter value contains invalid IP addresses or characters, is empty, or is listened repeatedly), the process fails to be started.
Default value: After the database instance is installed, the default value is set based on the IP addresses of different instances in the public_cloud.conf configuration file. The default value of DN is "IP address of the data.net NIC".
Setting method: This is a SIGHUP parameter. Set it based on instructions in Table 1.
Setting suggestion: Retain the default value.
- 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.
- This parameter can be set in gs_guc reload mode. The GaussDB kernel dynamically listens on the IP addresses specified by this parameter based on the policy of listening on new IP addresses, keeping listening on duplicate IP addresses, and disabling listening on invalid IP addresses. If an invalid IP address exists (for example, the IP address is not configured on the local host, the IP address is invalid, or the IP address has been listened on), the kernel fails to listen on the IP address. In this case, the value of listen_addresses does not match the actual listening IP address.
- If this parameter is set in gs_guc reload mode and all IP addresses in the parameter value are invalid, listening on new IP addresses fails and listening on all old IP addresses is canceled. If this parameter is left empty, new IP addresses are intercepted and old IP addresses are listened on.
- If listen_addresses is configured in the process startup parameter, this parameter is forcibly set to the configured value and will not be modified by reload.
- If the new parameter value is the same as the old parameter value, the listening action is not performed. Therefore, when the listen_addresses parameter is set and an invalid IP address exists in the list, the kernel fails to listen on the IP address. After the IP address becomes valid and the same parameter is set again, the kernel does not listen on the IP address because the two parameter values are the same. In this case, you need to run the gs_guc reload command to remove the IP address from the parameter value and add the IP address again.
- After this parameter is updated by using gs_guc reload, if an IP address is no longer listened on, you need to execute the gs_validate_ext_listen_ip() function to clear the connection. For details about the input parameters and execution, see "SQL Reference > Functions and Operators > Other System Functions" in Developer Guide.
- Do not use gs_guc to reload the value of listen_addresses on all DNs in "-N all" mode. This parameter can be set only on a single DN.
- Dynamically modifying listen_addresses is a high-risk operation. If the configuration is incorrect, the database may fail to accept new connections, affecting services. Exercise caution when performing this operation.
Risks and impacts of improper settings: none
local_bind_address
Parameter description: Specifies the local IP address bound to the current node for connecting to other nodes in the database.
Parameter type: string.
Unit: none
Value range: an IPv4 address. Multiple IP addresses are not supported.
Default value: After the database instance is installed, the default value is set based on the IP addresses of different instances in the public_cloud.conf configuration file. The default value of 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 in Table 1.
Setting suggestion: Retain the default value.
Risks and impacts of improper settings: none
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 database instance is installed using the configuration file, pay attention to the ports reserved in the communication matrix in the configuration file. For example, the port specified by the value of dataPortBase plus 1 needs to be reserved for internal tools Therefore, during database instance installation, the maximum port number is 65529 for DNs. 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 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 database.
Parameter type: integer.
Unit: none
Value range: an integer. 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_processes – autovacuum_max_workers – AUXILIARY_BACKENDS – AV_LAUNCHER_PROCS – max_inner_tool_connections – max_concurrent_autonomous_transactions – min(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.
The value range of this parameter varies depending on different instance memory specifications.
Memory Specifications |
Value Range for DNs |
---|---|
< 32 GB |
[10, 300] |
[32GB,64GB) |
[10, 600] |
[64GB,128GB) |
[10,2048] |
[128GB,256GB) |
[10,5000] |
[256GB,480GB) |
[10,11000] |
[480GB,512GB) |
[10,24000] |
[512GB,640GB) |
[10,25000] |
[640GB,768GB) |
[10,34000] |
[768GB,1024GB) |
[10,40000] |
[1024GB,1536GB) |
[10,55000] |
[1536GB,2048GB) |
[10,85000] |
≥ 2048 GB |
[10,110000] |
Default value:
85000 (196-core CPU/1536 GB memory); 55000 (128-core CPU/1024 GB memory, 104-core CPU/1024 GB memory, 96-core CPU/1024 GB memory); 40000 (96-core CPU/768 GB memory); 34000 (80-core CPU/640 GB memory); 25000 (64-core CPU/512 GB memory); 24000 (60-core CPU/480 GB memory); 11000 (32-core CPU/256 GB memory); 5000 (16-core CPU/128 GB memory); 2048 (8-core CPU/64 GB memory); 600 (4-core CPU/32 GB memory); 300 (4-core CPU/16 GB memory)
Setting method: This is a POSTMASTER parameter. Set it based on instructions in Table 1.
Setting suggestion: Retain the default value of this parameter in the primary node of the databases. 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 node fails to be started and the following error message is displayed: "invalid value for parameter "max_connections"." Alternatively, the memory fails to be allocated during the node startup and the following error message is displayed: "Cannot allocate memory."
- 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.
- 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.
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 formula for calculating the maximum value: 262143 – job_queue_processes – autovacuum_max_workers – max_connections – max_concurrent_autonomous_transactions – AUXILIARY_BACKENDS – AV_LAUNCHER_PROCS – min(max(max_connections/4,64),1024). The values of job_queue_processes, autovacuum_max_workers, max_connections, and max_concurrent_autonomous_transactions are related to the settings of the corresponding GUC parameters. AUXILIARY_BACKENDS indicates the number of reserved auxiliary threads and its value is fixed to 20. AV_LAUNCHER_PROCS indicates the number of launcher threads reserved for autovacuum and its value is fixed to 2.
Default value: 50 (196-core CPU/1536 GB memory, 128-core CPU/1024 GB memory, 104-core CPU/1024 GB memory, 96-core CPU/1024 GB memory, 96-core CPU/768 GB memory, 80-core CPU/640 GB memory, 64-core CPU/512 GB memory, 60-core CPU/480 GB memory, 32-core CPU/256 GB memory, 16-core CPU/128 GB memory, 8-core CPU/64 GB memory, 4-core CPU/32 GB memory); 10 (4-core CPU/16 GB memory)
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 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 large value, GaussDB requires more System V shared memories or semaphores, which may exceed the default maximum configuration of the OS. In this case, modify the value as needed.
Risks and impacts of improper settings: none
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 database to restore the connections. Therefore, exercise caution when using the reserved connections.
Parameter type: integer.
Unit: none
Value range: an integer ranging from 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 the preceding description.
Default value: 3
Setting method: This is a POSTMASTER parameter. Set it based on instructions in Table 1.
Setting suggestion: none
Risks and impacts of improper settings: none
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 in Table 1.
Setting suggestion: Retain the default value. 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 if max_connections is set to the maximum value.
Risks and impacts of improper settings: none
unix_socket_directory
Parameter description: Specifies the UDS directory for the GaussDB server to listen to connections from the client.
Parameter type: string.
Unit: none
Value range: valid path of a directory.
The value of this parameter depends on the maximum path length of a directory in the OS. If the value exceeds the limit, "Unix-domain socket path "xxx" is too long" is reported.
Default value: empty. The actual value is specified by the configuration file during installation.
Setting method: This is a POSTMASTER parameter. Set it based on instructions in Table 1.
Setting suggestion: none
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 locate the fault based on the startup logs.
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.
This is a POSTMASTER parameter. Set it based on instructions in Table 1.
Value range: a string. If this parameter is set to an empty string, the default group of the current user is used.
Default value: an empty string.
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.
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).
This is a POSTMASTER parameter. Set it based on instructions in Table 1.
Value range: 0000 to 0777
Default value: 0700
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.
application_name
Parameter description: Specifies the client name used in the current connection request.
This is a USERSET parameter. Set it based on instructions 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.
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.
Value range: a string.
Default value: empty (The actual value is the name of the application connected to the backend.)
connection_info
Parameter description: Specifies the database connection information, including the driver type, driver version, driver deployment path, and process owner.
This is a USERSET parameter used for O&M. You are advised not to set the parameter.
Value range: a string.
Default value: an empty string.
- An empty string indicates 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 Kernel XXX.X.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 display of driver_path and os_user is 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.
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 in Table 1.
Setting suggestion: Retain the default value.
plat_compat_server_port
Parameter description: Specifies the database configuration item in M-compatible mode. This parameter specifies the TCP port number for protocol listening.
Parameter type: integer.
Unit: none
Value range: 1024 to 65536
Default value: 65536, indicating that the listening port is not enabled.
Setting method: This is a POSTMASTER parameter. Set it based on instructions in Table 1.
Setting suggestion: The default value is 65536, indicating that the listening port is disabled. Ports 1024 to 65535 are valid listening ports. Set the parameter to a value of unused port.
Feedback
Was this page helpful?
Provide feedbackThank you very much for your feedback. We will continue working to improve the documentation.See the reply and handling status in My Cloud VOC.
For any further questions, feel free to contact us through the chatbot.
Chatbot