Updated on 2024-05-07 GMT+08:00

Communication Library Parameters

This section describes parameter settings and value ranges for communications libraries.

tcp_keepalives_idle

Parameter description: Specifies the interval for transmitting keepalive signals on an OS that supports the TCP_KEEPIDLE socket option. If no keepalive signal is transmitted, the connection is in idle mode.

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

  • If the OS does not support TCP_KEEPIDLE, set this parameter to 0.
  • The parameter is ignored on an OS where connections are established using the Unix domain socket.

Value range: 0 to 3600. The unit is s.

Default value: 1min

tcp_keepalives_interval

Parameter description: Specifies the response time before retransmission on an OS that supports the TCP_KEEPINTVL socket option.

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

Value range: 0 to 180. The unit is s.

Default value: 30

  • If the OS does not support TCP_KEEPINTVL, set this parameter to 0.
  • The parameter is ignored on an OS where connections are established using the Unix domain socket.

tcp_keepalives_count

Parameter description: Specifies the number of keepalive signals that can be waited before the GaussDB server is disconnected from the client on an OS that supports the TCP_KEEPCNT socket option.

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

  • If the OS does not support TCP_KEEPCNT, set this parameter to 0.
  • The parameter is ignored on an OS where connections are established using the Unix domain socket.

Value range: 0 to 100. 0 indicates that the connection is immediately broken if GaussDB does not receive a keepalived signal from the client.

Default value: 20

tcp_user_timeout

Parameter description: Specifies the maximum duration for which the transmitted data can remain in the unacknowledged state before the TCP connection is forcibly closed when the GaussDB sends data on the OS that supports the TCP_USER_TIMEOUT socket option.

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

  • If the OS does not support the TCP_USER_TIMEOUT option, the value of this parameter does not take effect. The default value is 0.
  • The parameter is ignored on an OS where connections are established using the Unix domain socket.

Value Range: 0 to 3600000. The unit is ms. The value 0 indicates that the value is set based on the OS.

Default value: 0

Note that the effective result of this parameter varies according to the OS kernel.

  • For AArch64 EulerOS (Linux kernel version: 4.19), the timeout interval is the value of this parameter.
  • For x86 Euler 2.5 (Linux kernel version: 3.10), the timeout interval is not the value of this parameter but the maximum value in different ranges. That is, the timeout interval is the maximum upper limit of the total Linux TCP retransmission duration to which the value of tcp_user_timeout belongs. For example, if tcp_user_timeout is set to 40000, the total retransmission duration is 51 seconds.
    Table 1 Value of tcp_user_timeout for x86 Euler 2.5 (Linux kernel version: 3.10)

    Number of Linux TCP Retransmission Times

    Total Linux TCP Retransmission Duration Range (s)

    Example of tcp_user_timeout (ms)

    Actual Linux TCP Retransmission Duration (s)

    1

    (0.2,0.6]

    400

    0.6

    2

    (0.6,1.4]

    1000

    1.4

    3

    (1.4,3]

    2000

    3

    4

    (3,6.2]

    4000

    6.2

    5

    (6.2,12.6]

    10000

    12.6

    6

    (12.6,25.4]

    20000

    25.4

    7

    (25.4,51]

    40000

    51

    8

    (51,102.2]

    80000

    102.2

    9

    (102.2,204.6]

    150000

    204.6

    10

    (204.6,324.6]

    260000

    324.6

    11

    (324.6,444.6]

    400000

    444.6

    Note: The duration of each TCP retransmission increases exponentially with the number of retransmission times. When the duration of a TCP retransmission reaches 120 seconds, the duration of each subsequent retransmission does not change.

comm_tcp_mode

Parameter description: Specifies whether the communications library uses the TCP or SCTP protocol to set up a data channel. The parameter setting takes effect after you restart the cluster. (Due to specification changes, the current version no longer supports this feature. Do not use it.)

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

SCTP is no longer supported. This parameter is provided for compatibility, but its value is fixed at on.

Value range: Boolean. If this parameter is set to on for a CN, it connects to a DN using TCP. If this parameter is set to on for a DN, the DN communicates with each other using TCP.

Default value: on

comm_sctp_port

