https://docs.microsoft.com/en-us/iis/get-started/introduction-to-iis/introduction-to-iis-architecture

Introduction

Internet Information Services (IIS) 7 and later provide a request-processing architecture which includes:

  • The Windows Process Activation Service (WAS), which enables sites to use protocols other than HTTP and HTTPS.
  • A Web server engine that can be customized by adding or removing modules.
  • Integrated request-processing pipelines from IIS and ASP.NET.

Components in IIS

IIS contains several components that perform important functions for the application and Web server roles in Windows Server® 2008 (IIS 7.0) and Windows Server 2008 R2 (IIS 7.5).

Each component has responsibilities, such as listening for requests made to the server, managing processes, and reading configuration files.

These components include protocol listeners, such as HTTP.sys, and services, such as World Wide Web Publishing Service (WWW service) and Windows Process Activation Service (WAS).

Protocol Listeners

Protocol listeners receive protocol-specific requests, send them to IIS for processing, and then return responses to requestors.

For example, when a client browser requests a Web page from the Internet, the HTTP listener, HTTP.sys, picks up the request and sends it to IIS for processing.

Once IIS processes the request, HTTP.sys returns a response to the client browser.

By default, IIS provides HTTP.sys as the protocol listener that listens for HTTP and HTTPS requests.

HTTP.sys was introduced in IIS 6.0 as an HTTP-specific protocol listener for HTTP requests.

HTTP.sys remains the HTTP listener in IIS 7 and later, but includes support for Secure Sockets Layer (SSL).

To support services and applications that use protocols other than HTTP and HTTPS, you can use technologies such as Windows Communication Foundation (WCF).

WCF has listener adapters that provide the functionality of both a protocol listener and a listener adapter.

Listener adapters are covered later in this document.

For more information about WCF, see Windows Communication Foundation on MSDN.

Hypertext Transfer Protocol Stack(HTTP.sys)

The HTTP listener is part of the networking subsystem of Windows operating systems, and it is implemented as a kernel-mode device driver called the HTTP protocol stack (HTTP.sys).

HTTP.sys listens for HTTP requests from the network, passes the requests onto IIS for processing, and then returns processed responses to client browsers.

In IIS 6.0, HTTP.sys replaced Windows Sockets API (Winsock), which was a user-mode component used by previous versions of IIS to receive HTTP requests and send HTTP responses.

IIS 7 and later continue to rely on HTTP.sys for HTTP requests.

HTTP.sys provides the following benefits:

  • Kernel-mode caching. Requests for cached responses are served without switching to user mode.
  • Kernel-mode request queuing. Requests cause less overhead in context switching because the kernel forwards发送 requests directly to the correct worker process.If no worker process is available to accept a request, the kernel-mode request queue holds the request until a worker process picks it up.
  • Request pre-processing and security filtering.

World Wide Web Publishing Service(WWW service)

In IIS 7 and later, functionality that was previously handled by the World Wide Web Publishing Service (WWW Service) alone

is now split between two services: WWW Service and a new service, Windows Process Activation Service (WAS).

These two services run as LocalSystem in the same Svchost.exe process, and share the same binaries.

Note:You may also see the WWW Service referred to as W3SVC in documentation.

How WWW Service works in IIS 6.0

In IIS 6.0, WWW Service manages the following main areas in IIS:

  • HTTP administration and configuration
  • Process management
  • Performance monitoring

HTTP Administration and configuration

The WWW Service reads configuration information from the IIS metabase and uses that information to configure and update the HTTP listener, HTTP.sys.

In addition, WWW service starts, stops, monitors, and manages worker processes that process HTTP requests.

Performance Monitoring

The WWW Service monitors performance and provides performance counters for Web sites and for the IIS cache.

Process Management

The WWW Service manages application pools and worker processes, such as starting, stopping, and recycling worker processes.

Additionally, the WWW Service monitors the health of the worker processes, and invokes rapid fail detection to stop new processes from starting when several worker processes fail in a configurable amount of time.

How the WWW Service works in IIS

In IIS, the WWW service no longer manages worker processes.

Instead, the WWW Service is the listener adapter for the HTTP listener, HTTP.sys.

As the listener adapter, the WWW Service is primarily responsible for configuring HTTP.sys, updating HTTP.sys when configuration changes, and notifying WAS when a request enters the request queue.

Additionally, the WWW Service continues to collect the counters for Web sites.

Because performance counters remain part of the WWW Service, they are HTTP specific and do not apply to WAS.

Windows Process Activation Service(WAS)

In IIS 7 and later, Windows Process Activation Service (WAS) manages application pool configuration and worker processes instead of the WWW Service.

This enables you to use the same configuration and process model for HTTP and non-HTTP sites.

Additionally, you can run WAS without the WWW Service if you do not need HTTP functionality.

