IIS7: A brief tour Diagnostics drilldown Best practices and patterns.

29
Microsoft Internet Information Services 7 (IIS7) Diagnostics for Developers Mai-Lan Tomsen Bukovec Group Program Manager, IIS Microsoft Corporation

Transcript of IIS7: A brief tour Diagnostics drilldown Best practices and patterns.

Page 1: IIS7: A brief tour Diagnostics drilldown Best practices and patterns.

Microsoft Internet Information Services 7 (IIS7) Diagnostics for Developers

Mai-Lan Tomsen BukovecGroup Program Manager, IISMicrosoft Corporation

Page 2: IIS7: A brief tour Diagnostics drilldown Best practices and patterns.

Agenda

IIS7: A brief tourDiagnostics drilldownBest practices and patterns

Page 3: IIS7: A brief tour Diagnostics drilldown Best practices and patterns.

5 Reasons To Love IIS7

1. Opt-in modular architecture with new extensibility model

2. Reliable, high performance PHP hosting alongside ASP.NET hosting

3. Easy-to-use XML-based configuration system

4. Powerful secure remote, delegated administration

5. Diagnostic tools for troubleshooting

Page 4: IIS7: A brief tour Diagnostics drilldown Best practices and patterns.

IIS7 Modularity

Security

AnonymousAuthentication

BasicAuthentication

DigestAuthentication

WindowsAuthentication

UrlAuthorization

CertificateMappingADCertificateMappi

ngRequestFiltering

IPRestriction

Application Development

.NET Extensibility

ISAPIFilter

ISAPIExtension

CGI

FastCGI

ServerSideIncludes

ASP

ASP.Net

Health and Diagnostics

HttpLogging

CustomLogging

RequestMonitor

HttpTracing

ODBCLogging

LoggingLibraries

PublishingFTPServer

FTP Management

WebDavModule

PerformanceStaticCompression

DynamicCompression

Management

Management Console

Management Scripting

Mgmt Service (WMSVC)

IIS6 Config (Metabase)

IIS6 WMI Provider

IIS6ScriptingIIS6 Management

Snap-in

Core HTTP Server ComponentsDirBrowsing

Process Model (Windows Process Activation Service) ProcessModel

Page 5: IIS7: A brief tour Diagnostics drilldown Best practices and patterns.

Authentication

...

ExecuteHandler

...

SendResponse

HTTP Request

HTTP Response

Authorization

UpdateCache

ResolveCache

IIS Extensibility

Authentication

...

DetermineHandler

...

SendResponse

HTTP Request

HTTP Response

BasicNTLM Anon

CGI

Static File

ISAPI

Log Compression

Componentized server

Pluggable modular functionalitySmall generic request pipeline

EnablesLightweight serversCustom / specialized servers

Integrated modeASP.NET membership, forms authentication, and Login controls

UrlAuthz

OutputCache

Forwarder

Basic40+

Page 6: IIS7: A brief tour Diagnostics drilldown Best practices and patterns.

PHP Support

Windows Server hosting for PHP or any other FastCGI-compliance framework along with ASP.NETBuilt-in FastCGI optimized for high performance and reliability for non-thread safe PHP proceses

Reuses CGI processes for multiple requests25x faster than standard CGI

Fully tested against latest PHP.NET builds (PHP 5.2.1)Plugs into IIS diagnostics before the requests enters and once the request leaves the PHP engineHost Multiple Versions of PHP Side by Side

Easily host PHP4 and PHP5 on the same server

Page 7: IIS7: A brief tour Diagnostics drilldown Best practices and patterns.

Configuration System

Powerful, XML-file based ManagementEasily copy configuration from server to serverUse environment variables to abstract physical paths

Enable Farms of Stateless Front-End Web Servers

Share IIS configuration on central UNC shareQuickly XCopy deploy appsDistributed Web.config files (IIS and ASP.NET config) live with contentCan be local or remote UNC path

Separate, scoped config file for each AppPool built-in

Process isolation for each new site by default

Page 8: IIS7: A brief tour Diagnostics drilldown Best practices and patterns.

Remote Admin and Delegation

New .NET API: Microsoft.Web.Administration

Remoteable through COM interfacePowerShell support

