SlideShare a Scribd company logo
DMVs And Performance Monitor
in SQL Server
By
Zeba Tabassum
Agenda
Definition
DMVs Type
DMVs Category
Disadvantage Of DMVs
Performance Monitor
Counters
DMV’s
Definition
Dynamic management views and functions return server state information
that can be used to monitor the health of a server instance, diagnose
problems, and tune performance.
Prior to SQL Server 2005, we had several system tables(for example
sysprocesses, syslockinfo etc.) to monitor the state of the system. Though
these system tables are still available in SQL Server 2005 and in later versions
but SQL Server 2005 introduced whole new set of Dynamic Management
Views
DMV’s Type
There are two types of dynamic management views:-
• Server-scoped DMV’s They reside in master database and provide SQL
Server instance wide information. To access these DMV we need to have
SELECT permission on the objects and VIEW SERVER STATE permission on
the server.
• Database-scoped DMV’s They reside in each database and provide
database wide information. To access these DMV we need to have SELECT
permission on the objects and these require VIEW DATABASE STATE
permission on the database.
Listing DMVs
SELECT name AS DMV_Name,
[type] AS DMV_Type,
type_desc
FROM sys.system_objects
WHERE name LIKE 'dm_%'
ORDER BY name
SELECT count(*) TotalDMVCount
FROM sys.system_objects
WHERE name LIKE 'dm_%'
Dmv's & Performance Monitor in SQL Server
DMVs
The most frequently used DMV sections are:
• Database
• Execution
• IO
• Index
• SQL operating system
Database DMVs
Sys.dm_db_log_space_usage
sys.dm_db_partition_stats
sys.dm_db_file_space_usage
Sys.dm_db_task_space_usage
Database DMVs
SELECT TOP 3 object_name(object_id) AS objname,
in_row_data_page_count,
in_row_reserved_page_count,
used_page_count,
reserved_page_count,
row_count
FROM sys.dm_db_partition_stats
GO
Dmv's & Performance Monitor in SQL Server
Execution Related DMVs
• sys.dm_exec_connections
• sys.dm_exec_sessions
• sys.dm_exec_requests
• sys.dm_exec_cached_plans
• sys.dm_exec_query_plans
• sys.dm_exec_sql_text
• sys.dm_exec_query_stats
Execution Related DMVs
SELECT session_id,
login_name,
last_request_end_time,
cpu_time
FROM sys.dm_exec_sessions
WHERE session_id >= 61
GO
Execution Related DMVs
SELECT connection_id,
session_id,
client_net_address,
auth_scheme
FROM sys.dm_exec_connections
WHERE session_id >= 61
Dmv's & Performance Monitor in SQL Server
Dmv's & Performance Monitor in SQL Server
I/O Related DMV’s
• sys.dm_io_virtual_file_stats
• sys.dm_io_pending_io_requests
• sys.dm_io_cluster_shared_drives
I/O Related DMV’s
--Shows I/O stats for (data and log files) and virtual files no. of read and write
SELECT *
FROM sys.dm_io_pending_io_requests
GO
SELECT TOP 5 db_name(database_id) DataBaseName,
file_id,
num_of_reads,
num_of_writes
FROM sys.dm_io_virtual_file_stats(NULL, NULL)
Dmv's & Performance Monitor in SQL Server
Index Related DMVs
• sys.dm_db_index_physical_stats
• sys.dm_db_index_usage_stats
• sys.dm_db_index_operational_stats
• sys.dm_db_missing_index_details
• sys.dm_db_missing_index_groups
• sys.dm_db_missing_index_group_stats
• sys.dm_db_missing_index_columns
Index Related DMVs
--- Returns system_scansCounts with different date and objects
fragmentation of index operations. --
DECLARE @DBName VARCHAR(50)='testnew'
DECLARE @dbid BIGINT-- Database DB Id
SET @dbid=DB_ID(@DBName)
SELECT @DBName AS DataBaseName,
system_scans,
last_system_scan
FROM sys.dm_db_index_usage_stats
WHERE database_id = @dbid
Index Related DMVs
SELECT @DBName AS DataBaseName,
object_id,
avg_fragmentation_in_percent,
fragment_count
FROM sys.dm_db_index_physical_stats (@dbid, NULL, NULL, NULL, NULL)
WHERE database_id = @dbid
AND fragment_count > 0
Dmv's & Performance Monitor in SQL Server
Dmv's & Performance Monitor in SQL Server
Operating System Related DMVs
• sys.dm_os_performance_counters
• sys.dm_os_schedulers
• sys.dm_os_nodes
• sys.dm_os_waiting_tasks
• sys.dm_os_wait_stats
Operating System Related DMVs
---Returning cached page count for each database
SELECT COUNT(*)AS cached_pages_count,
db_name(database_id) AS database_name,
database_id
FROM sys.dm_os_buffer_descriptors
WHERE database_id NOT IN ( 32767, 4, 2, 1,3, 5 )
GROUP BY db_name(database_id),
database_id
ORDER BY cached_pages_count DESC;
GO
Operating System Related DMVs
--How memory is used overall on the server, and how much memory is
available
SELECT total_physical_memory_kb,
available_physical_memory_kb,
total_page_file_kb,
system_memory_state_desc
FROM
sys.dm_os_sys_memory
Dmv's & Performance Monitor in SQL Server
Disadvantages
• The biggest disadvantage in my opinion is the data in the DMVs is reset
upon SQL restart. So if you are trying to do trending type of reports, you'll
need to capture this DMV data on a regular basis to a DW somewhere.
DMV data is not guaranteed to be accurate at the time of retrieval. They
are updated asynchronously.
Performance Monitor
Performance Monitor, commonly referred to as PerfMon, is a Microsoft
Windows utility that allows us to capture :-
statistical information about the hardware environment, operating system,
and any applications that expose properties and counters.
We will learn how to use System Monitor to gather counters into counter
logs, which can be used to troubleshoot system and performance issues.
There are five major resource areas that can cause bottlenecks and affect
server performance:
physical disk,
memory,
process,
CPU, and
Network
If any of these resources are overutilized, your server or application can
become noticeably slow or can even crash.
Performance Counters
LogicalDisk% Free Space
This measures the percentage of free space on the selected logical disk drive.
Take note if this falls below 15 percent, you risk running out of free space for
the OS to store critical files. One obvious solution here is to add more disk
space.
PhysicalDisk% Idle Time
This measures the percentage of time the disk was idle during the sample interval. If
this counter falls below 20 percent, the disk system is saturated. You may consider
replacing the current disk system with a faster disk system.
Disk Counters
PhysicalDiskAvg. Disk Sec/Read :This measures the average time, in seconds,
to read data from the disk.
PhysicalDiskAvg. Disk Sec/Write:This measures the average time, in seconds,
it takes to write data to the disk.
PhysicalDiskAvg. Disk Queue Length :
This indicates how many I/O operations are waiting for the hard drive to
become available. If the value here is larger than the two times the number of
spindles, that means the disk itself may be the bottleneck.
Memory Counters
MemoryCache Bytes :This indicates the amount of memory being used for
the file system cache. There may be a disk bottleneck if this value is greater
than 300MB.
Memory% Committed Bytes in Use:This measures the ratio of Committed
Bytes to the Commit Limit—in other words, the amount of virtual memory in
use. This indicates insufficient memory if the number is greater than 80
percent. The obvious solution for this is to add more memory.
MemoryAvailable Mbytes:This measures the amount of physical memory, in
megabytes, available for running processes. If this value is less than 5 percent
of the total physical RAM, that means there is insufficient memory, and that
can increase paging activity. To resolve this problem, you should simply add
more memory.
MemoryPages per Second :This measures the rate at which pages are read
from or written to disk to resolve hard page faults. If the value is greater than
1,000, as a result of excessive paging, there may be a memory leak.
Processor Counters
Processor% Processor Time:This measures the percentage of elapsed time
the processor spends executing a non-idle thread. If the percentage is greater
than 85 percent, the processor is overwhelmed and the server may require a
faster processor.
Processor% User Time :This measures the percentage of elapsed time the
processor spends in user mode. If this value is high, the server is busy with
the application. One possible solution here is to optimize the application that
is using up the processor resources.
SystemProcessor Queue Length
This indicates the number of threads in the processor queue. The server
doesn't have enough processor power if the value is more than two times the
number of CPUs for an extended period of time.
Network Counters
Network InterfaceBytes Total/Sec :
This measures the rate at which bytes are sent and received over each
network adapter, including framing characters. The network is saturated if
you discover that more than 70 percent of the interface is consumed. For a
100-Mbps NIC, the interface consumed is 8.7MB/sec (100Mbps = 100000kbps
= 12.5MB/sec* 70 percent). In a situation like this, you may want to add a
faster network card or segment the network.
Network InterfaceOutput Queue Length:
This measures the length of the output packet queue, in packets. There is
network saturation if the value is more than 2. You can address this problem
by adding a faster network card or segmenting the network.
SQL Server Counters
SQLServer: General Statistics – User Connections
SQLServer: Memory Manager – Memory Grants Pending
SQLServer: SQL Statistics – Batch Requests/sec
SQLServer: SQL Statistics – Compilations/sec
SQLServer: SQL Statistics – Recompilations/sec
SQLServer:BufferManager - Buffer Cache hit ratio
This is the percentage of requests serviced by data cache. When cache is
properly used, this should be over 90%. The counter can be improved by
adding more RAM.
SQLServer:Databases,
SQL Server Counters
SQLServer:Exec Statistics,
SQLServer:General Statistics,
SQLServer:Latches,
SQLServer:Locks– Average Wait Time
This counter shows the average time needed to acquire a lock. This value needs to
be as low as possible.
SQLServer:MemoryManager– Target Server Memory (KB):
indicates how much memory SQL Server “wants”.
SQLServer:MemoryManager— Total Server Memory (KB):
Indicates how much memory SQL Server is actually using.
SQLServer:PlanCache
SQLServer:Access Methods – Full scans/sec:
higher numbers (> 1 or 2) may mean you are not using indexes and resorting to
table scans instead.

