Skip to content

Connection, memory, disk and thread parameters

View as Markdown

These parameters are set in coradb.conf. For how to set them, which ones can be changed while the server runs, and the full list of parameters, see System parameters.

The following are parameters related to the database server. The type and value range for each parameter are as follows:

Parameter name Type Default Min Max
coradb_port_id int 1,523 1
check_peer_alive string both
db_hosts string NULL
max_clients int 100 10 4,000
tcp_keepalive bool yes

coradb_port_id is a parameter to configure the port to be used by the master process. The default value is 1,523. If the port 1,523 is already being used on the server where CoraDB is installed or it is blocked by a firewall, an error message, which means the master server is not connected because the master process cannot be running properly, is displayed. If such port conflict occurs, the administrator must change the value of coradb_port_id considering the server environment.

check_peer_alive is a parameter to decide whether you execute the function checking that the client/server processes work well. The default is both.

The server process and the client process which connected with it wait each other's response. But if one of them cannot get the data for a long time(example: exceeding 5 sec), it will check or not if the other works well based on the configuration of check_peer_alive parameter. During this processes, if it is judged that the process doesn't work properly, it disconnect forcibly.

The values and the working methods are as follows.

  • both: As the server process accesses to the client process by ECHO(7) port, it checks if the client process works well. The client process also does the same thing to the server process(The default value).
  • server_only: Only the server process checks whether the client process works well.
  • client_only: Only the client process checks whether the server process works well.
  • none: None of the server and client processes check whether the other process works well.

Specially, if ECHO(7) port is blocked by the firewall configuration, each process can mistake that the other process was exited. Therefore, you should avoid this problem by setting this parameter's value as none.

db_hosts is a parameter to configure a list of the database server hosts to which clients can connect, and the connection order. The server host list consists of multiple server host names, and host names are separated by spaces or colons (:). Duplicate or non-existent names are ignored.

The following example shows the values of the db_hosts parameter. In this example, connections are attempted in the order of host1 > host2 > host3.

db_hosts="hosts1:hosts2:hosts3"

To connect to the server, the client first tries to connect to the specified server host referring to the database location file (databases.txt). If the connection fails, the client then tries to connect to the first one of the secondarily specified server hosts by referring to the value of the db_hosts parameter in the database configuration file (coradb.conf).

max_clients is a parameter to configure the maximum number of clients (usually broker application processes (CAS)) which allow concurrent connections to the database server. The max_clients parameter refers to the number of concurrent transactions per database server process. The default value is 100.

To guarantee performance while increasing the number of concurrent users in CoraDB environment, you need to make the appropriate value of the max_clients (coradb.conf) parameter and the MAX_NUM_APPL_SERVER (coradb_broker.conf) parameter. That is, you are required to configure the number of concurrent connections allowed by databases with the max_clients parameter. You should also configure the number of concurrent connections allowed by brokers with the MAX_NUM_APPL_SERVER parameter.

For example, in the coradb_broker.conf file, two node of a broker where the MAX_NUM_APPL_SERVER value of [%query_editor] is 50 and the MAX_NUM_APPL_SERVER value of [%BROKER1] is 50 is trying to connect one database server, the concurrent connections (max_clients value) allowed by the database server can be configured as follows:

Especially, the value must be greater than the sum specified in MAX_NUM_APPL_SERVER of every broker node which connects to the same database.

Note that the memory usage is affected by the value specified in max_clients. That is, if the number of value is high, the memory usage will increase regardless of whether or not the clients actually access the database.

tcp_keepalive is a parameter which specifies if you apply SO_KEEPALIVE option to TCP network protocol or not. The default is yes.

The following are parameters related to the memory used by the database server or client. The type and value range for each parameter are as follows:

Parameter name Type Default Min Max
data_buffer_size byte 32,768 × db_page_size 1,024 × db_page_size 2G(32bit), INT_MAX × db_page_size (64bit)
index_scan_oid_buffer_size byte 4 × db_page_size 0.05 × db_page_size 16 × db_page_size
max_agg_hash_size byte 2,097,152(2M) 32,768(32K) 134,217,728(128MB)
max_hash_list_scan_size byte 134,217,728 (128M) 0 134,217,728 (128M)
sort_buffer_size byte 128 × db_page_size 1 × db_page_size 2G(32bit), INT_MAX × db_page_size (64bit)
temp_file_memory_size_in_pages int 4 0 20
thread_stacksize byte 1,048,576 65,536

data_buffer_size is a parameter to configure the size of data buffer to be cached in the memory by the database server. You can set a unit as B, K, M, G or T, which stands for bytes, kilobytes(KB), megabytes(MB), gigabytes(GB) or terabytes(TB) respectively. If you omit the unit, bytes will be applied. The default value is 32,768 * db_page_size (512M when db_page_size is 16K), and the minimum value is 1,024 * db_page_size (16M when db_page_size is 16K). The maximum value in 64-bit CoraDB is INT_MAX * db_page_size. Note that the maximum value in 32-bit CoraDB is 2G.