For example, you can manage a Web service through a WCF listener adapter, such as NetTcpActivator, without running the WWW Service if you do not need to listen for HTTP requests in HTTP.sys.

For information about WCF listener adapters and about how to host WCF applications in IIS 7 and later by using WAS, see Hosting in WCF on MSDN.

Configuration Management in WAS

On startup, WAS reads certain information from the ApplicationHost.config file, and passes that information to listener adapters on the server.

Listener adapters are components that establish communication between WAS and protocol listeners, such as HTTP.sys.

Once listener adapters receive configuration information, they configure their related protocol listeners and prepare the listeners to listen for requests.

In the case of WCF, a listener adapter includes the functionality of a protocol listener.

So, a WCF listener adapter, such as NetTcpActivator, is configured based on information from WAS.

Once NetTcpActivator is configured, it listens for requests that use the net.tcp protocol.

For more information about WCF listener adapters, see WAS Activation Architecture on MSDN.

The following list describes the type of information that WAS reads from configuration:

    • Global configuration information
    • Protocol configuration information for both HTTP and non-HTTP protocols
    • Application pool configuration, such as the process account information
    • Site configuration, such as bindings and applications
    • Application configuration, such as the enabled protocols and the application pools to which the applications belong

If ApplicationHost.config changes, WAS receives a notification and updates the listener adapters with the new information.

Process Management

WAS manages application pools and worker processes for both HTTP and non-HTTP requests.

When a protocol listener picks up a client request, WAS determines if a worker process is running or not.

If an application pool already has a worker process that is servicing requests, the listener adapter passes the request onto the worker process for processing.

If there is no worker process in the application pool, WAS will start a worker process so that the listener adapter can pass the request to it for processing.

Note:Because WAS manages processes for both HTTP and non-HTTP protocols, you can run applications with different protocols in the same application pool.

For example, you can develop an application, such as an XML service, and host it over both HTTP and net.tcp.

Module in IIS

IIS provides a new architecture that is different from previous versions of IIS.

Instead of keeping the majority of functionality within the server itself, IIS include a Web server engine in which you can add or remove components, called modules, depending on your needs.

Modules are individual features that the server uses to process requests.

For example, IIS uses authentication modules to authenticate client credentials, and cache modules to manage cache activity.

The new architecture provides the following advantages over previous versions of IIS:

  • You can control which modules you want on the server.
  • You can customize a server to a specific role in your environment.
  • You can use custom modules to replace existing modules or to introduce new features.

The new architecture also improves security and simplifies administration.

By removing unnecessary modules, you reduce the server's attack surface and memory footprint, which is the amount of memory that server worker processes use on the machine.

You also eliminate the need to manage features that are unnecessary for your sites and applications.

Native Modules

The following sections describe the native modules that are available with a full installation of IIS 7 and later.

You can remove them or replace them with custom modules, depending on your needs.

HTTP Modules

Several modules in IIS 7 and later perform tasks specific to Hypertext Transfer Protocol (HTTP) in the request-processing pipeline.

HTTP modules include modules to respond to information and inquiries sent in client headers, to return HTTP errors, to redirect requests, and more.

CustomErrorModule    Sends default and configured HTTP error messages when an error status code is set on a response.    Inetsrv\Custerr.dll

HttpRedirectionModule    Supports configurable redirection for HTTP requests.    Inetsrv\Redirect.dll

Security Modules

Several modules in IIS perform tasks related to security in the request-processing pipeline.

In addition, there are separate modules for each of the authentication schemes, which enable you to select modules for the types of authentication you want on your server.

There are also modules that perform URL authorization, and a module that filters requests.

Content Modules

Several modules in IIS perform tasks related to content in the request-processing pipeline.

Content modules include modules to process requests for static files, to return a default page when a client doesn't specify a resource in a request, to list the contents of a directory, and more.

Compression Modules

Two modules in IIS perform compression in the request-processing pipeline.

DynamicCompressionModule    Compresses responses and applies Gzip compression transfer coding to responses.    Inetsrv\Compdyn.dll

Caching Modules

Several modules in IIS perform tasks related to caching in the request-processing pipeline.

Caching improves the performance of your Web sites and Web applications by storing processed information,

such as Web pages, in memory on the server, and then reusing that information in subsequent requests for the same resource.

Logging and Diagnostics Modules

Several modules in IIS perform tasks related to logging and diagnostics in the request-processing pipeline.

The logging modules support loading of custom modules and passing information to HTTP.sys.

The diagnostics modules follow and report events during request processing.

Managed Support Modules

A couple of modules in IIS support managed integration in the IIS request-processing pipeline.

Managed Modules

Request Processing in IIS

Application Pools in IIS

Integrated application pool mode

Classic application pool mode

HTTP Request Processing in IIS

