MySQL InnoDb Lock Test

InnoDB implements standard row-level locking where there are two types of locks, shared ( S ) locks and exclusive ( X ) locks. A shared ( S ) lock permits the transaction that holds the lock to read a row in a table. An exclusive ( X ) lock permits the transaction that holds the lock to update or delete a row.

The locking activity of an InnoDB table in the database server must be monitored carefully because an application holding a specific lock for a long time could cause a number of other transactions relying on the same lock to fail. The MySQL InnoDb Lock test monitors the locking activity on the InnoDB tables in the database server instance.

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.

Confirm Password

Confirm the password by retyping it here.

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

InnoDB lock waits

Indicates the number of times operations that are performed on InnoDB tables had to wait for a row lock.

Number

 

InnoDB current locks

Indicates the number of row locks that are currently held by operations on InnoDB tables.

Number

A high value may indicate one of the following:

  • Too many transactions are happening

  • Locked resources are not being released properly

  • Locks are being held unnecessarily.

InnoDB lock time

Indicates the total time spent in acquiring row locks for InnoDB tables.

Seconds

 

InnoDB average lock time

Indicates the average time taken to acquire row locks for InnoDB tables.

Seconds

Ideally, the value of this measure should be low.

A high value may indicate one of the following:

  • Locked resources are not being released properly

  • Locks are being held unnecessarily.

InnoDB maximum lock time

Indicates the maximum time taken to acquire row locks for InnoDB tables.

Seconds