Database Research & Development

  • Home
  • NoSQL
    • NoSQL
    • Cassandra
  • Databases
    • Database Theory
    • Database Designing
    • SQL Server Coding Standards
    • SQL Server
    • PostgreSQL
    • MySQL
    • Greenplum
    • Linux
  • Interviews
    • SQL Server Interviews
    • MySQL Interviews
    • SQL Puzzles
  • DBA Scripts
    • SQL Server DBA Scripts
    • PostgreSQL DBA Scripts
    • MySQL DBA Scripts
    • Greenplum DBA Scripts
  • Home
  • Blog Archives !
  • (: Laugh@dbrnd :)
  • Contact Me !
sqlserverinterviews
Home 2016 April SQL Server: The Important Performance Counters (dm_os_performance_counters)

SQL Server: The Important Performance Counters (dm_os_performance_counters)

This article is half-done without your Comment! *** Please share your thoughts via Comment ***

The SQL Server Performance Counters are the bread and butter for performance tuning exercise.

Using the performance counters, we can measure the current performance of the SQL Server basis on different criteria like Memory Information, Storage Information, CPU Information, Pages Information and other.

In this post, I am going to share some of the important Performance Counters for monitoring the SQL Server Performance.

Memory Information Counters:

Using this script, you can find the total amount of physical memory on the computer.

1
2
3
SELECT *FROM sys.dm_os_performance_counters
WHERE counter_name = 'Total Server Memory (KB)'
GO

Using this script, you can find different memory-related counters and its information.

1
2
3
SELECT *FROM sys.dm_os_performance_counters
WHERE counter_name LIKE '%Memory%'
GO

Page Information Counters:

Using this script, you can find that how long pages stay in the buffer cache in seconds. If the value is more significant, SQL Server does not read from disk, and it serves the request from the buffer only.

1
2
3
SELECT *FROM sys.dm_os_performance_counters
WHERE counter_name = 'Page life expectancy'
GO

It shows the value of the number of physical database page reads that are issued per second.
Around 80 per second is normal, but if it is above, you may get a timeout in your application.

1
2
3
SELECT *FROM sys.dm_os_performance_counters
WHERE counter_name = 'page reads/sec'
GO

It shows the number of requests to find a page in the buffer pool.

1
2
3
SELECT *FROM sys.dm_os_performance_counters
WHERE counter_name = 'Page lookups/sec'
GO

Using below script, you can find a different page related counters and its information.

1
2
3
SELECT *FROM sys.dm_os_performance_counters
WHERE counter_name LIKE '%Page%'
GO

User Connection Counter:

It shows the number of different users that are connected to the SQL Server.

1
2
3
SELECT *FROM sys.dm_os_performance_counters
WHERE counter_name = 'User Connections'
GO

Buffer Information Counters:

A greater value indicates that more significant number of requests are satisfied with the data cache and SQL Server is getting queries data from the memory instead of disk.

1
2
3
SELECT *FROM sys.dm_os_performance_counters
WHERE counter_name = 'Buffer Cache Hit Ratio'
GO

Using below script, You can find different information of the buffers.

1
2
3
SELECT *FROM sys.dm_os_performance_counters
WHERE counter_name LIKE '%Buffer%'
GO

Batch Requests Counter:

It shows the number of batches per second, which are received by the SQL Server. If the number is high, more queries are executed in SQL Server.

1
2
3
SELECT *FROM sys.dm_os_performance_counters
WHERE counter_name = 'Batch Requests/Sec'
GO

SQL Compilation Counter:

It shows the number of execution plan compilation per second by the SQL Server. The compilation of execution plan is resource intensive, and it should be lesser than the number of batches per second.

1
2
3
SELECT *FROM sys.dm_os_performance_counters
WHERE counter_name = 'SQL Compilations/Sec'
GO

Block Transaction Information Counters:

This blocking related counters are essential for finding the different information of the blocked transactions so that as much as we can avoid the deadlock situation.

1
2
3
SELECT *FROM sys.dm_os_performance_counters
WHERE counter_name LIKE '%block%'
GO

CPU Counters:

Using this script, You can find the usage of CPU in percentage.

1
2
3
SELECT *FROM sys.dm_os_performance_counters
WHERE counter_name = 'CPU usage %'
GO

Apr 20, 2016Anvesh Patel
SQL Server: Find the total row count and size of the TablesPostgreSQL: How to Install PostgreSQL 9.4 on Ubuntu 14.04?
Anvesh Patel
Anvesh Patel

Database Engineer

April 20, 2016 SQL Server, SQL Server DBA ScriptAnvesh Patel, database, database research and development, dbrnd, dm_os_performance_counters, performance counter, SQL Query, SQL Server, SQL Server Administrator, SQL Server Monitoring, SQL Server Performance Tunning, SQL Server Tips and Tricks, TSQL
About Me!

I'm Anvesh Patel, a Database Engineer certified by Oracle and IBM. I'm working as a Database Architect, Database Optimizer, Database Administrator, Database Developer. Providing the best articles and solutions for different problems in the best manner through my blogs is my passion. I have more than six years of experience with various RDBMS products like MSSQL Server, PostgreSQL, MySQL, Greenplum and currently learning and doing research on BIGData and NoSQL technology. -- Hyderabad, India.

About DBRND !

dbrnd

This is a personal blog (www.dbrnd.com).

Any views or opinions represented in this blog are personal and belong solely to the blog owner and do not represent those of people, institutions or organizations that the owner may or may not be associated with in professional or personal capacity, unless explicitly stated.

Feel free to challenge me, disagree with me, or tell me I’m completely nuts in the comments section of each blog entry, but I reserve the right to delete any comment for any reason whatsoever (abusive, profane, rude, or anonymous comments) - so keep it polite.

The content of this website is protected by copyright. No portion of this website may be copied or replicated in any form without the written consent of the website owner.

Recent Comments !
  • Anvesh Patel { Sure will do... } – May 27, 12:43 PM
  • Anvesh Patel { Great... } – May 27, 12:41 PM
  • Anvesh Patel { Great... } – May 27, 12:39 PM
  • Anvesh Patel { Great... } – May 27, 12:36 PM
  • Anvesh Patel { Great... } – May 27, 12:28 PM
  • Anvesh Patel { Great... } – May 27, 12:27 PM
  • Anvesh Patel { Great... } – May 27, 12:16 PM
  • Older »
Follow Me !
  • facebook
  • linkedin
  • twitter
  • youtube
  • google
  • flickr
© 2015 – 2019 All rights reserved. Database Research & Development (dbrnd.com)
Posting....