More Related Content

PPTX
Ten Blockchain Applications
PPTX
Openstack Swift - Lots of small files
PPTX
HBase Vs Cassandra Vs MongoDB - Choosing the right NoSQL database
PPTX
Microservices architecture overview v2
PPT
SQL Server Profiler & Performance Monitor - SarabPreet Singh
PDF
Best Practices For Workflow
PDF
Sales and inventory management project report
DOCX
obiee 12c installation guidelines
Ten Blockchain Applications
Openstack Swift - Lots of small files
HBase Vs Cassandra Vs MongoDB - Choosing the right NoSQL database
Microservices architecture overview v2
SQL Server Profiler & Performance Monitor - SarabPreet Singh
Best Practices For Workflow
Sales and inventory management project report
obiee 12c installation guidelines

What's hot (20)

PPSX
Blockchain HyperLedger Fabric Internals - Clavent
PDF
Deep Dive: a technical insider's view of NetBackup 8.1 and NetBackup Appliances
PPTX
IndexedDB - An Efficient Way to Manage Data
PPTX
CASE STUDY ON EVOTING USING BLOCKCHAIN1.pptx
PDF
Building zero data loss pipelines with apache kafka
DOCX
online shopping
PDF
MySQL Parallel Replication: All the 5.7 and 8.0 Details (LOGICAL_CLOCK)
PDF
Using all of the high availability options in MariaDB
PPTX
Consensus Algorithms - Nakov @ jProfessionals - Jan 2018
PPTX
HTML5 Real Time and WebSocket Code Lab (SFHTML5, GTUGSF)
PPT
How Hadoop Revolutionized Data Warehousing at Yahoo and Facebook
PDF
Stl meetup cloudera platform - january 2020
PPTX
Mini Project presentation for MCA
PDF
Wireshark http - 2110165028
PPTX
Smart Contract & Ethereum
PDF
Nginx Architecture
PPTX
SQL Server Wait Types Everyone Should Know
ODP
Que demonios es eso de Devops (y porquedebería interesarme)
PDF
ONLINE SHOPPING SYSTEM -SEPM
PPTX
online Book Selling.pptx
Blockchain HyperLedger Fabric Internals - Clavent
Deep Dive: a technical insider's view of NetBackup 8.1 and NetBackup Appliances
IndexedDB - An Efficient Way to Manage Data
CASE STUDY ON EVOTING USING BLOCKCHAIN1.pptx
Building zero data loss pipelines with apache kafka
online shopping
MySQL Parallel Replication: All the 5.7 and 8.0 Details (LOGICAL_CLOCK)
Using all of the high availability options in MariaDB
Consensus Algorithms - Nakov @ jProfessionals - Jan 2018
HTML5 Real Time and WebSocket Code Lab (SFHTML5, GTUGSF)
How Hadoop Revolutionized Data Warehousing at Yahoo and Facebook
Stl meetup cloudera platform - january 2020
Mini Project presentation for MCA
Wireshark http - 2110165028
Smart Contract & Ethereum
Nginx Architecture
SQL Server Wait Types Everyone Should Know
Que demonios es eso de Devops (y porquedebería interesarme)
ONLINE SHOPPING SYSTEM -SEPM
online Book Selling.pptx
Ad

