|
Measures reported by MsSqlLatchTest
A latch is a
"lightweight lock". A latch acts like a lock, in that its
purpose is to prevent data from changing unexpectedly. For example, when a
row of data is being moved from the buffer to the SQL Server storage
engine, a latch is used by SQL Server during this move to prevent the data
in the row from being changed during this very short time period. This not
only applies to rows of data, but to index information as well, as it is
retrieved by SQL Server.
Just like a lock, a latch
can prevent SQL Server from accessing rows in a database, which can hurt
performance. Because of this, latch wait time must be minimized.
The MsSqlLatchTest makes
the following measures of latch activity for an Microsoft SQL database.
| Measurement |
Description |
Measurement
Unit |
Interpretation |
| Latch_wait_rate
|
This
is the number of latch requests per second that could not be granted
immediately.
|
Waits/Sec
|
The
latch activity may vary from one server to another. Hence, it is
important to get baseline numbers for this metric, so that you can
compare "typical" latch activity against what is happening
currently. If latch activity is higher than expected, this often
indicates one of two problems. First, it may mean that the SQL Server
could use more memory. If latch activity is high, check the buffer
cache hit ratio is. If it is below 99%, the SQL server could probably
benefit from more memory. If the hit ratio is above 99%, then it could
be the I/O system that is contributing to the problem, and a faster
I/O system might improve server's performance. |
| Total_wait_time |
This
metric denotes the total wait time for latch requests that had to wait
in the last second.
|
Secs
|
Ideally,
this value should be close to 0. The larger this value is, the more
contention there is for latches and worse the performance of the
database. If the wait time is high, check the SYSPROCESSES table of
the database to see which latches are seeing most contention. |
|