MySQL Query Workload Test

A resource-hungry or a long-running query is one of the main reasons for performance degradation of the target database server instance. When such queries execute on the server, they hog almost all the available resources or keep the resources locked for long time periods, thus leaving little to no resources for carrying out other critical database operations. This can significantly slowdown the database server and adversely impact user experience with the server. To ensure peak performance of the target MySQL database server at all times, such queries should be rapidly identified and quickly optimized to minimize resource usage. This is where the MySQL Query Workload test helps.

At configured intervals, this test reports the maximum CPU and memory resources utilized by a query for execution. This test also throws light on the time duration taken by a query take for execution. Using the detailed diagnostics of this test, administrators can figure out inefficient queries and proceed to optimize them to enhance server performance.

Target of the test : A MySQL server

Agent deploying the test : An internal/remote agent

Outputs of the test : One set of results for the target database server instance being monitored

Configurable parameters for the test
Parameter Description

Test Period

How often should the test be executed.

Host

The IP address of the MySQL server.

Port

The port at which the specified host listens.

Database

Specify the name of a database on the target MySQL database server being monitored

Username and Password

The eG agent has to be configured with the credentials of a user who has server-wide Process and Select privileges on the monitored MySQL server. To know how to create such a user, refer to Pre-requisites for Monitoring the MySQL Server topic.

For the MySQL Bin Log test to run, the user should additionally possess the following privileges. To configure the above-mentioned user with the specific privileges, issue the commands given below:

GRANT REPLICATION CLIENT on *.* to '<username>'@'<IP_address_of_eG_agent>';

GRANT REPLICATION SLAVE on *.* to '<username>'@'<IP_address_of_eG_agent>';

GRANT EXECUTE on *.* to '<username>'@'<IP_address_of_eG_agent>';

Confirm Password

Confirm the password by retyping it here.

Allow Public Key

By default, the Allow Public Key flag is set to No. But, if the specified USER is created with caching_sha2_password as the authentication plugin, then the eG agent can connect to the target database cluster using RSA public key. To this effect, you have to set Allow Public Key flag to Yes.

SSL

By default, the SSL flag is set to No, indicating that the target MySQL database server is not SSL-enabled by default. To enable the test to connect to an SSL-enabled MySQL database server , set the SSL flag to Yes.

Verify CA

If the eG agent is required to establish an encrypted connection with the target MySQL database server by authenticating the server's identity through verifying the server CA certificate, set Verify CA flag to Yes. By default, this flag is set to No.

Truststore Password

This parameter is applicable only if the Verify CA parameter is set to Yes. To verify the target server certificate, provide the password of the truststore file which contains the server CA certificate in the Truststore Password text box. By default, this parameter is set to none.

Confirm Password

Confirm the Password by retyping it in the Confirm Password text box.

Keystore Password

This parameter is applicable only if the Verify CA parameter is set to Yes. To establish a connection with the target MySQL database server , the eG agent needs to have access to the client certificate. For this provide the password of the keystore file which contains the client certificate in the Keystore Password text box. By default, this parameter is set to none.

Confirm Password

Confirm the Password by retyping it in the Confirm Password text box.

Detailed Diagnosis

To make diagnosis more efficient and accurate, the eG Enterprise embeds an optional detailed diagnostic capability. With this capability, the eG agents can be configured to run detailed, more elaborate tests as and when specific problems are detected. To enable the detailed diagnosis capability of this test for a particular server, choose the On option. To disable the capability, click on the Off option.

The option to selectively enable/disable the detailed diagnosis capability will be available only if the following conditions are fulfilled:

  • The eG manager license should allow the detailed diagnosis capability
  • Both the normal and abnormal frequencies configured for the detailed diagnosis measures should not be 0.
Measurements made by the test
Measurement Description Measurement Unit Interpretation

Maximum query duration

Indicates the maximum time duration taken by the top query for execution.

Seconds

The detailed diagnosis of this measure lists the Thread ID, Statement ID, Schema name, Query duration, CPU percentage, memory percentage, Table lock wait time(Seconds), Temp disk tables created, Temp tables created, Rows sent, Rows examined, Select scan, Sort scan, Process ID, Thread OS ID, Username, Host name, Connection type and SQL text.

Using the detailed diagnosis, administrators can determine the top 5 queries based on the execution time.

Maximum CPU percentageMaximum Query CPU

Indicates the maximum percentage of CPU consumed by a query for execution.

Percentage

If the value of this measure is high, there may be an impact on the performance of the database server. To improve the performance, administrators need to optimize the queries.

The detailed diagnosis of this measure lists the Thread ID, Statement ID, Schema name, Query duration, CPU percentage, memory percentage, Table lock wait time(Seconds), Temp disk tables created, Temp tables created, Rows sent, Rows examined, Select scan, Sort scan, Process ID, Thread OS ID, Username, Host name, Connection type and SQL text.

Maximum Query Memory

Indicates the maximum percentage of memory consumed by a query for execution.

Percentage

The detailed diagnosis of this measure lists the Thread ID, Statement ID, Schema name, Query duration, CPU percentage, memory percentage, Table lock wait time(Seconds), Temp disk tables created, Temp tables created, Rows sent, Rows examined, Select scan, Sort scan, Process ID, Thread OS ID, Username, Host name, Connection type and SQL text.

Recently executed queries

Indicates the number of queries recently executed on this database server.

Number

If the number of queries executed recently is very high, it might be a indication of high workload on database server.

Average elapsed time

Indicates the average running time of the queries on this database server.

Seconds

If the average execution time of the queries is too high it might be an indication of high workload.