production debugging presentation

25
SoftSource Consulting Portland .NET User Group 06/02/2009

Upload: others

Post on 04-Feb-2022

2 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: Production Debugging Presentation

SoftSource Consulting

Portland .NET User Group06/02/2009

Page 2: Production Debugging Presentation

Production Debugging of ASP.NET and Silverlight

Prashant SinhaSoftware ArchitectSoftSource ConsultingPortland, OREmail : [email protected] : http://debuggingblog.com

Page 3: Production Debugging Presentation

Introduction

• Debugging Challenges in Production Environment

• Debugging Tools in Production Environment

• How to use them?

• Demos

Page 4: Production Debugging Presentation

DEMO

We will be using demo from http://debuggingblog.com/demos

Page 5: Production Debugging Presentation

Common Production Issues

• Crash

• Worker Process Recycle

• Hang

• Slow Response

• High CPU Usage

• High Memory Usage

• Exceptions – Unknown

• I have no clue, what’s going on

• I can’t even reproduce it on my machine

Page 6: Production Debugging Presentation

Tools for Production Debugging

• WinDbg

• DebugDiag

• Performance Monitor

• PAL – Performance Analysis of Logs

• WinDbg Extension – sos.dll and sos2.dll

• Sysinternals from http://technet.microsoft.com/en-us/sysinternals/default.aspx for example Process Explorer, Process Monitor

Page 7: Production Debugging Presentation

Demo - ADPlus

Page 8: Production Debugging Presentation

Demo - WinDbg

Page 9: Production Debugging Presentation

Worker Process Recycle

• logEventOnRecycle attribute

• Memory Based Recycling

• Memory Threshold

• Overlapped Recycling and their problems

• Rapid Fail Protection

• Process Orphaning

• Periodic Recycle

Page 10: Production Debugging Presentation

ASP.NET Worker Process - Crash

Unhandled Exception

System.OutOfMemoryException

System.StackOverflowException

System.ExecutionEngineException

Heap Corruption

Page 11: Production Debugging Presentation

Demo – Crash/Unhandled Exception

Page 12: Production Debugging Presentation

Performance/Hang

• Long Running Requests

• Thread Starvation

• Context Switching

• Deadlock/WaitHandle

• Low CPU hang – lock/external resources/database/web services

• High CPU Hang – Heavy load on Server/Infinite loop/Too Much GC/Native Thread spinning on Lock

Page 13: Production Debugging Presentation

Analyze Performance Issues in Production

• Identify the Server/Process

• Use Performance Counter logs

• Memory Dump of a Process

• Thread Stacks

• CPU Usage Stats

• Memory Statistics

• Managed Heap statistics

• ThreadPool Stats

Page 14: Production Debugging Presentation

Demo – Hang

Page 15: Production Debugging Presentation

High Memory Usage(OOM Exception)

• Managed Heap

– JIT Code Heap

– GC Heap

– LOB Heap

– Loader Heap

• Stack

• Unmanaged Heap

• Memory Fragmentation

Page 16: Production Debugging Presentation

Analyze High Memory Usage

• Performance Counters Logs– if there is one• Memory Dumps• Thread Statistics – Dead Threads, Blocking

Finalizer• Loader Heap Stats• GC Heap Stats• LOB Heap Stats• Cache/Session/ViewState in ASP.NET• GDI Handles• GCHandles

Page 17: Production Debugging Presentation

Demo – High Memory Usage

Page 19: Production Debugging Presentation

Silverlight Debugging in Action

Page 20: Production Debugging Presentation

Cool Features in CoreCLR SOS

• DML support

• AnalyzeOOM

• VerifyObj

• FindRoots

• GCWhere

• ListNearObj

• HeapStat

• GC History

Page 21: Production Debugging Presentation

Demo - Silverlight

Page 22: Production Debugging Presentation

Debugging Resources

Debugging Tidbitshttp://www.debuggingblog.comThe best ASP.NET Debugging Bloghttp://blogs.msdn.com/tessMy Favorite blog in Native Debugginghttp://www.dumpanalysis.orgDebugging ToolBox/Scripts/Cool Debugging Tipshttp://blogs.msdn.com/debuggingtoolboxAdvanced Windows Debugging Bloghttp://blogs.msdn.com/ntdebugging/

Page 23: Production Debugging Presentation

Microsoft Gold Certified Partner

• Consulting Services

• Software Development

• Education and Training

Please Visit us at http://www.sftsrc.com

Page 24: Production Debugging Presentation

Q&A

Q & A

Page 25: Production Debugging Presentation

SoftSource Consulting

Portland .NET User Group06/02/2009