Cassandra CQL Statements Test
Cassandra Query Language (CQL) is a query language for the Cassandra database. The Cassandra Query Language (CQL) is the primary language for communicating with the Cassandra database. The most basic way to interact with Cassandra is using the CQL shell, cqlsh. Using cqlsh, you can create keyspaces and tables, insert and query tables etc. When using the JPA annotations for queries, the result is prepared statements that will be executed against the database. Prepared statements have two phases for execution: preparation of the statement, and execution of the statement. These prepared statements will be stored in the prepared statement cache. If the prepared statements are not executed as and when the statements are prepared, then, it may be owing to reasons such as processing bottlenecks on the database server or inadequate resources (CPU, memory etc) allocated for execution of the statements or the database node in itself may be poorly configured. In addition, if more statements are prepared and are stored in the prepared statement cache, the statements may be evicted from the cache if the cache is not configured appropriately. To constantly maintain a steady configuration of the database node and its components, it is important to keep a vigil on the execution of the prepared statements. The Cassandra CQL Statements test helps administrators in this regard!
This test reports how well the prepared statements are cached and executed per second. In addition, this test also reports the rate at which the prepared statements are evicted from the cache and how well the regular statements are executed. Using this test, administrators can be alerted to inadequate sizing of the prepared statement cache and processing bottlenecks on the target database node.
Target of the test : A Cassandra Database
Agent deploying the test : An external/remote agent.
Outputs of the test : One set of results for the target Cassandra Database node being monitored.
Parameters | Description |
---|---|
Test Period |
How often should the test be executed. |
Host |
The host for which the test is to be configured. |
Port |
The port on which the specified host listens. By default, this is 9042. |
JMX Remote Port |
Here, specify the port at which the JMX listens for requests from remote hosts. Ensure that you specify the same port that you configured in the cassandra-env.sh file (if the target Cassandra Database node is installed on a Unix host) or the cassandra-env.ps1 file (if the target Cassandra Database node is installed on a Windows host) in the <CASSANDRA_HOME> directory used by the target Cassandra Database node. To know how to specify the remote port, refer to Enabling JMX Support for JRE. |
JMX User and JMX Password |
If JMX requires authentication only (but no security), then ensure that the user and password parameters are configured with the credentials of a user with read-write access to JMX. To know how to create this user, refer to Configuring the eG Agent to Support JMX Authentication. |
Confirm Password |
Confirm the Password by retyping it in this text box. |
Measurement | Description | Measurement Unit | Interpretation |
---|---|---|---|
Prepared statements |
Indicates the number of prepared statements cached per second during the last measurement period. |
Statements/sec |
CQL supports prepared statements. Prepared statements are an optimization that allows to parse a query only once but execute it multiple times with different concrete values. |
Executed prepared statements |
Indicates the number of prepared statements executed per second during the last measurement period. |
Statements/sec |
Any statement that uses at least one bind marker will need to be prepared. After which the statement can be executed by providing concrete values for each of its marker. A low value for this measure is a cause of concern. This may be due to the processing bottlenecks on the target database node or inadequate resource allocated to the target database node or the inadequate resource allocated to the execution of the statement. |
Evicted prepared statements |
Indicates the rate at which the prepared statements were evicted from the prepared statement cache during the last measurement period. |
Statements/sec |
A high value for this measure indicates that too many statements are prepared and most of them could not be stored in the prepared statement cache. This is mainly due to the inadequate configuration of the cache size. Administrators may therefore increase the size of the prepared statement cache to keep the value of this measure to a minimum. |
Regular statements |
Indicates the rate at which regular statements i.e., non prepared statements were executed during the last measurement period. |
Statements/sec |
|