Delegate Management to Site OwnersManage with Remote Administration Tool

Supports Vista, Windows 2003, XP

Secure, firewall-friendly connection over HTTP/SSL

Authenticates both Windows and non-Windows credentials

Page 9: IIS7: A brief tour Diagnostics drilldown Best practices and patterns.

IIS7: A Brief Tour

demo

Modularity | Configuration | PHP Hosting | Xcopy Deployment for an ASP.NET application

Page 10: IIS7: A brief tour Diagnostics drilldown Best practices and patterns.

Diagnostics in IIS7

ETW Tracing

Failed Request Tracing

Detailed Errors

IIS7 ManagerAppCmd Command-

Line utility

Event Monitor

Performance Counters

ASP.NET Trace

integration

Process Orphaning

Tools

Platform

Browser

RSCA

Logs

Page 11: IIS7: A brief tour Diagnostics drilldown Best practices and patterns.

Diagnostic Tools By Dev Lifecycle

Development

•Detailed errors•Failed request tracing•ASP.NET integrated tracing

Functional testing

•Detailed errors•Failed request tracing•Performance monitors•Web Capacity Analysis Tool (WCAT) for stress testing•Orphan failed processes for debugging

Production Bug Fixing

•Runtime State and Controls API (RSCA)•Event Tracing for Windows (ETW) tracing•Failed request tracing•Performance counters•DebugDiag•Orphan failed processes for debugging

Page 12: IIS7: A brief tour Diagnostics drilldown Best practices and patterns.

Advice From IIS Customer Support

Don’t assume something is happening. Do get facts.

Performance counters, event counters, FREB logs, RSCA

Don’t go down the “switch this setting and see”. Do find the root cause, and then resolve the problem there.

FREB, detailed errors, RSCADo isolate the problem.

FREB, detailed errors, trace events

Page 13: IIS7: A brief tour Diagnostics drilldown Best practices and patterns.

Top 3 Diagnostic Tools in IIS

1. Detailed error messages2. Failed Request Tracing3. Tracing integration

Page 14: IIS7: A brief tour Diagnostics drilldown Best practices and patterns.

Detailed Errors

Uniquely identify most IIS 7.0 web server and module error conditions

Unique response status / sub-status codesLogged in site logs and shown in detailed error

Provide rich information to understand and resolve the error

Module, pipeline stage, win32 error code, etc.Lists possible causes, and things you can try

Provides error message securityBy default, detailed errors sent only to localhostCan configure to send to all clientsCan configure custom errors from file, URL, or redirect

ASP.NET custom errors override IIS custom errors

Page 15: IIS7: A brief tour Diagnostics drilldown Best practices and patterns.

Detailed Errors We See Often In DevelopmentError Cause Resolution

500.19 Wrong configuration section syntax (elements, attributes, attribute value type)

Config File shows the file and line of the error in configuration file.

404.3 You are requesting a script that doesn’t have the associated application framework installed. ORYou are requesting a static file which is not registered as a static file.

Install the corresponding framework to resolve this.ORAdd the extension to the MIME Types in IIS Manager

404.1 This error occurs whenever no suitable authentication method is configured (your site does not enable any authentication methods or the browser does not support the authentication methods you have configured).

For anonymous web sites, enable anonymous authentication.OREnable other authentication methods that your client supports.

Page 16: IIS7: A brief tour Diagnostics drilldown Best practices and patterns.

Detailed Errors

Mai-lan Tomsen BukovecGroup Program ManagerMicrosoft

demo

Page 17: IIS7: A brief tour Diagnostics drilldown Best practices and patterns.

Failed Request Tracing

Enable no-repro instrumentation for failed requestsAllow for custom failure definitions per URL

Time taken, status/substatus codes

Enable per-URL trace configurationAllow me to define what to trace per URL

Persist failure log files beyond process lifetimeCommon scenarios:

Request takes too long/hangs -> very common todayRequest error -> request completes, but with error status code

Authentication/Authorization problemsServer 500 errors

Page 18: IIS7: A brief tour Diagnostics drilldown Best practices and patterns.

Failed Request Tracing

Mai-lan Tomsen BukovecGroup Program ManagerMicrosoft

demo

