IIS 6 Administration

It turns out that everything you’ve learned so far about IIS 6 architecture is really only half the story. IIS 6 is a kind of chameleon that can change its colors to meet the needs of its environment, and it actually has two possible architectures that are quite different from one another. These architectures are referred to as the application isolation modes because they determine how applications are isolated from one another for greater reliability and scalability. The two application isolation modes of IIS 6 are as follows:

Let’s look at these two modes in detail now to get the big picture.

Worker Process Isolation Mode

This is the primary mode of operation for IIS 6 and implements all of the new and enhanced architectural features we’ve discussed so far, including worker processes, application pools, health monitoring, demand start, rapid fail protection, and so on. Figure 2-10 shows the architectural big picture when IIS 6 is running in worker process isolation mode:

Figure 2-10: Big picture of IIS 6 architecture when running in worker process isolation mode

To understand Figure 2-10 fully, I’ll walk you through the process of a client web browser requesting an ASP page from IIS 6:

  1. The client sends the HTTP GET request.

  2. The request is detected by http.sys, which verifies it as a valid request. If the request is invalid, http.sys returns the appropriate HTTP error code to the client.

  3. http.sys checks the kernel mode response cache to see if the requested page has been cached from a recent request. If the response is in the cache, http.sys returns the cached response to the client. This happens very fast because everything takes place in kernel mode. Note that http.sys is capable of caching both static and dynamic content.

  4. Http.sys routes the request to the appropriate kernel mode queue associated with the application pool for the ASP page being requested.

  5. As soon as a thread becomes available, a worker process for the application pool pulls the request from the kernel mode cache. If there is currently no worker process servicing the application pool, http.sys notifies the WAS, which starts a worker process for the pool.

  6. The ASP page is executed within the worker process using the ISAPI filter for the ASP script engine, which also runs within the worker process.

  7. The worker process sends the response to http.sys, which caches it for future use and returns it to the client. http.sys may also log the action if IIS logging is enabled.

Worker process isolation mode is the recommended mode of operation when using IIS 6 because of its increased reliability, availability, and performance. For applications that break when run in this mode, however (such as applications developed for earlier versions of IIS), an alternate mode of operation can be used called IIS 5 isolation mode, which I’ll discuss next.

IIS 5 Isolation Mode

If applications developed for IIS 5 don’t run properly on IIS 6, you can make them run properly by running IIS 6 in a second application isolation mode called IIS 5 isolation mode. This mode of IIS 6 operation basically emulates the IIS 5 architecture to ensure backward compatibility for legacy applications to run on IIS 6. The architecture of IIS 5 isolation mode is quite different from that of worker process isolation mode, as can be seen from Figure 2-11.

Figure 2-11: Big picture of IIS 6 architecture when running in IIS 5 isolation mode

From an examination of Figure 2-11, you can determine the following architectural features of IIS 6 when running in IIS 5 isolation mode:

Examples of applications that require IIS 6 to be running in IIS 5 isolation mode in order to function properly include the following:

Comparison with IIS 5

If you compare the IIS 5 isolation mode of IIS 6 (Figure 2-11) with the earlier architecture of IIS 5 itself (Figure 2-5), you can see that in both cases the core inetinfo.exe process manages the IIS metabase; runs ISAPI filters and in-process ISAPI extensions; and manages the FTP, NNTP, and SMTP Services. In IIS 5 isolation mode, however, HTTP protocol support has been moved from inetinfo.exe (which used Winsock to manage HTTP requests in IIS 5) to the new kernel mode http.sys component of IIS 6, which is itself managed by the new WAS component of IIS 6. The actual operational differences are slight enough that any application designed to run on IIS 5 will run without problem on IIS 6 when IIS 5 isolation mode is being used.

When IIS 6 is running in IIS 5 isolation mode, it offers the same three application protection levels offered by IIS 5 itself: Low (IIS Process), Medium (Pooled), and High (Isolated). When you run a legacy IIS 5 application on IIS 6 in this mode, configure the application protection level to the same setting used on the downlevel Windows 2000 Server running IIS 5. An additional point to mention is that when IIS 6 is configured in IIS 5 isolation mode, applications running as either Medium (Pooled) or High (Isolated) will experience the same kind of performance hit such out-of-process applications experienced in IIS 5. This is due to the same issue of data marshalling that negatively impacted performance for these application protection levels in IIS 5. When IIS 6 is configured in worker process isolation mode, however, there is no such performance penalty because all applications and their associated ISAPI filters run in-process within a worker process w3wp.exe.

So the bottom line is, don’t run IIS 6 in IIS 5 isolation mode unless there’s absolutely no other way to get your applications working!

Comparison of IIS 6 Application Isolation Modes

Now that we’ve looked in detail at the two application isolation modes in IIS 6, let’s make sure you understand them by comparing their features at the process level. Table 2-1 lists the key architectural features of IIS 6 in each mode and the corresponding process managing or implementing each feature.

Table 2-1: Comparison of IIS 6 Application Isolation Modes at the Process Level

IIS Feature

Worker Process Isolation Mode

IIS 5 Isolation Mode

HTTP

http.sys

http.sys

FTP

inetinfo.exe

inetinfo.exe

NNTP

inetinfo.exe

inetinfo.exe

SMTP

inetinfo.exe

inetinfo.exe

Metabase

inetinfo.exe

inetinfo.exe

http.sys configuration

WAS

WAS

Worker process

w3wp.exe

N/A

ISAPI filters

w3wp.exe

inetinfo.exe

In-process ISAPI extensions

w3wp.exe

inetinfo.exe

Out-of-process ISAPI extensions

N/A

dllhost.exe

Another difference between the two application isolation modes of IIS 6 is that certain features are not available when running in IIS 5 isolation mode:

Availability of Modes

The default application isolation mode for IIS 6 depends on whether installation or upgrade has been performed, specifically,

I’ll discuss IIS 6 deployment further in the next chapter, “Planning Deployment.”

Note 

You cannot run IIS 6 in both modes simultaneously. If you have some applications that can only run on IIS 5, you could migrate your remaining apps to a fresh IIS 6 machine and either leave the legacy apps running on IIS 5 or deploy a second IIS 6 machine running in IIS 5 isolation mode.

Switching Modes

You can also switch between the two application isolation modes of IIS 6, but this can have certain effects. For example, if you switch from IIS 5 isolation mode to worker process isolation mode, all of your isolated out-of-process web applications will be moved into a single application pool (the default application pool) that is created when IIS 6 is installed. You can then create additional application pools, however, and move your applications to these pools to increase reliability. Switching application isolation modes can be done using a simple check box on a property sheet that’s accessed by the Internet Information Services console tool, as you’ll see in Chapter 9. You can also switch application isolation modes from the command-line using ADSI as you’ll see in Chapter 11.

Категории