Open Source RDBMS - Seamless, Scalable, Stable and Free

한국어 | Login |Register

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



Checking Broker Status

Description

The cubrid broker status utility allows you to check the broker status such as number of completed jobs and the number of standby jobs.

Syntax

The following syntax shows how to check the CUBRID status; specifying <expr> as an argument indicates status monitoring of a specific broker and omitting an argument indicates status monitoring of all brokers registered in the Broker configuration file (cubrid_broker.conf).

cubrid broker status options [<expr>]

options : [ -b | -f [-l secs] | -q | -t | -s secs ]

Options

The following table shows options available with the cubrid broker status utility.

Option

Description

expr

Displays the status information of a specific broker whose name includes <expr>. If it is not specified, status information of all brokers are displayed.

-b

Displays the status information of a broker but does not display information on application server (CAS).

-f [-l secs]

Displays information of DB and host accessed by broker.
If it is used with the -b option, additional information on CAS is displayed.
The -l secs option is used to specify accumulation period (unit : sec.) when displaying the number of application servers whose client status is Waiting or Busy. If it is omitted, the default value (1 second) is specified.

-q

Displays standby jobs in the job queue.

-t

Displays results in tty mode on the screen. The output can be redirected and used as a file.

-s secs

Regularly displays the status of broker based on specified period. It returns to a command prompt if p is entered.

-f

Displays information of DB and host accessed by broker.

Example

If you do not specify an option or argument to check the status of all brokers, the following result is displayed.

% cubrid broker status

@ cubrid broker status

% query_editor  - cub_cas [28433,40820] /home/CUBRID/log/broker/query_editor.access /home/CUBRID/

 JOB QUEUE:0, AUTO_ADD_APPL_SERVER:ON, SQL_LOG_MODE:ALL:100000, SLOW_LOG:ON

 LONG_TRANSACTION_TIME:60, LONG_QUERY_TIME:60, SESSION_TIMEOUT:300

 KEEP_CONNECTION:AUTO, ACCESS_MODE:RW, MAX_QUERY_TIMEOUT:0

----------------------------------------

ID   PID   QPS   LQS PSIZE STATUS

----------------------------------------

 1 28434     0     0 50144 IDLE

 2 28435     0     0 50144 IDLE

 3 28436     0     0 50144 IDLE

 4 28437     0     0 50140 IDLE

 5 28438     0     0 50144 IDLE

 

% broker1  - cub_cas [28443,40821] /home/CUBRID/log/broker/broker1.access /home/CUBRID/

 JOB QUEUE:0, AUTO_ADD_APPL_SERVER:ON, SQL_LOG_MODE:ALL:100000, SLOW_LOG:ON

 LONG_TRANSACTION_TIME:60, LONG_QUERY_TIME:60, SESSION_TIMEOUT:300

 KEEP_CONNECTION:AUTO, ACCESS_MODE:RW, MAX_QUERY_TIMEOUT:0

----------------------------------------

ID   PID   QPS   LQS PSIZE STATUS

----------------------------------------

 1 28444     0     0 50144 IDLE

 2 28445     0     0 50140 IDLE

 3 28446     0     0 50144 IDLE

 4 28447     0     0 50144 IDLE

 5 28448     0     0 50144 IDLE

  • % query_editor : Broker name
  • cub_cas : Type of the CUBRID application server
  • [28433, 40820] : Broker process ID and connection port number of the Broker
  • /home/CUBRID/log/broker/query_editor.access : Path of the access log file of query_editor
  • JOB QUEUE : The number of standby jobs in the job queue
  • AUTO_ADD_APPL_SERVER : The value of the AUTO_ADD_APPL_SERVER parameter in cubrid_broker.conf is ON, which enables the application server to be added automatically.
  • SQL_LOG_MODE : The value of the SQL_LOG parameter in the cubrid_broker.conf file is ALL, which enables logs for all SQLs to be stored.
  • SLOW_LOG : The value of the SQL_LOG parameter in the cubrid_broker.conf file is ON, which enables long-duration queries or queries where an error occurred to be recorded in the SLOW SQL LOG file.
  • LONG_TRANSACTION_TIME : Execution time of transactions determined by long-duration transaction. It is regarded as long-duration transaction if transaction execution time exceeds 60 seconds.
  • LONG_QUERY_TIME : Execution time of queries determined by long-duration query. It is regarded as long-duration query if query execution time exceeds 60 seconds.
  • SESSION_TIMEOUT : The timeout value specified to disconnect application server (CAS) sessions in idle state (which any commit or rollback happens) after the transaction has started. If it exceeds specified time in this state, connection between application client and server is closed. The value of SESSION_TIMEOUT parameter in the cubrid_broker.conf file is 300 seconds.
  • KEEP_CONNECTION : The value of KEEP_CONNECTION parameter in the cubrid_broker.conf file is AUTO, which enables an application client to be connected to its application server (CAS) automatically.
  • ACCESS_MODE : The Broker action mode; both manipulation and looking up database are allowed in RW mode.
  • MAX_QUERY_TIMEOUT : Timeout value of query execution. If it exceeds specified time, the executed query is rolled back. No time limits if the value is 0.
  • ID : Serial number of the application server (CAS) within the Broker
  • PID : Application server (CAS) process ID within the Broker
  • QPS :  The number of queries processed per second
  • LQS : The number of long-duration queries processed per second
  • PSIZE : Size of the application server process
  • STATUS : The current status of the application server (BUSY, IDLE, CLIENT_WAIT, CLOSE_WAIT)

