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

Kernel Resource Usage

This section describes kernel resource parameters. Whether these parameters take effect depends on OS settings.

max_files_per_process

Parameter description: Specifies the maximum number of simultaneously open files allowed by each database thread.

Parameter type: integer.

Unit: none

Value range: 25 to 2147483647

Default value: 1024

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

Setting suggestion: If the kernel is enforcing a proper limit, setting this parameter is not required. However, on some platforms, such as most Berkeley Software Distribution (BSD) systems, the kernel allows individual processes to open many more files than the system can support. If the message "Too many open files" is displayed, set this parameter to a smaller value. Generally, the system must meet this requirement: Number of file descriptors ≥ Maximum number of concurrent requests x Number of primary DNs on the current server x Value of max_files_per_process x 3.

Risks and impacts of improper settings: Set this parameter according to the actual situation. If the value is too small, the number of valid security file handles may be small. As a result, the cluster status is abnormal.

shared_preload_libraries

Parameter description: Specifies one or more shared libraries that need to be preloaded before the database is started. If multiple libraries are to be loaded, separate their names using commas (,). For example, '$libdir/mylib' will cause mylib.so (or mylib.sl on some platforms) to be preloaded before the standard library directory is loaded. Currently, only the SYSADMIN user can access and set this parameter.

  • If a specified library is not found, the GaussDB service will fail to start.
  • Each GaussDB-supported library has a special mark that is checked to guarantee compatibility. Therefore, libraries that do not support GaussDB cannot be loaded in this way.

Parameter type: string.

Unit: none

Value range: a string.

Default value: ''platform_compatibility_b,security_plugin''

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

Setting suggestion: You can preinstall the GaussDB's stored procedure library using the '$libdir/plXXX' syntax as described in the preceding text. XXX can only be pgsql, perl, tcl, or python.

By preloading a shared library and initializing it as required, the library startup time is avoided when the library is first used. However, the time to start each new server process may increase, even if that process never uses the library. Therefore, set this parameter only for libraries that will be used in most sessions.

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