Configuring and Optimizing Applications


Web sites can operate only as well as the Web applications installed on the systems. Therefore, IIS's many improvements have been to support those applications to run as efficiently as possible. Improving how Web applications can interact with IIS also improves Web server reliability and availability.

Application Isolation and Pooling

IIS supports two modes of application isolation: worker process isolation mode and IIS 5 isolation mode. Both modes of operation use Http.sys and application pooling. Application pools are queues for requests within Http.sys and one or more worker processes. Applications are assigned to an application pool based on their URL, and many pools can run at the same time. For example, by default, DefaultAppPool is located within the Application Pools folder.

On a given Web site there may be only one mode of operation working to support the Web applications. It is recommended to use worker process isolation mode exclusively unless there is a specific compatibility issue with a particular application. Using worker process mode gives the greatest boost to reliability and availability. Another reason to use worker process isolation mode is that the type of application isolation that is in use causes IIS to dynamically adjust internal architecture parameters to accommodate the fundamental differences between the two isolation modes.

The IIS 5 isolation mode is used primarily to support applications that may depend on features in earlier versions (mainly IIS 5) of IIS. It's important to use this isolation mode only when the application cannot work properly under the worker process isolation mode. Otherwise, this mode can increase the resource requirements needed to run such applications when compared to worker process mode. This could, in turn, affect performance and reliability of the system.

Note

New installations of IIS 6 automatically use worker process isolation mode. Upgrades to IIS 6 from previous versions (IIS 4 and 5) use IIS 5 isolation mode. If there are no known compatibility issues, the isolation mode can be changed to worker process isolation mode after installation.


IIS 6 Process Recycling

Generally speaking, Web sites are expected to be up and running without little interruption. Moreover, these Web sites must adequately service user requests. Sites that require this level of service must incorporate fault tolerance into the infrastructure's design. For example, many Web servers must be linked together by some form of network load balancing to ensure minimal downtime.

Even the most reliable Web sites must have the servers refreshed at some point so that the applications can be recycled or other maintenance can occur. Another solution that can work in conjunction with infrastructure fault tolerance is using IIS 6 process recycling. Using IIS 6 minimizes the number of server refreshes that may be required because of its capability to automatically refresh Web applications without affecting the rest of the system or stopping service to that Web application. Process recycling is also extremely useful for those Web applications that can be problematic because the server must be restarted. Often it is difficult to rewrite an application to work better because of budgetary reasons, technical limitations, or extensive effort required to make the changes.

Within the Properties Recycling tab of an application pool such as the one shown in Figure 11.11, applications can be recycled every so many minutes (the default is 1,740 minutes or 29 hours), after a set number of requests to that application, at a specified time, or when a certain amount of physical or virtual memory is used.

Figure 11.11. Application recycling configurations.


When one of these events occurs, one of two procedures can happen:

  • Another worker process will be created by Web Administration Services and the old process terminates. This process, called overlapping recycling, ensures that requests aren't dropped even though a process is being recycled.

  • The current process terminates, and WAS creates a new process immediately thereafter.

Process recycling is a welcomed feature; however, it doesn't apply to every situation. For obvious reasons, process recycling doesn't work on static content, but it also doesn't work if the Web site uses custom-built ISAPI applications. Also, if session state data is required on the Web site, it's important to be aware that session state data may be lost during process recycling.

Monitoring IIS Health

Using IIS to monitor applications is now feasible with IIS 6. More specifically, WAS can perform the following health-monitoring procedures:

  • Ping worker processes after a specified period of time.

  • Monitor for failed applications and disable the application pool after a certain number of failures or a set number of failures within a given time frame.

When a worker process doesn't respond to a ping, WAS can terminate the worker process and create another one so that the application can keep servicing requests.

Application Performance

There are many variables with how applications perform. They include, but aren't limited to, the server resources, the way the application is written, and the way the environment is structured.

Process recycling and health detection help ensure that applications are running efficiently and effectively. Another set of features is located under the Performance tab of the application pool properties page. Within the Performance tab are options specifically geared toward optimizing performance, including the following:

  • Idle Timeout Applications can be shut down after being idle for a specified period of time. A timeout value of 20 minutes is enabled by default.

  • Kernel Requests Queues Kernel Requests queues can be limited to a certain number of requests. This option is enabled with a default value of 1,000 outstanding requests.

  • CPU Utilization CPU utilization for an application pool can be limited so that the pool doesn't consume CPU time unnecessarily. This option is disabled by default. If it is enabled, an action can be performed after CPU utilization is exceeded.

  • Web Gardens Under the Web Gardens option, a maximum number of worker processes can be set.

Application Options

Numerous application types are supported on IIS, including, but not limited to, Active Server Pages, ASP.NET, COM+, Java, Common Gateway Interface (CGI), and FastCGI. No matter what types of applications the server will host, it's imperative to adequately test them. You should test the applications under various workloads and consider using those that are specifically designed to run on the IIS platform. For instance, ASP and ASP.NET were developed solely for IIS and can therefore perform much better than other technologies that weren't built for a specific platform.




Microsoft Windows Server 2003 Unleashed(c) R2 Edition
Microsoft Windows Server 2003 Unleashed (R2 Edition)
ISBN: 0672328984
EAN: 2147483647
Year: 2006
Pages: 499

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net