Similar to Dmv's & Performance Monitor in SQL Server (20)

PPTX
SQL Explore 2012: P&T Part 1
PPTX
Monitoring sql server
PPTX
SQL Server Admin Best Practices with DMV's
PPTX
Sql server troubleshooting
PPT
Sql Server Performance Tuning
PPTX
Sql server performance tuning
PPTX
PASS VC: SQL Server Performance Monitoring and Baselining
PPTX
Perfmon And Profiler 101
PPTX
End-to-end Troubleshooting Checklist for Microsoft SQL Server
PPT
Troubleshooting SQL Server
PDF
Performance tuning in sql server
PDF
SQL Server Performance Analysis
PDF
Ajuste (tuning) del rendimiento de SQL Server 2008
PPTX
Perfmon And Profiler 101
PPT
Performance Tuning And Optimization Microsoft SQL Database
PPT
Sql server performance tuning
PPTX
Database performance monitoring:Key to seamless application performance
PPTX
Objective SQL Server Performance
PPTX
Sql server lesson12
PPSX
Sql server lesson12
SQL Explore 2012: P&T Part 1
Monitoring sql server
SQL Server Admin Best Practices with DMV's
Sql server troubleshooting
Sql Server Performance Tuning
Sql server performance tuning
PASS VC: SQL Server Performance Monitoring and Baselining
Perfmon And Profiler 101
End-to-end Troubleshooting Checklist for Microsoft SQL Server
Troubleshooting SQL Server
Performance tuning in sql server
SQL Server Performance Analysis
Ajuste (tuning) del rendimiento de SQL Server 2008
Perfmon And Profiler 101
Performance Tuning And Optimization Microsoft SQL Database
Sql server performance tuning
Database performance monitoring:Key to seamless application performance
Objective SQL Server Performance
Sql server lesson12
Sql server lesson12
Ad