Introduction to IIS Architectures的更多相关文章

  1. ASP.NET MVC5写.php路由匹配时的问题 ASP.NET MVC 4 在 .NET 4.0 与.NET 4.5 的專案範本差異

    由于外包公司结束合作,所以考虑把其APP服务替换过来,因原后台是用php写的,在不影响员客户端使用的情况下在MVC下重写路由配置实现处理原php链接地址的请求,但实现时发现怎么也匹配不到自己写的路由, ...

  2. .NET中的各种池

    在.NET中,常用到的池有四个:字符串拘留池.线程池 .应用程序池.数据库连接池. 字符串拘留池 在.NET中字符串是不可变对象,修改字符串变量的值会产生新的对象.为降低性能消耗及减小程序集大小,.N ...

  3. NET中的池

    NET中的各种池 在.NET中,常用到的池有四个:字符串拘留池.线程池 .应用程序池.数据库连接池. 字符串拘留池 在.NET中字符串是不可变对象,修改字符串变量的值会产生新的对象.为降低性能消耗及减 ...

  4. IIS 内部运行机制

    ASP.NET是一个非常强大的构建Web应用的平台,它提供了极大的灵活性和能力以致于可以用它来构建所有类型的Web应用. 绝大多数的人只熟悉高层的框架如: WebForms 和 WebServices ...

  5. 【转】各版本IIS下ASP.net请求处理过程区别

    原文地址:http://www.cnblogs.com/fsjohnhuang/articles/2332074.html ASP.NET是一个非常强大的构建Web应用的平台,它提供了极大的灵活性和能 ...

  6. IIS 内部运行机制及Asp.Net执行过程详解

    一直以来对一个Asp.net页面穿过IIS后就返回给浏览器一个HTML页面感觉很是神奇.虽然做技术这么长时间了,也曾经大致了解过一点来龙去脉,但是如果你真的问起我比较详细的过程,我还真的回答不上来,好 ...

  7. Install Typical IIS Workloads

    原文 Install Typical IIS Workloads Introduction The IIS 7.0 and above modular architecture is designed ...

  8. IIS架构介绍

    IIS7及以上版本提供的请求-处理架构包括以下内容: Windows Process Activation Service(WAS)可以让站点支持更多协议,不仅仅是HTTP和HTTPS 可以通过增加或 ...

  9. IIS Modules Overview

    Introduction The IIS 7 and above Web server feature set is componentized into more than thirty indep ...

随机推荐

  1. apicloud 上传/更新App版本到 ios store 流程步骤

    app更新 上传APP的地址: https://itunesconnect.apple.com/login 苹果开发者中心: https://developer.apple.com/ app正式包更新 ...

  2. 洛谷 P1855 榨取kkksc03 (二维费用背包)

    加多一维就行了 #include<cstdio> #include<algorithm> #include<cstring> #define REP(i, a, b ...

  3. 2015 Multi-University Training Contest 2 Friends

    Friends Time Limit: 2000/1000 MS (Java/Others)    Memory Limit: 65536/65536 K (Java/Others)Total Sub ...

  4. max带来的冲突

    题目要求: /* * Copyright (c) 2014, 烟台大学计算机学院 * All rights reserved. * 文件名:sum123.cpp * 作 者:林海云 * 完毕日期:20 ...

  5. hdu 4771 求一点遍历全部给定点的最短路(bfs+dfs)

    题目如题.题解如题. 因为目标点最多仅仅有4个,先bfs出俩俩最短路(包含起点).再dfs最短路.)0s1A;(当年弱跪杭州之题,现看如此简单) #include<iostream> #i ...

  6. MySQL 以及 Python 实现排名窗体函数

    大部分数据库都提供了窗体函数.比方RANK,ROW_NUMBER等等. MySQL 这方面没有直接提供.可是能够变相的实现.我曾经写了row_number 的实现,今天有时间把 rank 的实现贴出来 ...

  7. es6 --- class 类的继承使用

    传统的javascript中只有对象,没有类的概念.它是基于原型的面向对象语言.原型对象特点就是将自身的属性共享给新对象.这样的写法相对于其它传统面向对象语言来讲,很有一种独树一帜的感脚!非常容易让人 ...

  8. nginx 代理https后,应用redirect https变成http --转

    原文地址:http://blog.sina.com.cn/s/blog_56d8ea900101hlhv.html 情况说明nginx配置https,tomcat正常http接受nginx转发.ngi ...

  9. struts2连接mysql多表查询

    下载地址:http://download.csdn.net/detail/qq_33599520/9786567 项目结构: 代码: package com.mstf.action; import j ...

  10. JAVA程序类加载及其反射机制

    [IT168 技术]当调用java命令运行某个Java程序时,该命令将启动一条Java虚拟机进程,同一个JVM的所有线程,所有变量都处于同一进程里,它们都是用该JVM进程的内存区. 程序运行到最后正常 ...