Parameter description: Specifies the TCP or SCTP port used to listen on data packet channels by the TCP proxy communications library or SCTP communications library. (Due to specification changes, the current version no longer supports this feature. Do not use it.)

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

This port number is automatically allocated during cluster deployment. Do not change the parameter. If the port number is incorrectly configured, the database communication fails.

Value range: an integer ranging from 0 to 65535

Default value: 25110 (The actual value is the specified value of the port GUC parameter plus 2.)

comm_control_port

Parameter description: Specifies the TCP listening port used by the TCP proxy communications library or SCTP communications library. (Due to specification changes, the current version no longer supports this feature. Do not use it.)

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

This port number is automatically allocated during cluster deployment. Do not change the parameter. If the port number is incorrectly configured, the database communication fails.

Value range: an integer ranging from 0 to 65535

Default value: 25111 (The actual value is the specified value of the port GUC parameter plus 3.)

comm_max_datanode

Parameter description: Specifies the maximum number of DNs supported by the TCP proxy communications library.

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

Value range: an integer ranging from 1 to 8192

Default value: maximum number of primary DNs supported by each node

Recommended value: 256

comm_max_stream

Parameter description: Specifies the maximum number of concurrent data streams supported by the TCP proxy communications library. The value of this parameter must be greater than: Number of concurrent data streams x Number of operators in each stream x Square of smp.

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

Value range: an integer ranging from 1 to 60000

Default value: 1024

  • You are advised not to set this parameter to a large value because this will cause high memory usage (256 bytes x comm_max_stream x comm_max_datanode). If the number of concurrent data streams is large, the query is complex and the SMP is large, resulting in insufficient memory.
  • If the process memory is sufficient, you can properly increase the value of comm_max_stream.

comm_max_receiver

Parameter description: Specifies the maximum number of receiver threads for the TCP proxy communications library.

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

Value range: an integer ranging from 1 to 50

Default value: 4

comm_quota_size

Parameter description: Specifies the maximum size of packets that can be consecutively sent by the TCP proxy communications library. When you use a 1GE NIC, a small value ranging from 20 KB to 40 KB is recommended.

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

Value range: an integer ranging from 0 to 2048000. The default unit is KB.

Default value: 1 MB

comm_usable_memory

Parameter description: Specifies the maximum memory available for buffering on the TCP proxy communications library on a DN.

This parameter must be set based on environment memory and the deployment method. If it is too large, an out-of-memory (OOM) exception may occur. If it is too small, the performance of the TCP proxy communications library or SCTP communications library may deteriorate. (Due to specification changes, the current version no longer supports this feature. Do not use it.)

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

Value range: an integer ranging from 100 x 1024 to 1073741823. The default unit is KB.

Default value: 4000 MB

comm_memory_pool

Parameter description: Specifies the size of the memory pool resources that can be used by the TCP proxy communications library on a DN.

If the memory used by the communications library is small, set this parameter to a small value. Otherwise, set it to a large value.

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

Value range: an integer ranging from 100 x 1024 to 1073741823. The default unit is KB.

Default value: 2000 MB

comm_memory_pool_percent

Parameter description: Specifies the percentage of the memory pool resources that can be used by the TCP proxy communications library on a DN. This parameter is used to adaptively reserve memory used by the communications libraries.

If the memory used by the communications library is small, set this parameter to a small value. Otherwise, set it to a large value.

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

Value range: an integer ranging from 0 to 100

Default value: 0

comm_client_bind

Parameter description: Specifies whether to bind the client of the communications library to a specified IP address when the client initiates a connection.

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

Value range: Boolean

  • on indicates that the client is bound to a specified IP address.
  • off indicates that the client is not bound to any IP addresses.

If multiple IP addresses of a node in the cluster are on the same network segment, set this parameter to on. In this case, the client is bound to the IP address specified by listen_addresses. The concurrency performance of the cluster depends on the number of random ports because a port can be used by only one client at a time.

Default value: off

comm_no_delay

Parameter description: Specifies whether to use the NO_DELAY attribute of a communications library connection.

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

Value range: Boolean

If packet loss occurs in the cluster because a large number of packets are received per second, set this parameter to off so that small packets are combined into large packets for transmission to reduce the total number of packets.

Default value: off

comm_debug_mode