Recently uploaded (20)

PPTX
STUDY DESIGN details- Lt Col Maksud (21).pptx
PPT
ISS -ESG Data flows What is ESG and HowHow
PPTX
Business Acumen Training GuidePresentation.pptx
PPTX
Microsoft-Fabric-Unifying-Analytics-for-the-Modern-Enterprise Solution.pptx
PDF
Business Analytics and business intelligence.pdf
PDF
22.Patil - Early prediction of Alzheimer’s disease using convolutional neural...
PPTX
IBA_Chapter_11_Slides_Final_Accessible.pptx
PPTX
Data_Analytics_and_PowerBI_Presentation.pptx
PDF
Galatica Smart Energy Infrastructure Startup Pitch Deck
PPTX
iec ppt-1 pptx icmr ppt on rehabilitation.pptx
PPTX
climate analysis of Dhaka ,Banglades.pptx
PPTX
Supervised vs unsupervised machine learning algorithms
PPTX
DISORDERS OF THE LIVER, GALLBLADDER AND PANCREASE (1).pptx
PPTX
advance b rammar.pptxfdgdfgdfsgdfgsdgfdfgdfgsdfgdfgdfg
PPTX
Acceptance and paychological effects of mandatory extra coach I classes.pptx
PPTX
mbdjdhjjodule 5-1 rhfhhfjtjjhafbrhfnfbbfnb
PDF
168300704-gasification-ppt.pdfhghhhsjsjhsuxush
PDF
Recruitment and Placement PPT.pdfbjfibjdfbjfobj
PPTX
Introduction to Basics of Ethical Hacking and Penetration Testing -Unit No. 1...
PPTX
ALIMENTARY AND BILIARY CONDITIONS 3-1.pptx
STUDY DESIGN details- Lt Col Maksud (21).pptx
ISS -ESG Data flows What is ESG and HowHow
Business Acumen Training GuidePresentation.pptx
Microsoft-Fabric-Unifying-Analytics-for-the-Modern-Enterprise Solution.pptx
Business Analytics and business intelligence.pdf
22.Patil - Early prediction of Alzheimer’s disease using convolutional neural...
IBA_Chapter_11_Slides_Final_Accessible.pptx
Data_Analytics_and_PowerBI_Presentation.pptx
Galatica Smart Energy Infrastructure Startup Pitch Deck
iec ppt-1 pptx icmr ppt on rehabilitation.pptx
climate analysis of Dhaka ,Banglades.pptx
Supervised vs unsupervised machine learning algorithms
DISORDERS OF THE LIVER, GALLBLADDER AND PANCREASE (1).pptx
advance b rammar.pptxfdgdfgdfsgdfgsdgfdfgdfgsdfgdfgdfg
Acceptance and paychological effects of mandatory extra coach I classes.pptx
mbdjdhjjodule 5-1 rhfhhfjtjjhafbrhfnfbbfnb
168300704-gasification-ppt.pdfhghhhsjsjhsuxush
Recruitment and Placement PPT.pdfbjfibjdfbjfobj
Introduction to Basics of Ethical Hacking and Penetration Testing -Unit No. 1...
ALIMENTARY AND BILIARY CONDITIONS 3-1.pptx

