Analysis Services. Show Me Where It Hurts. Bill Anton Head Beaver Prime Data Intelligence, LLC

Size: px
Start display at page:

Download "Analysis Services. Show Me Where It Hurts. Bill Anton Head Beaver Prime Data Intelligence, LLC"

Transcription

1 Analysis Services Show Me Where It Hurts Bill Anton Head Beaver Prime Data Intelligence, LLC

2 Life Is Good! 2 Photo Credit: SuperCar-RoadTrip.fr

3 Life is 3 Photo Credit: Charlie

4 Bill Anton BI Consultant & SSAS Downloads and additional references: 5

5 6 The problem with Application-Developers Photo Credit: the_jetboy

6 7 Objective Baselines and Performance Monitoring What, Why, How Demo Where to Start

7 8 Objective What will NOT be covered SSAS Architecture and Design MDX/DAX Tuning Pie Charts

8 Photo Credit: Umberto Salvagnin What

9 14 Definitions BASELINE: - a collection of measurements over a fixed period of time or workload - provides a point for future comparison - how many tomatoes can we grow in current conditions - are we low on sun, water, nutrients, etc? PERFORMANCE MONITORING: - a continuous collection and review of measurements - provides a historical look at the health & performance of a system - is our pot still big enough or do we need to adjust?

10 Baseline Example Baseline Benchmark 1 Benchmark 2 Benchmark 3 CPU Memory Query Count 15

11 Baseline Example Old Baseline New Baseline CPU Memory Query Count 16

12 8/1/2015 8/8/2015 8/15/2015 8/22/2015 8/29/2015 9/5/2015 9/12/2015 9/19/2015 9/26/ /3/ /10/2015 Performance Monitoring Example Avg CPU Avg Memory Processing Duration 17

13 18 PERFORMANCE MONITORING collection of baselines BASELINE BASELINE BASELINE BASELINE BASELINE BASELINE BASELINE BASELINE

14 19 PERFORMANCE MONITORING continuous collection of baselines over time BASELINE BASELINE BASELINE BASELINE t-n t-2 t-1 t

15 20 Baseline Performance Monitoring How long it takes to process the cube or model? Is the time it takes to process the cube increasing over time? Average query duration during business hours? Is the average query duration during business hours increasing over time? Max concurrent user connections during the week? Is the number of concurrent users during the week increasing over time?

16

17 22 When you can measure what you are speaking about, and express it in numbers, you know something about it -Lord Kelvin

18 23 Why? Time Hint: some people & think Money it s the answer to Life, the Universe and Everything

19 26 Benefits of Performance Monitoring Faster diagnosis and resolution of issues End user comes to you and says their report is slow Now what?

20 27 Benefits of Performance Monitoring Faster diagnosis and resolution of issues 1. Find report and extract the query 2. Run query in the TEST environment 3. Run query in the PROD environment 4. Yep, its slow Good! the alternative can be worse! 5. Start a trace 6. Run query (again) 7. Stop the trace

21 28 Benefits of Performance Monitoring Faster diagnosis and resolution of issues Yes Memory? No Yes CPU? No Yes Add Partition Yes Resource Constraint? Disk? No Add Aggregation No Review Query Execution

22 29 Benefits of Performance Monitoring Faster diagnosis and resolution of issues Formula Engine Bound? Yes No Rewrite Query? Query Execution Aggregation? Storage Engine Bound? Yes No Partition? Cache-Warming? Re-model?

23 30 Benefits of Performance Monitoring Anticipating events and planning for them in advance Window Processing Duration Projection /1/2015 9/1/ /1/ /1/ /1/2015 1/1/2016 9/29/ /25/2015

24 31 Benefits of Performance Monitoring Ability to proactively attack performance problems Reviewing the top N slowest queries each week Alerts when query takes longer than N-seconds

