100% found this document useful (1 vote)
104 views

Monitoring & Tuning Azure SQL Database: Presenting Sponsors

The document discusses monitoring and tuning Azure SQL Database. It provides information on monitoring resource utilization using the Azure portal and DMVs to monitor metrics like CPU, I/O, and memory usage. It discusses using Query Performance Insights to monitor queries and get deeper insights into resource consumption. It also covers using Intelligent Insights for proactive monitoring, detecting performance issues based on wait times, errors, and timeouts, and providing recommendations to improve performance.

Uploaded by

ATB
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
100% found this document useful (1 vote)
104 views

Monitoring & Tuning Azure SQL Database: Presenting Sponsors

The document discusses monitoring and tuning Azure SQL Database. It provides information on monitoring resource utilization using the Azure portal and DMVs to monitor metrics like CPU, I/O, and memory usage. It discusses using Query Performance Insights to monitor queries and get deeper insights into resource consumption. It also covers using Intelligent Insights for proactive monitoring, detecting performance issues based on wait times, errors, and timeouts, and providing recommendations to improve performance.

Uploaded by

ATB
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 38

Monitoring & Tuning Azure SQL

Database

Dustin Ryan, Data Platform Solution Architect, Microsoft


Moderated By: Paresh Motiwala

Presenting Sponsors
Thank You to Our Presenting Sponsors

Quest helps IT Professionals simplify administration


Empower users with new insights through familiar tools tasks so they can focus on the evolving needs of their
while balancing the need for IT to monitor and businesses. Combined with its commitment to help
manage user created content. Deliver access to all data companies protect today’s investment while planning
types across structured and unstructured sources. for the future, Quest continues to deliver the most
comprehensive solutions to monitor, manage, protect
and replicate database environments

IDERA designs powerful software with one SentryOne empowers Microsoft data professionals to
goal in mind – to solve customers’ most complex achieve breakthrough performance across physical,
challenges with easy-to-use solutions. IDERA’s award- virtual and cloud environments. We develop solutions
winning SQL Server database solutions and multi- to monitor, diagnose, and optimize SQL Server
platform database, application and cloud monitoring performance, including Plan Explorer, the query-tuning
tools ensure your business never slows down. tool with more than 100,000 downloads.

Supporting Sponsor
Attend PASS Summit to Grow Your Career
Connect with a global network of 250,000+ data professionals
PASS Summit is the largest conference for technical professionals who
leverage the Microsoft Data Platform.

November 6-9 | Seattle, WA

PASSsummit.com

The Community
Dustin Ryan

Designing analytics solutions for past 10 years


SQL data warehouse, ETL, semantic models, visualizations, on-
premises and in Azure

Blog at SQLDusty.com
Published author, technical editor, speaker
Facebook.com/SQLDusty
[email protected]

Twitter.com/SQLDusty
Avid collector of fun dolls
They’re so cool!
LinkedIn.com/in/SQLDusty
Monitoring & Tuning Azure SQL
Database

Dustin Ryan, Data Platform Solution Architect, Microsoft

Presenting Sponsors
Agenda
• Monitoring resource utilization
• Monitor using Query Performance Insights
• Automatically monitor w/ Intelligent Insights
• Manually tune
• Automatically tune
• Database Security Vulnerability Assessment
Monitor Resource Utilization
Monitor databases using the Azure portal
• You can create and edit monitoring charts in the portal
• Charts can be pinned to the database dashboard screen
• Available metrics
• Blocked by Firewall • Failed connections
• CPU % • In-Memory OLTP storage %
• DTU limit • Log IO %
• DTU % • Sessions %
• DTU used • Successful connections
• Data IO % • Total database size
• Database size % • Workers %
• Deadlocks

• You can also configure data driven alerts based on performance metrics
• These performance metrics can also help you determine if you can
downgrade to a lower performance level
Monitor databases using DMVs (cont.)
• sys.dm_db_resource_stats
• Good for monitoring granular data within a smaller time frame
• Available in every SQL database
• Shows recent resource use relative to the service tier
• Metrics are recorded every 15 seconds and maintained for 1 hour
• Metrics are expressed as a percentage of the max allowed DTU for the database service tier
• For more information on this DMV, view the documentation

