dot net application monitoring

30
ADVANCED TROUBLESHOOTING TOOLS FOR .NET APPLICATIONS Ravi Okade

Upload: ravi-okade

Post on 20-May-2015

754 views

Category:

Documents


10 download

DESCRIPTION

From the phillydotnet 2012.2 talk

TRANSCRIPT

Page 1: Dot Net Application Monitoring

ADVANCED TROUBLESHOOTING TOOLS

FOR .NET APPLICATIONSRavi Okade

Page 2: Dot Net Application Monitoring

Agenda

Production Troubleshooting Issues WinDbg – a brief introduction Main Agenda:

○ Part 1 - IntelliTrace○ Part 2 - System Center APM

Page 3: Dot Net Application Monitoring

Me (raviokade at hotmail)

I have been programming since

I like to program in

My favorite programming topic is

Java

C#

Data, more data, big data

Page 4: Dot Net Application Monitoring
Page 5: Dot Net Application Monitoring

Production Issue Types

Environmental issuesConnectivity, Hardware issuesHigh CPU, Memory issuesTypically managed through alerts

Application issuesRelated to incorrect application logicCan lead to incorrect application behavior,

“hang” or termination

Page 6: Dot Net Application Monitoring

Troubleshooting Application Issues Eventlogs, Perfmon can be of some help But Application logs are most appropriate. Requires proper logging to be in place. Sometimes you have to change to a more

verbose level.Generates tons of dataSlows down the applicationUseless if lots of multi-threading is going on

Parameter values are not appropriate for logging

Page 7: Dot Net Application Monitoring

What do you do when logs don’t work ? Try to reproduce! Near impossible.

QA = Production: rarely!Takes time!

Add more logging and redeployNot practical in large organizations

Page 8: Dot Net Application Monitoring

Agenda

Production Troubleshooting Issues WinDbg – a brief introduction Main Agenda:

○ Part 1 - IntelliTrace○ Part 2 - System Center APM

Page 9: Dot Net Application Monitoring

WinDbg

Available as a silent collector or as an interactive debugger

Generates dump files Dump files contain information about the

final state of the application Used for critical scenarios where

application tends to terminate or hang

Page 10: Dot Net Application Monitoring

WinDbg issues

Nice tool .. If you know how to use it! Need time to diagnose. Not for those

bleeding issues! Not appropriate for all types of issues.

Page 11: Dot Net Application Monitoring

Agenda

Production Troubleshooting Issues WinDbg – a brief introduction Main Agenda:

○ Part 1 - IntelliTrace○ Part 2 - System Center APM

Page 12: Dot Net Application Monitoring

Intellitrace

Code is instrumented dynamically Records program execution flow Historical debugging Records program data

Method ParametersReturn values

1st class debugging experience in Visual Studio

Page 13: Dot Net Application Monitoring

Intellitrace

Low overhead for collection (depends on collection plan)

IntelliTrace supports debugging VB and C# applications that use.NET version 2.0, 3.0, 3.5, or 4

Available only with Visual Studio Ultimate edition

Page 14: Dot Net Application Monitoring

Intellitrace Production Setup Application

IntelliTrace FileCollectionPlan.xmlIntelliTrace Recorder

Page 15: Dot Net Application Monitoring

IntelliTrace Collector Basics Collector can be deployed with xcopy You can collect data without installing

Visual Studio. The collector lets you capture details

about exceptions, threads, Web requests, modules, and other system information.

The collector saves this information as a recording (.iTrace file) that you can open in Visual Studio Ultimate.

Page 16: Dot Net Application Monitoring

IntelliTrace Collection steps Download and expand the IntelliTrace

collector cab file Collecting the Trace:

Web Application (need PowerShell):Start-IntelliTraceCollection <ApplicationPool> <CollectionPlan> <FullOutputPath>

Stop-IntelliTraceCollection <AppPoolName>

Exe Application:IntellitraceSC.exe launch /cp: <CollectionPlan> /f: <OutputFile> <ExecutableFile>

Page 17: Dot Net Application Monitoring

Open IntelliTrace recording in Visual Studio Ultimate

Copy the recording (.iTrace file) to a computer that has Visual Studio Ultimate.

Start Visual Studio Ultimate. Use the File menu to find and open the recording.

Page 18: Dot Net Application Monitoring

IntelliTrace DEMO

Tracing an EXE Application Tracing a Web Application Customizing Trace

Collection Plan

Image: http://www.crowcanyon.com/Pick-a-demo.html

Page 19: Dot Net Application Monitoring

Agenda

Production Troubleshooting Issues WinDbg – a brief introduction Main Agenda:

○ Part 1 - IntelliTrace○ Part 2 - System Center APM

Page 20: Dot Net Application Monitoring

System Center APM

Code is instrumented dynamically Records program execution flow Records program data (Parameters and

Return values) Low overhead for collection (depends on

configuration)

Page 21: Dot Net Application Monitoring

System Center APM

Code is instrumented dynamically Records program execution flow Records program data (Parameters and

Return values) Low overhead for collection (depends on

configuration)

Page 22: Dot Net Application Monitoring

How is it different from Intellitrace? Always-on monitoring Performance monitoring Remote administration/configuration Correlation with performance counters Multi-server call chains

Page 23: Dot Net Application Monitoring

System Center .Net Monitoring setup

System Center

DB

System Center Application

Server

System Center Agent

Monitored Web Application System

Center Operations

Monitor

Page 24: Dot Net Application Monitoring

System Center APM Demo Monitoring a Web Application View Alerts View Stack Trace and Parameter

Values Customizing What is collected

Page 25: Dot Net Application Monitoring

ADO.NET Parameters and Execution time

Page 26: Dot Net Application Monitoring

Security Alerts

Page 27: Dot Net Application Monitoring

Profiling options

Page 28: Dot Net Application Monitoring

System Center APM – Advanced features

Client side monitoring System Center Advisor Collected data automated clean-up

Page 29: Dot Net Application Monitoring

When to use whatScenario WinDbg System Center

APMIntelliTrace

Memory leak Yes Limited No

Exceptions Limited Yes Yes

Performance No Yes No

Deadlocks, Hang Yes No Limited

Running threads and stack Yes No Yes

Performance impact on target application when debugging

Low/Medium Low/Medium (configurable)

Medium/High (configurable)

Correlation across tiers spread across servers

No Yes No

Application types All Web All

Target audience Developers (High skill)

Ops (Primary), Developers

Developers

Always On ? No Yes No

Cost Free $$ Low

Page 30: Dot Net Application Monitoring

References

System Center Application Monitoring Tutorialhttps://cmg.vlabcenter.com/default.aspx?moduleid=7a804b17-0025-4309-957d-a21c2e121e2b

Intellitrace Tutorialhttp://msdn.microsoft.com/en-us/vs2010trainingcourse_debuggingwithintellitrace.aspx