25 32 Do the Math! [Avg # of Issues / Month] x [Avg Hours / Issue] x [$ / Hour] = [Avg Cost / Month] BEFORE [10 Issues / Month] x [2 Hours / Issue] x [$100 / Hour] = [$2,000 / Month] AFTER [10 of Issues / Month] x [1 Hours / Issue] x [$100 / Hour] = [$1,000 / Month] [8 of Issues / Month] x [1 Hours / Issue] x [$100 / Hour] = [$800 / Month] [6 of Issues / Month] x [1 Hours / Issue] x [$100 / Hour] = [$600 / Month] [4 of Issues / Month] x [1 Hours / Issue] x [$100 / Hour] = [$400 / Month]

26 How Photo Credit: Lachlan Donald

27 34 The How TYPES OF WORKLOADS INSTRUMENTS OF MEASUREMENT INSTRUMENTS OF AUTOMATION IMPLEMENTATION OPTIONS

28 35 Types of Workloads PROCESSING is the processing duration increasing? for which objects? and by how much? is the average query response time increasing? which queries? how long? patterns? QUERY ACTIVITY

29 36 Instruments of Measurement EXTENDED EVENTS (the artist formerly known as prince profiler): event-handling system providing insight to the behavioral and performance characteristics of an Analysis Services instance PERFORMANCE MONITOR (perfmon): windows utility for collecting OS and Analysis Services performance counters on a regular interval DYNAMIC MANGEMENT VIEWS (DMVs): return server state information that can be used to monitor the health of an Analysis Services instance

30 37 Instruments of Measurement EXTENDED EVENTS (the artist formerly known as prince profiler) MULTIDIMENSIONAL ProgressReportEnd ProgressReportError TABULAR ProgressReportEnd ProgressReportError QueryEnd QuerySubcube QueryEnd VertiPaqSEQueryCacheMatch VertiPaqSEQueryEnd DaxQueryPlan

31 38 Instruments of Measurement PERFORMANCE MONITOR (perfmon) SSAS-Specific Categories Cache Connections Locks MDX Memory Processing System Categories Memory Network Interface Disk Processor Process System Threads

32 39 Instruments of Measurement DYNAMIC MANGEMENT VIEWS STATE-related DISCOVER_MEMORYUSAGE DISCOVER_OBJECT_MEMORY_USAGE DISCOVER_DB_CONNECTIONS DISCOVER_SESSIONS METADATA-related MDSCHEMA_CUBES MDSCHEMA_DIMENSIONS MDSCHEMA_MEASUREGROUPS MDSCHEMA_MEASURES 1. Syntax is *similar* to SQL

33 40 Instruments of Automation SQL AGENT:.NET: windows service that executes scheduled jobs (similar to Task Scheduler in windows) Write a custom service POWERSHELL: windows scripting language and framework for task automation and configuration management INTEGRATION SERVICES (SSIS): component of SQL Server typically reserved for data migration but can also be used for workflow applications.

34 41 Implementation Options OFF THE SHELF: - Performance Advisor for Analysis Services (SQL Sentry) - SQL BI Manager (IDERA) - Systems Center Operations Manager (SCOM) Management Pack for Analysis Services BREW YOUR OWN: Lots of samples on CodePlex to get you started Don t design for the long tail

35 DEMO Photo Credit: Picturepest

36 43 CodePlex Samples MONITORING SSAS: Includes scripts (T-SQL, CMD and XMLA) and Integration Services packages for collecting various kinds of information about an Analysis Services server. SSIS PACKAGE FOR COLLECTION SSAS DMV DATA: Provides scripts for use in an SSIS package that uses DMVs to extract information about an instance of Analysis Services and write the information to a data collection server. SSAS MONITORING SCRIPTS FOR MDW: Provides just the scripts from the solution Monitoring SSAS that start and stop collection of data about an Analysis Services server. RESMON: Includes XMLA scripts that create a cube used for storing SSAS monitoring information. You can use the cube for analysis or to build dashboards.

37 44 Number of Occurences Don t design for the long tail Distribution of Performance Issues CEO Type of Issue Photo Credit: Alden Chadwick

38 45 Evolution of Performance Monitoring manual collection of basic measurements automation, detailed measurements metrics, thresholds, proactive notification (semi) automated analysis, forecasting

39 Where to Start Photo Credit: DaveBleasdale

40 Where to start? CAPTURE & STORE Capture queries (text, user, date/time) Capture processing duration by object (dimension, measure group, etc) Capture state of the system (e.g. Power Settings, CPUs, Memory, Network Configs) QUERY & REVIEW Review TOP <N> slowest queries Review processing duration over time ADD FEATURES THAT MAKE SENSE Additional Perfmon Counters, Automated Alerts, etc Scripts to get started

41 Summary

42 Summary Do the Math! Build vs Buy Start small & add features Review Regularly Begin Next Week Track Progress!

43 THANK YOU Bill Anton BI Consultant / Village Goofball Downloads and Additional References