Returns the average and maximum values for CPU percent, data and log I/O, and
memory consumption over the last hour:
Monitor databases using DMVs
• sys.resource_stats
• Good for monitoring less granular data across longer periods of time
• Metrics captured data every 5 minutes and maintains historical data for 14 days
• Metrics are expressed as a percentage of the max allowed DTU for the database
service tier

Returns all databases that are averaging at least 80% of compute utilization over the
last one week:
Monitoring Queries
Calculate size of database objects
SELECT sys.objects.name, SUM(reserved_page_count) * 8.0 / 1024
FROM sys.dm_db_partition_stats, sys.objects
WHERE sys.dm_db_partition_stats.object_id = sys.objects.object_id
GROUP BY sys.objects.name;
Monitor with
Query Performance Insights
Query
Performance
Insights
• Spend less time troubleshooting
performance
• Provides deeper insights into your
database resource consumption
• The ability to drill down into query
details, view text, history of resource
utilization
• Performance tuning annotations that
show actions performed by
SQL Azure Database Advisor

*Read more here


Query Performance
Insights Metrics Available

• Top CPU consuming


queries
• Top queries per duration
• Top queries per
execution count
• View individual query
details
Monitor with Intelligent Insights
What can Intelligent Insights do?
• Proactive monitoring
• Tailored performance insights
• Early detection of database performance degradation
• Root cause analysis of issues detected
• Performance improvement recommendations
• Scale out capability on hundreds of thousands of databases
• Positive impact to DevOps resources & TCO
How does Intelligent Insights work?
• Compares database performance by comparing the database workload
from last hour w/ past 7 day baseline
• Database workload is composed of queries to determined to be most
significant to performance
• Workload baselines are unique & specific to individual instance
• Monitors absolute operational thresholds and detects issues w/
excessive wait times, critical exceptions, and issues w/ query
parameterizations that might affect performance
What happens when an issue is detected?
• Diagnostics log is generated w/ an insight on what is
happening
• Intelligent Insights allows you to track issues from detection
to resolution
• Updates are provided in diagnostics log every 15 minutes
• Performance degradations are recorded w/ following
properties:
Property Details
Database information Metadata about a database on which an insight was detected, such as a resource URI.
Observed time range Start and end time for the period of the detected insight.
Impacted metrics •Metrics that caused an insight to be generated: Query duration increase [seconds].
•Excessive waiting [seconds].
•Timed-out requests [percentage].
•Errored-out requests [percentage].
Impact value Value of a metric measured.
Impacted queries and Query hash or error code. These can be used to easily correlate to affected queries. Metrics that
error codes consist of either query duration increase, waiting time, timeout counts, or error codes are provided.
Detections Detection identified at the database during the time of an event. There are 15 detection patterns.
For more information, see Troubleshoot database performance issues with Intelligent Insights.
Root cause analysis Root cause analysis of the issue identified in a human-readable format. Some insights might contain
a performance improvement recommendation where possible.

*Read more about how to use


Intelligent Insights
Detecting Performance Issues w/ Intelligent Insights
• Detects performance issues with SQL DB based on query execution wait times,
errors, time outs
• Detected performance patterns are output to diagnostics log
Detectable performance
patterns Details outputted
Reaching Resource Limits Consumption of available resources (DTUs), database worker threads, or database login sessions available on the monitored subscription has reached limits,
which causes SQL Database performance issues.
Workload Increase Workload increase or continuous accumulation of workload on the database was detected, which causes SQL Database performance issues.
Memory Pressure Workers that requested memory grants have to wait for memory allocations for statistically significant amounts of time. Or an increased accumulation of
workers that requested memory grants exists, which affects SQL Database performance.
Locking Excessive database locking was detected, which affects SQL Database performance.
Increased MAXDOP The maximum degree of parallelism option (MAXDOP) has changed, and it affects the query execution efficiency.
Pagelatch Contention Pagelatch contention was detected, which affects SQL Database performance. Multiple threads concurrently attempt to access the same in-memory data
buffer pages. This results in increased wait times, which affects SQL Database performance.
Missing Index A missing index issue was detected, which affects SQL Database performance.
New Query A new query was detected, which affects overall SQL Database performance.
Unusual Wait Statistic Unusual database wait times were detected, which affects SQL Database performance.
TempDB Contention Multiple threads try to access the same tempDB resources, which causes a bottleneck that affects SQL Database performance.
Elastic Pool DTU Shortage A shortage of available eDTUs in the elastic pool affects SQL Database performance.
Plan Regression A new plan or a change in the workload of an existing plan was detected, which affects SQL Database performance.
Database-Scoped Configuration A configuration change on the database affects SQL Database performance.
Value Change
Slow Client A slow application client that is unable to consume output from the SQL Database fast enough was detected, which affects SQL Database performance.
Pricing Tier Downgrade A pricing tier downgrade action decreased available resources, which affects SQL Database performance.
How do I use
Intelligent
Insights?
• Diagnostics log can be sent to
Azure Log Analytics, Azure
Event Hubs, Azure Storage, or
3rd party solution
• Configure streaming SQL DB
logs to OMS SQL Analytics
solution (video)
• View SQL analytics data for
fleets of databases
• Summarize by subscription,
server, elastic pool, database,
& query
• Create custom alerts
• Customize your monitoring
dashboard
Intelligent Insights troubleshooting flowchart

