Tip

Using SQL Server counters - Part 1

Barrie Sosinsky, Contributor

The following tip, SQL Server counters, part 2 will look at more specific counters to use for monitoring SQL Server performance.

The Performance Monitor is one of three tools you can use for monitoring

    Requires Free Membership to View

SQL Server's performance (the other two are the Profiler and the Enterprise Manager). With more than 156 individual counters and the ability to create your own counters (as described in SQL Server Books Online) there is an almost bewildering array of tools for you to work with. The Windows server OS offers literally hundreds of possible counters for you to analyze. The words "information overload" come to mind. However, some counter types are much more valuable than others, and your particular setup and troubleshooting will direct your needs to one set of counters or another.

You can get to the Performance Monitor from a menu command or from an icon in the Profiler toolbar. There are six counters that are installed and monitored by default in version 7.0: Buffer Cache Hit Ratio, Page Reads, Page Writes, SQL Compilations/sec, Total Server Memory (KB), and User Connections. The version of SQL Server you are using makes a difference, because in version 6.5 there were five defaults: Cache Hit Ratio, three I/O counters (Page Reads/sec, Single Page Writes/sec, and Transactions/sec), as well as User Connections. These sets of counters measure similar metrics, but have slightly different meanings and therefore interpretations.

It's a good idea to measure counters one at a time. The most important counters are probably: Disk I/O, Processor, Memory, User Connections, and Network in that order. These are the major bottlenecks in database performance (generally), and they are the ones that you can apply the appropriate corrections to. You may find that the Performance Monitor collects more data than you need, which is commonly the case; or you may find that the performance feature that you want to analyze is removed from the chart by the next scan of data. Adjust the update frequency using the Options | Chart command so that you can better view the important aspects of your results.

You'll find that you will want to add more counters when you are troubleshooting or diagnosing problems. Counters are added to the Performance Monitor using the Edit | Add to Chart command or the Plus icon on the toolbar of that utility. In selecting a counter you also need to pay attention to various instances of the particular counters you are adding. For example, some instances are database specific, and some instances aren't. SQL Server 7.0 has 22 counters that express 70 instances, for example.

Be aware that many counters will create a drag on a system's performance, so be careful that you don't install a counter on a permanent basis that will impact your database's operation negatively. You will also find that some counters only run as long as the Performance Monitor is open and are closed when you exit the utility. In the next tip we'll take a further look at this important troubleshooting and optimization tool.


The following tip, SQL Server counters, part 2 will look at more specific counters to use for monitoring SQL Server performance.

Barrie Sosinsky is president of consulting company Sosinsky and Associates (Medfield MA). He has written extensively on a variety of computer topics. His company specializes in custom software (database and Web related), training and technical documentation.


This was first published in March 2005

There are Comments. Add yours.

 
TIP: Want to include a code block in your comment? Use <pre> or <code> tags around the desired text. Ex: <code>insert code</code>

REGISTER or login:

Forgot Password?
By submitting you agree to receive email from TechTarget and its partners. If you reside outside of the United States, you consent to having your personal data transferred to and processed in the United States. Privacy
Sort by: OldestNewest

Forgot Password?

No problem! Submit your e-mail address below. We'll send you an email containing your password.

Your password has been sent to:

Disclaimer: Our Tips Exchange is a forum for you to share technical advice and expertise with your peers and to learn from other enterprise IT professionals. TechTarget provides the infrastructure to facilitate this sharing of information. However, we cannot guarantee the accuracy or validity of the material submitted. You agree that your use of the Ask The Expert services and your reliance on any questions, answers, information or other materials received through this Web site is at your own risk.