Dmv's & Performance Monitor in SQL Server

  • 1. DMVs And Performance Monitor in SQL Server By Zeba Tabassum
  • 2. Agenda Definition DMVs Type DMVs Category Disadvantage Of DMVs Performance Monitor Counters
  • 3. DMV’s Definition Dynamic management views and functions return server state information that can be used to monitor the health of a server instance, diagnose problems, and tune performance. Prior to SQL Server 2005, we had several system tables(for example sysprocesses, syslockinfo etc.) to monitor the state of the system. Though these system tables are still available in SQL Server 2005 and in later versions but SQL Server 2005 introduced whole new set of Dynamic Management Views
  • 4. DMV’s Type There are two types of dynamic management views:- • Server-scoped DMV’s They reside in master database and provide SQL Server instance wide information. To access these DMV we need to have SELECT permission on the objects and VIEW SERVER STATE permission on the server. • Database-scoped DMV’s They reside in each database and provide database wide information. To access these DMV we need to have SELECT permission on the objects and these require VIEW DATABASE STATE permission on the database.
  • 5. Listing DMVs SELECT name AS DMV_Name, [type] AS DMV_Type, type_desc FROM sys.system_objects WHERE name LIKE 'dm_%' ORDER BY name SELECT count(*) TotalDMVCount FROM sys.system_objects WHERE name LIKE 'dm_%'
  • 7. DMVs The most frequently used DMV sections are: • Database • Execution • IO • Index • SQL operating system
  • 9. Database DMVs SELECT TOP 3 object_name(object_id) AS objname, in_row_data_page_count, in_row_reserved_page_count, used_page_count, reserved_page_count, row_count FROM sys.dm_db_partition_stats GO
  • 11. Execution Related DMVs • sys.dm_exec_connections • sys.dm_exec_sessions • sys.dm_exec_requests • sys.dm_exec_cached_plans • sys.dm_exec_query_plans • sys.dm_exec_sql_text • sys.dm_exec_query_stats
  • 12. Execution Related DMVs SELECT session_id, login_name, last_request_end_time, cpu_time FROM sys.dm_exec_sessions WHERE session_id >= 61 GO
  • 13. Execution Related DMVs SELECT connection_id, session_id, client_net_address, auth_scheme FROM sys.dm_exec_connections WHERE session_id >= 61
  • 16. I/O Related DMV’s • sys.dm_io_virtual_file_stats • sys.dm_io_pending_io_requests • sys.dm_io_cluster_shared_drives
  • 17. I/O Related DMV’s --Shows I/O stats for (data and log files) and virtual files no. of read and write SELECT * FROM sys.dm_io_pending_io_requests GO SELECT TOP 5 db_name(database_id) DataBaseName, file_id, num_of_reads, num_of_writes FROM sys.dm_io_virtual_file_stats(NULL, NULL)
  • 19. Index Related DMVs • sys.dm_db_index_physical_stats • sys.dm_db_index_usage_stats • sys.dm_db_index_operational_stats • sys.dm_db_missing_index_details • sys.dm_db_missing_index_groups • sys.dm_db_missing_index_group_stats • sys.dm_db_missing_index_columns
  • 20. Index Related DMVs --- Returns system_scansCounts with different date and objects fragmentation of index operations. -- DECLARE @DBName VARCHAR(50)='testnew' DECLARE @dbid BIGINT-- Database DB Id SET @dbid=DB_ID(@DBName) SELECT @DBName AS DataBaseName, system_scans, last_system_scan FROM sys.dm_db_index_usage_stats WHERE database_id = @dbid
  • 21. Index Related DMVs SELECT @DBName AS DataBaseName, object_id, avg_fragmentation_in_percent, fragment_count FROM sys.dm_db_index_physical_stats (@dbid, NULL, NULL, NULL, NULL) WHERE database_id = @dbid AND fragment_count > 0
  • 24. Operating System Related DMVs • sys.dm_os_performance_counters • sys.dm_os_schedulers • sys.dm_os_nodes • sys.dm_os_waiting_tasks • sys.dm_os_wait_stats
  • 25. Operating System Related DMVs ---Returning cached page count for each database SELECT COUNT(*)AS cached_pages_count, db_name(database_id) AS database_name, database_id FROM sys.dm_os_buffer_descriptors WHERE database_id NOT IN ( 32767, 4, 2, 1,3, 5 ) GROUP BY db_name(database_id), database_id ORDER BY cached_pages_count DESC; GO
  • 26. Operating System Related DMVs --How memory is used overall on the server, and how much memory is available SELECT total_physical_memory_kb, available_physical_memory_kb, total_page_file_kb, system_memory_state_desc FROM sys.dm_os_sys_memory
  • 28. Disadvantages • The biggest disadvantage in my opinion is the data in the DMVs is reset upon SQL restart. So if you are trying to do trending type of reports, you'll need to capture this DMV data on a regular basis to a DW somewhere. DMV data is not guaranteed to be accurate at the time of retrieval. They are updated asynchronously.
  • 29. Performance Monitor Performance Monitor, commonly referred to as PerfMon, is a Microsoft Windows utility that allows us to capture :- statistical information about the hardware environment, operating system, and any applications that expose properties and counters. We will learn how to use System Monitor to gather counters into counter logs, which can be used to troubleshoot system and performance issues.
  • 30. There are five major resource areas that can cause bottlenecks and affect server performance: physical disk, memory, process, CPU, and Network If any of these resources are overutilized, your server or application can become noticeably slow or can even crash.
  • 31. Performance Counters LogicalDisk% Free Space This measures the percentage of free space on the selected logical disk drive. Take note if this falls below 15 percent, you risk running out of free space for the OS to store critical files. One obvious solution here is to add more disk space. PhysicalDisk% Idle Time This measures the percentage of time the disk was idle during the sample interval. If this counter falls below 20 percent, the disk system is saturated. You may consider replacing the current disk system with a faster disk system.
  • 32. Disk Counters PhysicalDiskAvg. Disk Sec/Read :This measures the average time, in seconds, to read data from the disk. PhysicalDiskAvg. Disk Sec/Write:This measures the average time, in seconds, it takes to write data to the disk. PhysicalDiskAvg. Disk Queue Length : This indicates how many I/O operations are waiting for the hard drive to become available. If the value here is larger than the two times the number of spindles, that means the disk itself may be the bottleneck.
  • 33. Memory Counters MemoryCache Bytes :This indicates the amount of memory being used for the file system cache. There may be a disk bottleneck if this value is greater than 300MB. Memory% Committed Bytes in Use:This measures the ratio of Committed Bytes to the Commit Limit—in other words, the amount of virtual memory in use. This indicates insufficient memory if the number is greater than 80 percent. The obvious solution for this is to add more memory.
  • 34. MemoryAvailable Mbytes:This measures the amount of physical memory, in megabytes, available for running processes. If this value is less than 5 percent of the total physical RAM, that means there is insufficient memory, and that can increase paging activity. To resolve this problem, you should simply add more memory. MemoryPages per Second :This measures the rate at which pages are read from or written to disk to resolve hard page faults. If the value is greater than 1,000, as a result of excessive paging, there may be a memory leak.
  • 35. Processor Counters Processor% Processor Time:This measures the percentage of elapsed time the processor spends executing a non-idle thread. If the percentage is greater than 85 percent, the processor is overwhelmed and the server may require a faster processor. Processor% User Time :This measures the percentage of elapsed time the processor spends in user mode. If this value is high, the server is busy with the application. One possible solution here is to optimize the application that is using up the processor resources. SystemProcessor Queue Length This indicates the number of threads in the processor queue. The server doesn't have enough processor power if the value is more than two times the number of CPUs for an extended period of time.
  • 36. Network Counters Network InterfaceBytes Total/Sec : This measures the rate at which bytes are sent and received over each network adapter, including framing characters. The network is saturated if you discover that more than 70 percent of the interface is consumed. For a 100-Mbps NIC, the interface consumed is 8.7MB/sec (100Mbps = 100000kbps = 12.5MB/sec* 70 percent). In a situation like this, you may want to add a faster network card or segment the network. Network InterfaceOutput Queue Length: This measures the length of the output packet queue, in packets. There is network saturation if the value is more than 2. You can address this problem by adding a faster network card or segmenting the network.
  • 37. SQL Server Counters SQLServer: General Statistics – User Connections SQLServer: Memory Manager – Memory Grants Pending SQLServer: SQL Statistics – Batch Requests/sec SQLServer: SQL Statistics – Compilations/sec SQLServer: SQL Statistics – Recompilations/sec SQLServer:BufferManager - Buffer Cache hit ratio This is the percentage of requests serviced by data cache. When cache is properly used, this should be over 90%. The counter can be improved by adding more RAM. SQLServer:Databases,
  • 38. SQL Server Counters SQLServer:Exec Statistics, SQLServer:General Statistics, SQLServer:Latches, SQLServer:Locks– Average Wait Time This counter shows the average time needed to acquire a lock. This value needs to be as low as possible. SQLServer:MemoryManager– Target Server Memory (KB): indicates how much memory SQL Server “wants”. SQLServer:MemoryManager— Total Server Memory (KB): Indicates how much memory SQL Server is actually using. SQLServer:PlanCache SQLServer:Access Methods – Full scans/sec: higher numbers (> 1 or 2) may mean you are not using indexes and resorting to table scans instead.