Thomas Deml Principal Program Manager Microsoft Corp WIA 302 Agenda The Problem with Web Hosting The IIS7 Hosting Platform The IIS7 Hosting Extensions Hosting Best Practices Resources The Problem with Web Hosting As a Web Hoster you provide a solution to run untested, buggy and fragile code in a cost effective manner Requirements: Prevent web applications from monopolizing the system Isolate web applications from each other Offer your hosting solutions at very low cost Troubleshoot issues caused by differences between the developers coding environment and the hosting environment Be able to grow beyond a single machine The IIS 7 Platform – Tuned for Hosting The IIS Process Model On-demand architecture tuned for hosting web applications A powerful new configuration system Bye, bye Metabase Compelling administration options Command-line, scripts, APIs First class troubleshooting Provides transparency what’s going on inside IIS IIS 7 On-Demand Architecture Service Host (SVCHost.EXE) Configuration (applicationhost. config) Worker Process (W3WP.EXE) Worker Process (W3WP.EXE) Worker Process (W3WP.EXE) Worker Process (W3WP.EXE) Windows Process Activation Service (WAS) World Wide Web Service (W3SVC) HTTP.SYS Kernel-Mode Listener Request Flow Service Host (SVCHost.EXE) Bindings: http://*:80:site1 Worker Process (W3WP.EXE) Windows Process Activation Service (WAS) Applicationhost.config World Wide Web Service (W3SVC) HTTP Protocol Host HTTP Listener Channel HTTP.SYS Kernel-Mode Listener Request Queue Response Cache Provisioning Web-Sites with the IIS Powershell Snap-in The IIS Process Model Offers… Hosting for 1000’s of web sites and applications Efficient Resource Management On demand activation Timeout of worker processes when no requests Health Monitoring of web applications Rapid Fail Protection Recycling of IIS Application Pools Based on certain parameters, e.g. lifetime, number of requests, schedule etc. Prevents resource exhaustion, e.g. by limiting number of worker processes that can be active at the same time. Isolation of Web Sites IIS 7.5 Application Pools run under different virtual accounts by default IIS7: A New Configuration Stack Metabase is gone The IIS Configuration System is Delegated Configuration an live with the content IIS settings can be stored in web.config files together with ASP.NET configuration XCopy deployment of application configuration Discoverable Well-schematized, readable XML Portable Can be xcopied or shared between multiple machines Flexible Configuration sections or even individual attributes can be locked Adding configuration easy – changes picked up immediately Microsoft Confidential Configuration Readable, extensible, delegateable, distributed, centralized Readable XML file Global configuration file: ApplicationHost.config Contains all sites, appPools, default settings… Location determined by redirection.config Allows configuration “locking” to distribute config Support XCopy deployment of web server configuration Distributed configuration file: Web.config Lives with content Can be local or remote UNC path Support XCopy deployment of application configuration Metabase available as optional component Can provide compatible APIs for existing scripts Only writes to applicationHost.config Only supports existing IIS6 properties IIS7 Shared Configuration Shared Config is great for… Simple redirection of configuration to UNC location Quickly moving sites, applications, or servers Keeping the configuration in sync Staging and rolling back server changes IIS7 Administration User Interface A New, Extensible User Interface Remotable via HTTP(S) Delegatable Command-line APPCMD command-line tool Single tool to change every IIS setting and more Replaces ADSUTIL.VBS PowerShell Snap-In and commandlets Scripted Administration WMI Provider PowerShell Snap-In and commandlets AhAdmin COM interfaces To learn more: http://blogs.iis.net/ksingla/archive/tags/Ahadmin/default.aspx Microsoft.Web.Administration .NET API To learn more: http://learn.iis.net/page.aspx/165/how-to-use-microsoftwebadministration/ Configuration Editor Programmatic Administration Made Easy First Class Troubleshooting What’s going on inside IIS? Request Tracing Generate a detailed request trace based on the rules you specify Run-time State and Control See what requests are in flight Detailed Errors More information for a local user Troubleshooting Web Server Issues The Hosting Extensions Web Deployment Tool Synchronization of content Application packaging Application Request Router 2.0 Fail-over and host-based routing to increase availability of your sites FTP Server 7 and 7.5 Secure FTP Access with FTP over SSL Host multiple FTP sites – no separate IP address needed Integrated site management Extensible Authentication and Logging Database Manager Lightweight, remoteable database management Web Deployment Tool Simplified Web Site and Web Farm Management Synchronize servers or sites on IIS 6.0 or IIS 7.0 Differential Sync Updates only changed properties and objects Site or Server Snapshots for later restore, versioning or offline deployment, automation of deployment tasks Provider-based IIS6 and 7 configuration Directory and file content SSL certificates .NET Assemblies, Registry keys and more IIS6-to-7 Migration MICROSOFT CONFIDENTIAL Deploying to a Live Web Server Application Request Router 2.0 Proxy based HTTP request routing module Makes routing decisions on application layer (layer 7) Provides high availability and scalability for servers Supports SSL-offloading Does not support SSL tunneling Works with other IIS7 modules to provide higher throughput Can be run on Server Core for a lightweight appliance server and… ARR is free! Scale out using ARR ARR Hostname Affinity ARR affinitizes the requests for a site to the same server for the lifespan of the site’s worker process Prerequisites: Shared Configuration Shared Content More Information: http://learn.iis.net/page.aspx/490/overview-of-sharedhosting-deployment-using-application-requestrouting/ Traditional Hosting 10.10.10.11 www.site11.com … www.site20.com 10.10.10.12 www.site21.com … www.site30.com Config Config Config Content Content Content 10.10.10.10: www.site1.com … www.site10.com Internet User Without Hostname Affinity No redundancy among sites Underutilization Administrator has to manually load balance the traffic by limiting the number of sites per server Server resources may not be utilized evenly across servers The administrator has to manage multiple configuration files Hosting with ARR Hostname Affinity Shared Content www.site1 to www.site30.com Shared Config 10.10.10.10: 10.10.10.11 10.10.10.12 Internet User Benefits of ARR Hostname Affinity Requests are dynamically load balanced Horizontal scale by adding new servers without predefined site allocations Resources are more evenly distributed High Availability Only one configuration to manage Hosting Best Practices Constraining Resource Consumption Site Isolation Improving Scalability Misc Constraining Resource Consumption CPU Application Pool Configuration WSRM http://learn.iis.net/page.aspx/449/using-wsrm-to-manage-iis-70apppool-cpu-utilization/ Memory Recycling Private or Virtual Memory Consumption DynamicIdleThreshold Bandwidth Media Pack Bandwidth Throttling Disk In W2K8: Disk Quotas now per directory! File System Resource Manager COM object FSRM.FsrmQuotaManager Site Isolation Use one Application Pool per site Virtual Application Pool Identities Default in IIS 7.5, available in Windows Server 2008 SP2 (IIS 7.0) ACL for “IIS AppPool\<AppPool identity>” Doesn’t work for Shared Content! No need for a per-site anonymous user Username can be set to “” and current Application Pool identity is used Improving Scalability DynamicIdleThreshold Will dynamically reduce idle timeout of Application Pools if memory gets tight Run 32-Bit Application Pools on 64-Bit Use less memory Enable32BitAppOnWin64 property Enable Dynamic Compression to reduce Bandwidth Consumption Additional Hosting Best Practices Server Core Administration by scripting on IIS 7.0 IIS 7.5 (Windows Server 2008 R2) supports full admin stack including Remote UI and Powershell Database Manager Lightweight way to allow customers to manage their databases Troubleshooting Custom Errors setting can be delegated http://learn.iis.net/page.aspx/405/delegatingerrormode-in-httperrors/ Summary IIS 7 provides a reliable, secure and cost effective platform to host 1000’s of web sites IIS Extensions like the Application Request Router and the Web Deployment Tool complement the IIS7 feature set and enable new hosting scenarios Resources www.microsoft.com/teched www.microsoft.com/learning Sessions On-Demand & Community Microsoft Certification & Training Resources http://microsoft.com/technet http://microsoft.com/msdn Resources for IT Professionals Resources for Developers Related Content SVR304 Extend Your Web Server: What's New in Internet Information Services (IIS) Wednesday 10:45 – David Lowe WIA203 Streaming with Internet Information Services (IIS) and Windows Media Services Tuesday 9:00 – Bernhard Frank WIA201 Microsoft Web Platform Overview Tuesday 10:45 – Bill Staples Track Resources IIS Community Portal: http://www.iis.net IIS Forums: http://forums.iis.net Learn about IIS: http://learn.iis.net IIS Extensions: http://www.iis.net/extensions Complete an evaluation on CommNet and enter to win an Xbox 360 Elite! © 2009 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.