Parameter description: Specifies whether to enable the debug mode of the TCP proxy communications library, that is, whether to print logs about the communication layer.

If this parameter is set to on, a huge number of logs will be printed, adding extra overhead and reducing database performance. Therefore, set it to on only in debugging scenarios.

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

Value range: Boolean

  • on indicates that the debug logs of the communications library are printed.
  • off indicates that the debug logs of the communications library are not printed.

Default value: off

comm_ackchk_time

Parameter description: Specifies the duration after which the communications library server automatically triggers ACK when no data packet is received.

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

Value range: an integer ranging from 0 to 20000. The unit is ms. 0: disabled

Default value: 2000 (2s)

comm_timer_mode

Parameter description: Specifies whether to enable the timer mode of the TCP proxy communications library, that is, whether to print timer logs in each phase of the communication layer.

If this parameter is set to on, a huge number of logs will be printed, adding extra overhead and reducing database performance. Therefore, set it to on only in debugging scenarios.

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

Value range: Boolean

  • on indicates that the timer logs of the communications library are printed.
  • off indicates that the timer logs of the communications library are not printed.

Default value: off

comm_stat_mode

Parameter description: Specifies whether to enable the statistics mode of the TCP proxy communications library, that is, whether to print statistics about the communication layer.

If this parameter is set to on, a huge number of logs will be printed, adding extra overhead and reducing database performance. Therefore, set it to on only in debugging scenarios.

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

Value range: Boolean

  • on indicates that the statistics logs of the communications library are printed.
  • off indicates that the statistics logs of the communications library are not printed.

Default value: off

enable_stateless_pooler_reuse

Parameter description: Specifies whether to enable the reuse of the pooler connection pool. After the parameter is enabled, existing idle TCP connections can be reused. The setting takes effect after the cluster is restarted.

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

Value range: Boolean

  • on or true indicates that the pooler reuse mode is enabled.
  • off or false indicates that the pooler reuse mode is disabled.

    This parameter should be set to a same value on CNs and DNs. If this parameter is set to off for CNs and on for DNs, the cluster communication fails. Set this parameter to the same value for CNs and DNs. Restart the cluster for the setting to take effect.

Default value: on

comm_cn_dn_logic_conn

Parameter description: Specifies whether logical connections are used between CNs and DNs. The setting takes effect after the cluster is restarted.

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

Value range: Boolean

  • on or true indicates that the connections between CNs and DNs are logical, with the libcomm component in use.
  • off or false indicates that the connections between CNs and DNs are physical, with the libpq component in use.

    Logical connections between CNs and DNs are no longer supported. This parameter is provided for compatibility, but its value is fixed at off.

Default value: off

COMM_IPC

Parameter description: Specifies whether to print the packet sending and receiving status of each communication node.

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

Value range: Boolean
  • on or true indicates that the function of logging packet sending and receiving status data is enabled.
  • off or false indicates that the function of logging packet sending and receiving status data is disabled.

    set logging_module='on(COMM_IPC)'; --Enabled

    set logging_module='off(COMM_IPC)'; --Disabled

    show logging_module; -- View the setting result.

    If this parameter is set to on, a huge number of logs will be printed, adding extra overhead and reducing database performance. Therefore, set it to on only in debugging scenarios and set it to off after debugging.

Default value: off

set logging_module='on(COMM_IPC)'; --Enabled

set logging_module='off(COMM_IPC)'; --Disabled

show logging_module; -- View the setting result.

If this parameter is set to on, a huge number of logs will be printed, adding extra overhead and reducing database performance. Therefore, set it to on only in debugging scenarios and set it to off after debugging.

Default value: off

COMM_PARAM

Parameter description: Specifies whether to print the session parameter settings during node communication.

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

Value range: Boolean
  • on or true indicates that the function of logging the session parameter settings is enabled.
  • off or false indicates that the function of logging the session parameter settings is disabled.

set logging_module='on(COMM_PARAM)'; --Enabled

set logging_module='off(COMM_PARAM)'; --Disabled

show logging_module; -- View the setting result.

If this parameter is set to on, a huge number of logs will be printed, adding extra overhead and reducing database performance. Therefore, set it to on only in debugging scenarios and set it to off after debugging.

Default value: off