Performance Counters for Database Mirroring
We have customers using database mirroring, so I wanted to take some time to write a quick post regarding database mirroring and performance monitoring. Microsoft has published an article titled “Database Mirroring Best Practices and Performance Considerations.” In that article, they mention how the SQL Server instances involved in mirroring (referred to as the principal and the mirror) will provide objects inside of System Monitor (i.e., Perfmon) that are specific for mirroring (SQLServer:Database Mirroring). They go on to list all of the important objects to monitor for database mirroring.
For the principal server in the mirror, you should monitor the following counters:
- Log Bytes Sent/sec: Number of bytes of the log sent to the mirror per second.
- Log Send Queue KB: Total kilobytes of the log that have not yet been sent to the mirror server.
- Transaction Delay: Delay (in milliseconds) in waiting for commit acknowledgement from the mirror. This counter reports the total delay for all the transactions in process at that time. To determine the average delay per transaction, divide this counter by the Transactions/sec counter. When running asynchronous mirroring, this counter will always be 0.
- Transactions/sec: The transaction throughput of the database. This counter is in the Databases performance object.
- Log Bytes Flushed/sec: The rate at which log records are written to the disk. This is the log generation rate of the application. It plays a very important role in determining database mirroring performance. This counter is in the Databases performance object.
- Disk Write Bytes/sec: The rate at which the disk is written to. This counter is in the Logical Disk performance object and represents. Monitor this counter for the data as well as the log disks.
And on the mirror:
- Redo Bytes/sec: Number of bytes of the transaction log applied on the mirror database per second.
- Redo Queue KB: Total kilobytes of hardened log that remain to be applied to the mirror database to roll it forward.
- Disk Write Bytes/sec: The rate at which the disk is written to. This counter is in the Logical Disk performance object and represents. Monitor this counter for the data as well as the log disks on the mirror.