Page 19: IIS7: A brief tour Diagnostics drilldown Best practices and patterns.

Application-Specific Diagnostics

ASP.NET page traces for integration into Failed Request Trace loggingSystem.Diagnostics.Trace

Capture tracing information from .NET componentsConfigure trace sources to control specific application tracing information

ASP.NET Health Monitoring eventsCorrelate and analyze application tracing information in the context of the overall request

Page 20: IIS7: A brief tour Diagnostics drilldown Best practices and patterns.

Application-Specific TracingMai-lan Tomsen BukovecGroup Program ManagerMicrosoft

demo

Page 21: IIS7: A brief tour Diagnostics drilldown Best practices and patterns.

Additional Diagnostic Tools

Process orphaning for failed applications through Advanced Settings on app pools (or orphanActionExe in config)Rapid Fail Protection (RFP) occurs when app pool fails X times in Y minutes (configurable)ETW tracing for Windows for extensive loggingRSCA lets you view requests that are in-flight DebugDiag for performance related issues including high and low CPU Hangs (slow response), process termination, memory leaks

Page 22: IIS7: A brief tour Diagnostics drilldown Best practices and patterns.

While developing….

Use request log files to find error patterns and offending URLSConsider using process orphaningUse ASP.NET health monitoring to receive configurable alerts about errorsUse WCAT to stress application before productUse design patterns in the Performance Tuning whitepaper (add link)

Page 23: IIS7: A brief tour Diagnostics drilldown Best practices and patterns.

While tuning….

Enable Output Caching for semi-dynamic pagesSet IIS worker processes in Wow64 mode in per-AppPool settingsIf you * script-mapped all requests to ASP.NET in IIS6, Integrated Pipeline is much faster than an IIS6 * scriptmap solution. Try together with IIS7 URL Authorization. Put your high traffic document on top of the Default Documents list. Static default documents are cached in kernel-mode

Page 24: IIS7: A brief tour Diagnostics drilldown Best practices and patterns.

While troubleshooting….

Use Failed Request Tracing to capture hard-to-repro errors Set fine-grained Failed Request Tracing rules to keep your log history validDon’t use IISReset, recycle apppoolsCheck key performance counters for clues on application health

Example: GC-related performance counters

Page 25: IIS7: A brief tour Diagnostics drilldown Best practices and patterns.

New IIS7 ExtensionsWeb-based release channel

Free for download, www.iis.netAgile release model

Q1 2008: Secure FTP server, WebDav, Remote Manager for IIS7, Media Pack (Bit Rate Throttling)

Built using the new IIS7 extensibility platform

After setup, fully integrated into IIS adminFully serviced and supported on Windows Server 2008

Page 26: IIS7: A brief tour Diagnostics drilldown Best practices and patterns.

IIS.NETHome for the IIS Technical Community!

In-depth technical articles and samples

Connect with other IIS experts on blogs & forums

Free advice and assistance in forums

Download center with IIS extensions

Page 27: IIS7: A brief tour Diagnostics drilldown Best practices and patterns.

SummaryNew IIS7 platform

Modular architectureFirst class PHP supportXML based configurationRemote mgmtDiagnostic toolset

Diagnostic tools suited to initial development or troubleshooting

Wide set of tools for troubleshooting and diagnostics.Narrow down root cause with Detailed Errors and Failed Request Tracing

Any questions or comments? Contact: [email protected]

Page 28: IIS7: A brief tour Diagnostics drilldown Best practices and patterns.

© 2008 Microsoft Corporation. All rights reserved. Microsoft, Windows, Windows Vista and other product names are or may be registered trademarks and/or trademarks in the U.S. and/or other countries.

The information herein is for informational purposes only and represents the current view of Microsoft Corporation as of the date of this presentation. Because Microsoft must respond to changing market conditions, it should not be interpreted to be a commitment on the part of Microsoft, and Microsoft cannot guarantee the accuracy of any information provided after

the date of this presentation. MICROSOFT MAKES NO WARRANTIES, EXPRESS, IMPLIED OR STATUTORY, AS TO THE INFORMATION IN THIS PRESENTATION.

Page 29: IIS7: A brief tour Diagnostics drilldown Best practices and patterns.