The greater the value of the data_buffer_size parameter, the more data pages to be cached in the buffer, thus providing the advantage of decreased disk I/O cost. However, if this parameter is too large, the buffer pool can be swapped out by the operating system because the system memory is excessively occupied. It is recommended to configure the data_buffer_size parameter in a way the required memory size is less than two-thirds of the system memory size.

  • Required memory size = data buffer size (data_buffer_size)

index_scan_oid_buffer_size is a parameter to configure the size of buffer where the OID list is to be temporarily stored during the index scan. You can set unit K, which stands for KB (kilobytes). If you omit the unit, bytes will be applied. The default value is 4 * db_page_size (64K when db_page_size is 16K), and the minimum value is 0.05 * db_page_size (about 1K when db_page_size is 16K).

The size of the OID buffer tends to vary in proportion to the value of the index_scan_oid_buffer_size parameter and the page size set when the database was created. In addition, the bigger the size of such OID buffer, the more the index scan cost. You can set the value of the index_scan_oid_buffer_size by considering these factors.

max_agg_hash_size is a parameter to configure the maximum memory per transaction allocated for hashing the tuple groups in a query containing aggregation. The default is 2,097,152(2M), the minimum size is 32,768(32K), and the maximum size is 134,217,728(128MB).

If NO_HASH_AGGREGATE hint is specified, hash aggregate evaluation will not be used. As a reference, see agg_hash_respect_order.

max_hash_list_scan_size is a parameter to configure the maximum memory per transaction allocated for building hash table in a query containing subquerys. The default and maximum size is 128MB; the minimum is 0.

If this parameter is set to 0 or If NO_HASH_LIST_SCAN hint is specified, hash list scan will not be used.

sort_buffer_size is a parameter to configure the size of buffer to be used when a query is processing sorting. The server assigns one sort buffer for each client's sorting-request, and releases the assigned buffer memory when sorting is complete. A sorting query includes not only SELECT sorting query, but also index-creating query.

You can set a unit as B, K, M, G or T, which stand for bytes, kilobytes (KB), megabytes (MB), gigabytes (GB), and terabytes (TB) respectively. If you omit the unit, bytes will be applied. The default value is 128 * db_page_size (2M when db_page_size is 16K), and the minimum value is 1 * db_page_size (16K when db_page_size is 16K).

temp_file_memory_size_in_pages is a parameter to configure the number of buffer pages to cache temporary result of a query. The default value is 4 and the maximum value is 20.

  • Required memory size = the number of temporary memory buffer pages (temp_file_memory_size_in_pages * page size)
  • The number of temporary memory buffer pages = the value of the temp_file_memory_size_in_pages parameter
  • Page size = the value of the page size specified by the -s option of the coradb createdb utility during the database creation

The spaces to store the temporary result are as follows.

  • Cache buffer to store the temporary result (acquired by temp_file_memory_size_in_pages parameter)
  • Permanent volumes with the purpose of storing temporary data.
  • Temporary volumes

If the previous space is exhausted, then the next space is used as the following order: Cache buffer for storing temporary result -> Permanent volumes -> Temporary volumes.

thread_stacksize is a parameter to configure the stack size of a thread. The default value is 1048576 bytes. The value of the thread_stacksize parameter must not exceed the stack size allowed by the operating system.

The following are disk-related parameters for defining database volumes and storing files. The type and value range for each parameter are as follows:

Parameter name Type Default Min Max
db_volume_size byte 512M 0 20G
dont_reuse_heap_file bool no
log_volume_size byte 512M 20M 4G
temp_file_max_size_in_pages int -1
temp_volume_path string NULL
unfill_factor float 0.1 0.0 0.3
volume_extension_path string NULL
double_write_buffer_size byte 2M 0 32M
data_file_os_advise int 0 0 6
max_values_unpaged_list int 2,048 0 32,768
ro_data_buffer_size byte 512M 0
ro_data_buffer_pages int 32,768 0

db_volume_size is a parameter to configure the following values. You can set a unit as B, K, M, G or T, which stand for bytes, kilobytes (KB), megabytes (MB), gigabytes (GB), and terabytes (TB) respectively. If you omit the unit, bytes will be applied. The default value is 512M.

  • The default database volume size when coradb createdb and coradb addvoldb utility is used without --db-volume-size option.
  • The default size of volume that is added automatically when database is full.

dont_reuse_heap_file is a parameter to configure whether or not heap files, which are deleted when deleting the table (DROP TABLE), are to be reused when creating a new table (CREATE TABLE). If this parameter is set to no, the deleted heap files can be reused; if it is set to yes, the deleted heap files are not used when creating a new table. The default value is no.

log_volume_size is a parameter to configure the default size of log volume file when the coradb createdb utility is used without --log-volume-size option. You can set a unit as B, K, M, G or T, which stand for bytes, kilobytes (KB), megabytes (MB), gigabytes (GB) and terabytes (TB) respectively. If you omit the unit, bytes will be applied. The default value is 512M.

temp_file_max_size_in_pages is a parameter to configure the maximum number of pages to which temporary volumes can be extended. By default, this value is -1, which means that temporary volumes can occupy an unlimited disk space. A positive value will set a limit to these values (exceeding it may show an error and cancel some big queries).

