Presentation is loading. Please wait.

Presentation is loading. Please wait.

Module 8: Monitoring SQL Server for Performance. Overview Why to Monitor SQL Server Performance Monitoring and Tuning Tools for Monitoring SQL Server.

Similar presentations


Presentation on theme: "Module 8: Monitoring SQL Server for Performance. Overview Why to Monitor SQL Server Performance Monitoring and Tuning Tools for Monitoring SQL Server."— Presentation transcript:

1 Module 8: Monitoring SQL Server for Performance

2 Overview Why to Monitor SQL Server Performance Monitoring and Tuning Tools for Monitoring SQL Server Common Monitoring and Tuning Tasks

3 Why to Monitor SQL Server Optimize the Business Application of SQL Server Minimize the User or Query Response Time Maximize the Throughput

4  Performance Monitoring and Tuning Strategies for Performance Tuning Selecting an Approach to Performance Tuning Developing a Performance Tuning Methodology Establishing a Performance Baseline Detecting Performance Bottlenecks Common Monitoring Tasks

5 Strategies for Performance Tuning Optimizing the Response Time Requires knowledge of the application, the environment, and the users Optimizing the Throughput Requires knowledge of how SQL Server handles data access, concurrency, and interaction with Windows 2000

6 Selecting an Approach to Performance Tuning Approach Optimization for Application Response Time and Server Throughput by: Tuning the client application Tuning the database Tuning SQL Server Tuning the hardware configuration

7 Developing a Performance Tuning Methodology Design for Performance Know the user requirements Know the data Design appropriately Plan for Performance Define the parameters Set performance goals Measure and document actions and results

8 Establishing a Performance Baseline SQL Server SQL Server Workload Throughput System Resources System Resources Optimization Contention

9 Detecting Performance Bottlenecks Decide What to Examine Memory, CPU use, disk I/O, user connection, and locks Know the Acceptable Range Extremes above or below the baseline may indicate bottlenecks

10 Common Monitoring Tasks SQL Query Analyzer Windows 2000 Event Viewer Windows System Monitor Current Activity window in SQL Server Enterprise Manager Transact-SQL SQL Profiler System-Level Monitoring Hardware Operating system Application SQL Server-Specific Monitoring SQL Server activity Data consistency Specific Query Performance

11  Tools for Monitoring SQL Server Windows 2000 Event Viewer Windows System Monitor with SQL Server Current Activity Window in SQL Server Enterprise Manager Transact-SQL Tools SQL Profiler SQL Query Analyzer

12 Windows 2000 Event Viewer Windows 2000 Event Viewer Displays Error, Warning, and Informational Messages Windows 2000 Event Viewer Allows You to View Windows Event Logs Windows application log Windows system log Windows security log

13 Windows System Monitor with SQL Server Windows System Monitor Can Track: SQL Server I/O SQL Server memory usage SQL Server user connections SQL Server locking Replication activity

14 Current Activity Window in SQL Server Enterprise Manager SQL Server Process Information View by process ID View by object Locks, Blocking, and Deadlocks Managing Locks and Processes System administrators can take actions to inform users or terminate processes

15 Transact-SQL Tools System Stored Procedures Global Variables Transact-SQL Statements DBCC Statements Trace Flags

16 SQL Profiler Trace and Capture Server Activity Choose events to monitor Choose trace criteria Choose what data to capture Group data meaningfully

17 Demonstration: Using SQL Profiler

18 SQL Query Analyzer Show Query Execution Plan Show Server Trace Show Server-Side Statistics Show Client-Side Statistics Index Tuning Wizard

19  Common Monitoring and Tuning Tasks Monitoring Memory Use Monitoring Threads and Processor Use Monitoring Hard Disk I/O Monitoring Locks Monitoring for Poorly Performing Queries

20 Monitoring Memory Use Memory and Paging File Use Object: Counter Guideline Memory: Available Bytes This counter should be greater than 5,000 KB Memory: Pages/sec This counter should never be consistently greater than zero Process: Page Faults/sec A high number indicates excessive paging Memory and Buffer Use Object: Counter Guideline Process: Working Set This counter should be greater than 5,000 KB SQL Server: Buffer Manager: Buffer Cache Hit Ratio This counter should be greater than 90 percent SQL Server: Buffer Manager: Total Pages A low number may indicate frequent disk I/O, more memory may be required SQL Server: Memory Manager: Total Server Memory If this counter is consistently close to the amount of physical memory, more memory may be required

21 Monitoring Threads and Processor Use Object: Counter GuidelineGuideline Processor: %Processor Time This counter should usually be less than 90 percent System: Context Switches/Sec On a multiprocessor computer, if this counter reaches 8000, and the Processor: % Processor Time counter is over 90 percent, consider enabling SQL Server fiber mode scheduling System: Processor Queue Length This counter should never be consistently greater than 2 Processor: %Privileged Time This counter should be as low as possible Processor: %User Time This counter gives the percentage of time executing user processes such as SQL Server

22 Monitoring Hard Disk I/O Object: Counter GuidelineGuideline PhysicalDisk: %Disk Time This counter should be consistently less than 90 percent PhysicalDisk: Avg.Disk Queue Length This counter should be no more than 2 times the number of spindles PhysicalDisk: Disk Reads/sec This counter should be consistently less than the capacity of your hard disk subsystem PhysicalDisk: Disk Writes/sec This counter should be consistently less than the capacity of your hard disk subsystem

23 Monitoring Locks Deadlocks Automatically detected and killed Blocking Locks Administrator intervention required Managing Locks Windows System Monitor, SQL Profiler, SQL Server Enterprise Manager, and stored procedures

24 Monitoring for Poorly Performing Queries Identifying Query Performance SQL Profiler, traces, and stored procedures Causes of Poor Query Performance Network, memory, statistics, indexes, and query structure

25 Recommended Practices Establish a Performance Baseline Monitor Actual Performance Identify Performance Bottlenecks Use the Appropriate Tools

26 Lab A: Monitoring SQL Server

27 Review Why to Monitor SQL Server Performance Monitoring and Tuning Tools for Monitoring SQL Server Common Monitoring and Tuning Tasks


Download ppt "Module 8: Monitoring SQL Server for Performance. Overview Why to Monitor SQL Server Performance Monitoring and Tuning Tools for Monitoring SQL Server."

Similar presentations


Ads by Google