MySQL Key Buffer Test

To minimize disk I/O, the MyISAM storage engine exploits a strategy that is used by many database management systems. It employs a cache mechanism to keep the most frequently accessed table blocks in memory:

  • For index blocks, a special structure called the key cache (or key buffer) is maintained. The structure contains a number of block buffers where the most-used index blocks are placed.

  • For data blocks, MySQL uses no special cache. Instead it relies on the native operating system file system cache.

If the size of the key buffer is inadequate or if the buffer pool is poorly sized, then, more often than not, the requests may not be serviced by the buffer pool. If the required data is not available in the key buffer, requests may have to be serviced directly from the disk which may cause severe overheads. Similarly too many table scans may hamper the request servicing capability of the key buffer to a great extent! To avoid such overheads, it is necessary for the administrators to constantly keep a vigil on the sizing of the key buffer and the read/write requests to the key buffer. The MySQL Key Buffer test helps administrators in this regard!

This test monitors the key buffer of the MyISAM storage engine and reports the current size of the key buffer and the size that has already been utilized by the key buffer. This test also helps administrators figure out how well read/write requests are serviced by the key buffer. Using this test, administrators can also identify the execution that is frequently performed on the key buffer. The statistics reported by this test help administrators analyze the usage of the key buffer, and provides them with useful pointers to fine-tune the configuration of the key buffer.

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

Specify Host name of the server for which the test is to be configured in this text box.

Port

Specify the port to which the specified host listens in this text box.

Database(DB)

Specify the name of a database on the target MySQL database server being monitored in the Database text box.

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.

Confirm Password

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

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.

Measurements made by the test

Measurement

Description

Measurement Unit

Interpretation

Buffer used size

Indicates the size of the key buffer that had already been utilized.

MB

A value close to the key_buffer_size variable in MySQL is an indication that the key buffer is currently experiencing size constraints.

Current buffer

Indicates the current size of the key buffer.

MB

 

Write hit

Indicates the percentage of requests to write a key block to the key buffer.

Percent

 

Read hit

Indicates the percentage of requests to read a key block from the key buffer.

Percent

Ideally, the value of this measure should be high.

A low value is a cause for concern, as it could indicate a delay in servicing read requests. To avoid such delays, administrators can increase the size of the key buffer.

Select full join

Indicates the number of joins that perform table scans because they do not use indexes.

Number

If this value is not 0, you should carefully check the indexes of your tables.

Select full range

Indicates the number of joins that used a range search on a reference table.

Number

 

Set option execution rate

Indicates the rate at which set command was executed on the key buffer during the last measurement period.

Executions/sec

 

ChangeDB execution rate

Indicates the rate at which Change database command was executed on the key buffer during the last measurement period.

Executions/sec

 

Show fields execution rate

Indicates the rate at which SHOW FIELDS command was executed on the key buffer during the last measurement period.

Executions/sec