*Download troubleshooting flowchart in .pdf format


Manually Tuning your
Database
Tuning Performance in SQL Database
• Choose the right service tier for your application
• Tune your applications & apply best practices
• Tune the database

*Read more here


Choosing the right service tier

• Basic
• Good for databases with a single user, very little concurrent requests, or you’re just getting
started with SQL DB
• Standard
• Good for multiple concurrent requests like workgroup or web apps with low to medium IO
traffic requirements
• Premium
• Good if your app requires substantial resources for extended periods of time, many
concurrent requests, low latency
• Premium RS
• Good for IO intensive workloads that do not require the highest availability guarantees such
as high-performance test environments or analytical workloads

*Read more here


Tune Applications with these Characteristics
• Apps that have slow performance because of “chatty” behavior
• Read about batch queries
• Databases with an intensive workload that can’t be supported by an
entire single machine
• Read about cross database sharding and functional partitioning
• Apps that have suboptimal queries
• Read about addressing missing indexes and query tuning and hinting
• Apps that have suboptimal data access design
• Read about Application tier caching w/ Azure Caching service

*Read more here


Tune the Database
• Identify performance issues using the Azure portal
• Query Performance Insight
• Review top CPU consuming queries
• View individual query details
• Review top queries by duration
• Review top queries per execution count
• SQL Database Advisor
• Create index
• Drop index
• Parameterize queries
• Fix schema issues

*Read more here


Automatically Tune your
Database
What can
Automatic Tuning
do?
• Automated performance tuning of
Azure SQL DB
• Automated verification of
performance gains
• Automated rollback and self-
correction
• Tuning history log
• Tuning action T-SQL scripts for manual
deployments
• Proactive workload performance
monitoring
• Scale out capability on hundreds of
thousands of databases
• Positive impact to DevOps resources
and the total cost of ownership
Automatic Tuning Options
• Create Index
• Drop Index
• Force Last Good Plan

Watch this video on improving SQL DB performance w/ Automatic Tuning


Database Security
Vulnerability Assessment
SQL Vulnerability Assessment
• Scanning services that provides visibility into security states
• Flags security issues & highlights deviations from best practices
• Includes actionable steps to resolve security issues
• Meet compliance requirements that require scan reports
• Meet data privacy standards
• Monitor a dynamic database environment where changes are difficult to track

*Read more to learn how to start using SQL Vulnerability Assessment


Scan Report
• Overview of security state
• Number of issues
discovered & severities
• Warnings on deviations
from best practices
• Snapshot of security
related settings
• Map of sensitive data
• Suggestions of built-in
methods to protect data
Analyze &
Resolve Issues
• Review the results
• Understand the impact of the
results
• Resolve discovered issues
When to use what?
Use… If…
DMVs You need to monitor granular database metrics or high
level server metrics using SQL Server Management
Studio.
Query Performance Insights You need to easily view top CPU consuming queries,
top queries per duration, top queries per execution
count, and individual query details in the Azure portal
for a single database.
Intelligent Insights You need advanced and extensive server, database,
query level monitoring for a fleet of databases.

Manual Tuning You need to apply troubleshooting techniques not


applied by Automatic Tuning like changing service tiers
or tuning your application.
Automatic Tuning You want to let Azure create/drop indexes or force
queries to use the optimal plan to improve
performance.
THANK YOU
FOR ATTENDING

@sqlpass
#sqlpass

@PASScommunity

Presenting Sponsors

You might also like