If the parameter is configured to 0, temporary volumes are not created automatically; the administrator must create permanent volumes with the purpose of storing temporary data by using the coradb addvoldb utility.

For more details see Temporary volume

temp_volume_path is a parameter to configure the directory in which to create temporary volumes used for the execution of complex queries or sorting. The default value is the volume location configured during the database creation.

unfill_factor is a parameter to configure the rate of disk space to be allocated in a heap page for data updates. The default value is 0.1. That is, the rate of free space is configured to 10%. In principle, data in the table is inserted in physical order. However, if the size of the data increases due to updates and there is not enough space for storage in the given page, performance may degrade because updated data must be relocated to another page. To prevent such a problem, you can configure the rate of space for a heap page by using the unfill_factor parameter. The allowable maximum value is 0.3 (30%). In a database where data updates rarely occur, you can configure this parameter to 0.0 so that space will not be allocated in a heap page for data updates. If the value of the unfill_factor parameter is negative or greater than the maximum value, the default value (0.1) is used.

volume_extension_path is a parameter to configure the directory where automatically extended volumes are to be created. The default value is the volume location configured during the database creation.

double_write_buffer_size is a parameter to configure the memory and disk size of double writer buffer. Double write buffer protection against partial I/O writes can be disabled by setting this size to zero. By default, it is enabled and its size is 2M.

data_file_os_advise is a UNIX-only parameter that may be used to boost I/O performance. The parameter value is converted into a posix_fadvise() flag (for details about the flags see here).

Parameter value posix_fadvise flag
0 0
1 POSIX_FADV_NORMAL
2 POSIX_FADV_SEQUENTIAL
3 POSIX_FADV_RANDOM
4 POSIX_FADV_NOREUSE
5 POSIX_FADV_WILLNEED
6 POSIX_FADV_DONTNEED

max_values_unpaged_list is a parameter to configure the maximum number of values that can be stored in an unpaged list during query execution. Unpaged lists are used for small result sets that can be kept entirely in memory without being paged to disk. When a list exceeds this threshold, it is converted to a paged list file. The default value is 2,048. The maximum value is 32,768.

This parameter is used by the query executor and XASL generation to determine when to switch from in-memory lists to disk-based paged lists. Higher values keep more data in memory, improving performance for queries with moderately-sized result sets, but consume more memory. Lower values reduce memory usage but may cause more disk I/O.

ro_data_buffer_size is a parameter to configure the size of the buffer pool for read-only data pages. This buffer is used to cache read-only data pages separately from the main data buffer, which can improve performance for read-intensive workloads. You can set a unit as B, K, M, G or T, which stand for bytes, kilobytes (KB), megabytes (MB), gigabytes (GB), and terabytes (TB) respectively. If you omit the unit, bytes will be applied. The default value is 512M (equivalent to 32,768 pages with default page size).

The parameter automatically validates that values are at least 1,024 bytes if non-zero. Set based on the size of your read-only data and available memory. Larger values improve read performance but consume more memory. Set to 0 to disable the read-only buffer.

This parameter is preferred over ro_data_buffer_pages for specifying the buffer size using size units (e.g., ro_data_buffer_size=512M).

ro_data_buffer_pages is a parameter to configure the number of pages in the read-only data buffer pool. This is the legacy page-based specification of the read-only buffer size. The system internally converts this to bytes based on the page size. The default value is 32,768.

This parameter is deprecated and maintained for backward compatibility. It is recommended to use ro_data_buffer_size with size units instead of this parameter.

Thread management can be configured by threads parameters. The type and value range for each parameter are as follows:

Parameter name Type Default Min Max
thread_connection_pooling bool true
thread_connection_timeout_seconds int 300 -1 3600
thread_worker_pooling bool true
thread_worker_timeout_seconds int 300 -1 3600
loaddb_worker_count bool 8 2 64

If thread_connection_pooling parameter is true, all threads used for client connection management are pooled on server boot.

thread_connection_timeout_seconds is a parameter that configures wait time before stopping for threads handling connection management. After closing a connection, the thread will wait the value of the parameter expressed in seconds to be assigned a new connection. If no connection is assigned and the wait time expires, the thread stops. Another thread may be started the next time a connection comes. If parameter value is -1, threads never stop. They sleep until they are given a new assignment.

If thread_worker_pooling parameter is true, all threads used for client requests execution are pooled on server boot.

thread_worker_timeout_seconds is a parameter that configures wait time before stopping for threads handling client requests. After executing a request, the thread will wait the value of the parameter expressed in seconds to be assigned a request. If no client request is assigned and the wait time expires, the thread stops. Another thread may be started the next time a client request comes. If parameter value is -1, threads never stop. They sleep until they are given a new assignment.

loaddb_worker_count is a parameter that configures the maximum number of threads that can be dedicated for loaddb sessions. If a single loaddb session runs, it may use all threads. If multiple loaddb sessions run concurrently, the total number of threads of all sessions cannot exceed the parameter's value.