Database

Performance Counters for Database Mirroring

December 19, 2012

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.

Thomas LaRock is a Head Geek at SolarWinds and a Microsoft® Certified Master, Microsoft Data Platform MVP, VMware® vExpert, and former Microsoft Certified Trainer. He has over 20 years’ experience in the IT industry as a programmer, developer, analyst, and database administrator. LaRock has spent much of his career focused on data and database administration, which led to his being chosen as a Technical Evangelist for Confio Software in 2010, where his research and experience helped to create the initial versions of the software now known as SolarWinds® Database Performance Analyzer. LaRock has served on the board of directors for the Professional Association for SQL Server® (PASS), and is an avid blogger, author, and technical reviewer for numerous books about SQL Server management. He now focuses on working with customers to help resolve problems and answer questions regarding database performance tuning and virtualization for SQL Server, Oracle®, MySQL®, SAP®, and DB2®. He’s made it his mission to give IT and data professionals longer weekends.