Title: Debugging Windows DNAbased ECommerce Applications Aaron Barth Technical Lead Solution Integration En
1Debugging Windows DNA-based E-Commerce
Applications Aaron BarthTechnical
LeadSolution Integration EngineeringMicrosoft
Corporation
2Objectives
- Help troubleshoot problems with Microsoft
Windows Distributed interNet Applications (DNA)
e-commerce applications by - Understanding Web application architecture
- Identifying common support problems
- Mapping tools and techniques to solve common
problems
3Web Application Architecture
- Types of Web requests
- HTM or image (static content)
- Served from disk
- ISAPI (dynamic content)
- Filters (DLL)
- Extensions (DLL)
- ASP (dynamic content)
- Interpreted script
- COM applications
- Compiled code (DLL or EXE)
4Windows DNA 2000 Web Architecture
IIS Pool Threads
ASPProcessorThreadMax (25 x CPUs)
SMTP
FTPSVC
W3SVC
Web Application Manager
Inetinfo.exe
Port 80
5Web Application Architecture
- Thread pools
- IIS pool threads
- Configured in registry
- PoolThreadLimit
- MaxPoolThreads
- ASP/COM worker threads
- Configured in the metabase
- ASPProcessorThreadMax
- COM worker threads
- Not configurable
6Isolation Levels
- IIS process
- Low isolation
- Default in IIS 4.0
- Pooled
- Medium isolation
- New defaultin IIS 5.0
- Isolated
- High isolation
- Existed in IIS 4.0
7IIS Process (Low)
IIS Pool Threads
ISAPI
Web Application Manager
SMTP
FTPSVC
W3SVC
Inetinfo.exe
8Pooled (Medium)
Dllhost.exe
Web Application Manager
Inetinfo.exe
9Isolated (High)
Dllhost.exe
Web Application Manager
Inetinfo.exe
10Advantages and Disadvantages
11Common Support Problems
- Crash
- Access violation
- Other exceptions
- Stop responding (hang)
- IIS hang
- ASP hang or ASP queuing
- Resource-related failures
- High CPU utilization
- Memory leak
12Application Crashes (Dev)
- Developer view
- Access violations
- Compiled code reads from or writes to memory that
it does not have access to - Other exceptions
- Divide by zero
- RPC server unavailable
13Application Crashes (Ops)
- Operational view
- IIS process
- Process dies or becomes unstable
- Services may restart
- Event is logged in the event log
- Dr. Watson dialog box
- Isolated/pooled/COM application
- Application is terminated and restarted on next
request (JIT Activation) - Event is logged in the event log
- All state (session/application/component) is lost
14Crashes IIS Process
IIS Pool Threads
X
ISAPI
Web Application Manager
SMTP
FTPSVC
W3SVC
Inetinfo.exe
15Crashes Pooled And Isolated
Dllhost.exe (1)
X
ISAPI
Web Application Manager
Inetinfo.exe
16DEMO Crash
17Application Hangs (Dev)
- Developer view
- IIS hang
- Thread blocking
- Existing threads performing long running
operations - No more threads available
- ASP hang
- All ASP/COM threads are busy
- No more threads can be created
- ASP request queue is full
18Application Hangs (Ops)
- Operational view
- IIS hang
- HTM or static file requests hang
- Cannot connect to Web server
- ASP hang
- ASP?Requests executing counter is close to or
equal to ASProcesssorThreadMax x number of CPUs - ASP?Requests queued is gt0 for an extended period
of time - ASP pages do not return data, but static content
can be served
19DEMO Hang
Dual processor computer ASProcessorThreadMax
25 25 x 2 50 requests executing
20Resource Related Failures (Dev)
- Developer view
- High CPU utilization
- Code running a thread or threads runs into a
tight loop and does not yield CPU time - Low memory conditions
- Processes or DLLs allocate memory that is not
freed - Processes or DLLs starve the operating system of
resources by using all available memory - Processes or DLLs use handles without closing
them (leak)
21Resource Related Failures (Ops)
- Operational view
- High CPU utilization
- Processor?ProcessorTime is close to 100
- Process? ProcessorTime ? inetinfo.exe or
dllhost.exe is close to 100 - All server operations seem sluggish
- Low memory conditions
- Events logged to the event log
- Memory? Available bytes decreases
- Process? Private bytes ? inetinfo.exe or dllhost
increases - All server operations seem sluggish
22DEMO CPU Utilization
23Diagnostic/Debugging Tools
- Exception monitor
- User mode process dump
- Service
- Manual dump
- Windows Debugger (WinDBG)
24DEMO Exception Monitor
25Exception Monitor
- Advantages
- Lightweight, quick and easy to use
- Great for isolating down to the DLL that is
causing the problem - Disadvantages
- Sometimes not enough information
- If symbols are wrong can be misleading
- Where to get it?
- http//msdn.microsoft.com/workshop/server/iis/ixc
ptmon.asp - (Note that the URL should be entered as one
line it is wrapped here for readability.)
26DEMO User Mode Process Dump
27User Mode Process Dump
- Advantages
- Provides a process snapshot at the time the dump
is created - All information about a crash is in the dump file
(parameters, modules, threads) - Disadvantages
- Dump file can be large if process has a large
memory footprint - Need symbols to be correct when reading the dump
file - Dump snapshot does not show history (before crash
etc.) - Where do I get it?
- http//www.microsoft.com/downloads/release.asp?Re
leaseID17805 - (Note that the URL should be entered as one
line it is wrapped here for readability.)
28DEMO Windows Debugger
29Windows Debugger (WinDBG)
- Advantages
- Powerful lightweight debugger
- Can perform source level debugging
- Can read dump files (.dmp)
- Excellent symbol support
- Disadvantages
- Not well known
- GUI application that can be slower than
command-line debuggers - Windows 2000 Customer Diagnostics and Support
Tools CD
30Mapping The Tools To The Problems
- Isolate problem
- Run Exception Monitor
- View .dbl file with Log File Analyzer
- Run UserDump as a service
- Analyze .dmp file with Windows Debugger
Crash
31Mapping The Tools To The Problems
- Isolate problem
- Run emcmd /p
- Run Userdump.exe against each process ID from
step 2 Inetinfo.exe - Analyze .dmp files with Windows Debugger
Hang
32(No Transcript)