Wednesday, August 24, 2016

IIS

  • IIS is a web server to deliver web pages to clients using HTTP
  • run type"inetmgr" to check IIS is installed.
  • Worker process 
    • ASP.NET run under a process, it responsible for all request and response processing.
    • w3wp.exe
  • Application pool 
    • Allow run a group of web sites, web application or web services.
    • 1 App Pool Container of 1 worker process.
    • Web applications run separate processes to isolation between them.
  •  WAS 
    • Manage Application pools and worker processes for HTTP and non-HTTP request. 
    • Determine worker process is running or not. if not, it will start a worker process. 
    • spawns worker processes, monitors their health, recycles them if necessary and makes sure none of them consume more resources than specified AppPool configuration. 
    • WAS is also the arbiter and collector for run-time and state data, e.g. performance counters, site and Application Pool state.
  • HTTP.sys (Hypertext Transfer Protocol Stack)
    • Implement at Kernel Mode.Without switch to user mode.
    • Listen HTTP request from network, pass request to ISS process and return response to client browser.
    • http.sys know which app pool handle the request, because new app pool ID will registered with http.sys
    • Kernel mode request queuing. request cause less overhead in context switching. If no worker process available to accept request, the kernel mode request queue will hold the request until a worker process pick it up.
    • Request pre-processing and security filtering.
  • IIS 5.0 all app domains are hosted by a ASP.NET worker process.
  • IIS 5.0 run on windows 2000 or XP
  • IIS 5.0 single process host all application, if killing this process, all other application will restart.
  • IIS 5.0 do not have App Pool.
  • IIS 5.0 single aspnet_wp.exe. (All request are dispatched by ISAPI extension hosted in inetinfo.exe, and pass to aspnet_wp.exe)
  • IIS 6.0 no use aspnet_wp.exe, it use worker process (w3wp.exe) which is not single, it can be many instance.
  • IIS 6.0 no use inetinfo.exe to forward HTTP request to ISAPI extensions.
  • IIS 6.0 handle Incoming request at lower kernal level (http.sys) insteal of user mode and route to the app pool. IIS 5.0 request is received by user mode (inetinfo.exe)
  • IIS 6.0 run on windows server 2003
  • IIS 6.0 allow application run inside different copy of a new worker process, w3wp.exe. Each app pool can contain mutiple App Domain and is hosted in single copy of worker process.
  • IIS 6.0 keep a single copy of metabase in global process (intelinfo.exe).
  • IIS 7.0 no use metabase and use XML Configuration files that located alongside Web content. Each worker process loads a unique copy of configuration.
  • XML config file can read by human
  • IIS 7.0 run on Windows 2008
  • IIS 7.0  URL Rewrite
  • IIS 7.0 Better UI
  • IIS 7.0 has 40++ module (basic, anonymous, windows authentication, logging, FTP)
  • IIS 7.0 has Classical and Inegrated mode. Classical is back to IIS 6.0

Classical Mode / Integration Mode

  • Classic mode
    • the only mode in IIS6 and below
    • IIS (request/response) pipeline is separate with ASP.NET pipeline.
    • Is a mode where IIS only works with ISAPI extensions and ISAPI filters directly. IIS treat ASP.NET as an external plugin implemented in ISAPI and only give out the request to ASP.NET. when it's needs.
  • Integrated mode
    • Integrate IIS request pipeline and ASP.NET request pipeline. ASP.NET is no longer treated as an external plugin.
    • HttpModules have power as an ISAPI filter  and  HttpHandlers have power as an ISAPI extension. ASP.NET is a part of IIS.
    • Unified process model, eliminates steps that previously duplicated in IIS and ASP.NET. E.g. Authentication and authorization.
    • Enable manage to all content types (images, text files, HTML), that’s why HttpHandler and HttpModule can handle it.


IIS 6.0 Process Model

Request  > Http.sys (kernel mode) > (user mode)WAS > App Pool  > w3wp.exe = asp.net_isapi.ddl create HTTPRuntime object process the request via HTTPModule and HTTPHandler > Page Life Cycle

No comments:

Post a Comment