Open Source RDBMS - Seamless, Scalable, Stable and Free

한국어 | Login |Register

Versions available for this page: CUBRID 8.2.1 |  CUBRID 8.3.0 |  CUBRID 8.3.1 |  CUBRID 8.4.0 |  CUBRID 8.4.1 |  CUBRID 8.4.3 |  CUBRID 9.0.0 | 

Connection-Related 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 Value

Min

Max

cubrid_port_id

int

1523

1

 

check_peer_alive string both    

db_hosts

string

NULL

 

 

max_clients

int

100

10

10000

cubrid_port_id

cubrid_port_id is a parameter used 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 CUBRID 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 cubrid_port_id considering the server environment.

check_peer_alive

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 client processes connecting with a server process are the broker application server(cub_cas) process, the process copying replication logs(copylogdb), the process applying replication logs. (applylogdb), CSQL interpreter(csql), etc. 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 access to the client process by ECHO(7) port, it checks if the client process works well..The client process also do the same thing to the sever process(The default value).
  • server_only: Only the server process checks if the client process works well.
  • client_only: Only the client rocess checks if the server process works well.
  • none: Both of the server and client processes do not check if 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 exit.Therefore, you should avoid this problem by setting this parameter’s value as none.

db_hosts

db_hosts is a parameter used 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 (cubrid.conf).

max_clients

max_clients is a parameter used 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. The default value is 100.

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

For example, in the cubrid_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:

  • (the maximum number of 100 by each node of a broker) * (two node of a broker) + (10 spare for database server connections of internal CUBRID process such as database server connection of CSQL Interpreter or HA log replication process) = 210

Especially, in HA environment, 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.