To check the status of broker, enter the code below.

% cubrid broker status -b

@ cubrid broker status

  NAME           PID  PORT  AS  JQ      REQ  TPS  QPS  LONG-T  LONG-Q ERR-Q

==========================================================================

* query_editor  4094 30000   5   0        0    0    0    0/60    0/60    0

* broker1       4104 33000   5   0        0    0    0    0/60    0/60    0

  • NAME : Broker name
  • PID : Process ID of the Broker
  • PORT : Port number of the Broker
  • AS : The number of application servers
  • JQ : The number of standby jobs in the job queue
  • REQ : The number of client requests processed by the Broker
  • TPS : The number of transactions processed per second (calculated only when the option is configured to "-b -s <sec>")
  • QPS : The number of queries processed per second (calculated only when the option is configured to "-b -s <sec>")
  • LONG-T : The number of transactions which exceed LONG_TRANSACTION_TIME; the value of the LONG_TRANSACTION_TIME parameter
  • LONG-Q : The number of queries which exceed LONG_QUERY_TIME; the value of the LONG_QUERY_TIME parameter
  • ERR-Q : The number of queries with errors found

Enter code below to check the status of broker whose name includes broker1 with the -q option and job status of a specific broker in the job queue. If you do not specify broker1 as an argument, list of jobs in the job queue for all brokers is displayed.

% cubrid broker status -q broker1

@ cubrid broker status

% broker1  - cub_cas [28443,40821] /home/CUBRID/log/broker/broker1.access /home/CUBRID/

 JOB QUEUE:0, AUTO_ADD_APPL_SERVER:ON, SQL_LOG_MODE:ALL:100000, SLOW_LOG:ON

 LONG_TRANSACTION_TIME:60, LONG_QUERY_TIME:60, SESSION_TIMEOUT:300

 KEEP_CONNECTION:AUTO, ACCESS_MODE:RW, MAX_QUERY_TIMEOUT:0

----------------------------------------

ID   PID   QPS   LQS PSIZE STATUS

----------------------------------------

 1 28444     0     0 50144 IDLE

 2 28445     0     0 50140 IDLE

 3 28446     0     0 50144 IDLE

 4 28447     0     0 50144 IDLE

 5 28448     0     0 50144 IDLE

Enter code below to input the monitoring interval of broker whose name includes broker1 with the -s option and monitor broker status regularly. If you do not specify broker1 as an argument, monitoring status for all brokers is performed regularly. It returns to a command prompt if q is not entered.

% cubrid broker status -s 5 broker1

% broker1  - cub_cas [28443,40821] /home/CUBRID/log/broker/broker1.access /home/CUBRID/

 JOB QUEUE:0, AUTO_ADD_APPL_SERVER:ON, SQL_LOG_MODE:ALL:100000, SLOW_LOG:ON

 LONG_TRANSACTION_TIME:60, LONG_QUERY_TIME:60, SESSION_TIMEOUT:300

 KEEP_CONNECTION:AUTO, ACCESS_MODE:RW, MAX_QUERY_TIMEOUT:0

----------------------------------------

ID   PID   QPS   LQS PSIZE STATUS

----------------------------------------

 1 28444     0     0 50144 IDLE

 2 28445     0     0 50140 IDLE

 3 28446     0     0 50144 IDLE

 4 28447     0     0 50144 IDLE

 5 28448     0     0 50144 IDLE

Display information of TPS and QPS to a file with the -t option. To cancel the process, press <CTRL+C> to stop program.

 % cubrid broker status -b -t -s 1 > log_file

Enter code below to regularly monitor status of all brokers including TPS and QPS with the -b and -s options.

% cubrid broker status -b -s 1

NAME           PID  PORT  AS  JQ      REQ  TPS  QPS  LONG-T  LONG-Q ERR-Q

===========================================================================

* query_editor 28433 40820   5   0        0    0    0    0/60    0/60    0

* broker1      28443 40821   5   0        0    0    0    0/60    0/60    0

Enter code below to view information of server/database accessed by broker, access time, the IP addresses accessed to CAS with the -f option.

$ cubrid broker status -f broker1

@ cubrid broker status

% broker1  - cub_cas [28443,40821] /home/CUBRID/log/broker/broker1.access /home/CUBRID/

 JOB QUEUE:0, AUTO_ADD_APPL_SERVER:ON, SQL_LOG_MODE:ALL:100000, SLOW_LOG:ON

 LONG_TRANSACTION_TIME:60, LONG_QUERY_TIME:60, SESSION_TIMEOUT:300

 KEEP_CONNECTION:AUTO, ACCESS_MODE:RW, MAX_QUERY_TIMEOUT:0

---------------------------------------------------------------------------------------------------------------------------------------------------------------------------

ID   PID   QPS   LQS PSIZE STATUS         LAST ACCESS TIME      DB       HOST   LAST CONNECT TIME       CLIENT IP   SQL_LOG_MODE   TRANSACTION STIME # CONNECT # RESTART
---------------------------------------------------------------------------------------------------------------------------------------------------------------------------

1 26946     0     0 51168 IDLE         2011/11/16 16:23:42  demodb  localhost 2011/11/16 16:23:40      10.0.1.101           NONE 2011/11/16 16:23:42         0         0

2 26947     0     0 51172 IDLE         2011/11/16 16:23:34      -          -                   -          0.0.0.0              -                   -         0         0

3 26948     0     0 51172 IDLE         2011/11/16 16:23:34      -          -                   -          0.0.0.0              -                   -         0         0

4 26949     0     0 51172 IDLE         2011/11/16 16:23:34      -          -                   -          0.0.0.0              -                   -         0         0

5 26950     0     0 51172 IDLE         2011/11/16 16:23:34      -          -                   -          0.0.0.0              -                   -         0         0

Meaning of every column in code above is as follows:

  • LAST ACCESS TIME : Last time when an application client accesses an application server (CAS)
  • DB : Name of a database which an application server (CAS) accesses most recently    
  • HOST : Name of a which an application server (CAS) accesses most recently
  • LAST CONNECT TIME: Most recent time when an application server (CAS) accesses a database
  • CLIENT IP : IP of an application clients currently being connected to an application server (CAS). If no application client is connected, 0.0.0.0 is displayed.
  • SQL_LOG_MODE : SQL logging mode of an application server (CAS). If the mode is same as the mode configured in Broker, "-" is displayed.
  • TRANSACTION STIME : Transaction start time
  • # CONNECT : The number of connections that an application client accesses to an application server (CAS) after starting Broker
  • # RESTART : The number of connection that an application server (CAS) is re-running after starting Broker

Enter code below to display information on AS (T W B Ns-W Ns-B) and CANCELED with the -b and -f options.

// The -f option is added upon execution of Broker status information. Configuring Ns-W and Ns-B are displayed as long as N seconds by using the -l.

% cubrid broker status -b -f -l 2

@ cubrid broker status

NAME          PID    PSIZE PORT  AS(T W B 2s-W 2s-B) JQ REQ TPS QPS LONG-T LONG-Q ERR-Q CANCELED ACCESS_MODE SQL_LOG

====================================================================================================================

query_editor 16784 56700 38000      5 0 0     0   0   0   0  0    0 0/60.0 0/60.0     0        0          RW     ALL

Meaning of every column in code above is as follows:

  • AS(T) : Total number of CASs being executed
  • AS(W) : The number of CASs in the status of Waiting
  • AS(B) : The number of CASs in the status of Busy
  • AS(Ns-W) : The number of CASs that the client belongs to has been waited for N seconds.
  • AS(Ns-B) : The number of CASs that the client belongs to has been Busy for N seconds.
  • CANCELED : The number of queries have canceled by user interruption since Broker is started (if it is used with the -l N option, it specifies the number of accumulations for N seconds.).