• Operating System Practices
  • Tuning IIS 7.5
  • Kernel-Mode Tunings
  • Cache Management Settings
  • Request and Connection Management Settings
  • Performance Tuning Guidelines for Windows Server 2008 R2 April 12, 2013 Abstract

    Download 0.5 Mb.
    Hajmi0.5 Mb.
    1   ...   4   5   6   7   8   9   10   11   ...   24

    Performance Tuning for Web Servers

    Selecting the Proper Hardware for Performance

    It is important to select the proper hardware to satisfy the expected Web load, considering average load, peak load, capacity, growth plans, and response times. Hardware bottlenecks limit the effectiveness of software tuning. “Choosing and Tuning Server Hardware” earlier in this guide provides recommendations for hardware to avoid the following performance constraints:

    Slow CPUs offer limited processing power for ASP, ASP.NET, and SSL scenarios.

    A small L2 processor cache might adversely affect performance.

    A limited amount of memory affects the number of sites that can be hosted, how many dynamic content scripts (such as ASP.NET) can be stored, and the number of application pools or worker processes.

    Networking becomes a bottleneck because of an inefficient networking adapter.

    The file system becomes a bottleneck because of an inefficient disk subsystem or storage adapter.

    Operating System Practices

    If possible, do a clean installation of the operating system software. Upgrading can leave outdated, unwanted, or suboptimal registry settings and previously installed services and applications that consume resources if they are started automatically. If another operating system is installed and must be kept, you should install the new operating system on a different partition. Otherwise, the new installation overwrites the settings under Program Files\Common Files.

    To reduce disk access interference, place the system pagefile, operating system, Web data, ASP template cache, and Internet Information Services (IIS) log on separate physical disks if possible.

    To reduce contention for system resources, install SQL and IIS on different servers if possible.

    Avoid installing nonessential services and applications. In some cases, it might be worthwhile to disable services that are not required on a system.

    Tuning IIS 7.5

    Internet Information Services (IIS) 7.5 is the version that ships as part of Windows Server 2008 R2. It uses a process model similar to that of IIS 6.0. A kernel-mode HTTP listener (Http.sys) receives and routes HTTP requests and can even satisfy requests from its response cache. Worker processes register for URL subspaces, and Http.sys routes the request to the appropriate process (or set of processes for application pools).

    The IIS 7.5 process relies on the kernel-mode Web driver, Http.sys. Http.sys is responsible for connection management and request handling. The request can be either served from the Http.sys cache or handed to a worker process for further handling (see Figure 5). Multiple worker processes can be configured, which provides isolation at a reduced cost.

    Http.sys includes a response cache. When a request matches an entry in the response cache, Http.sys sends the cache response directly from kernel mode. Figure 5 shows the request flow from the network through Http.sys and potentially up to a worker process. Some Web application platforms, such as ASP.NET, provide mechanisms to enable any dynamic content to be cached in the kernel cache. The static file handler in IIS 7.5 automatically caches frequently requested files in Http.sys.

    Figure 5. Request Handling in IIS 7.5

    Because a Web server has a kernel-mode and a user-mode component, both components must be tuned for optimal performance. Therefore, tuning IIS 7.5 for a specific workload includes configuring the following:

    Http.sys (the kernel-mode driver) and the associated kernel-mode cache.

    Worker processes and user-mode IIS, including application pool configuration.

    Certain tuning parameters that affect performance.

    The following sections discuss how to configure the kernel-mode and user-mode aspects of IIS 7.5.

    Kernel-Mode Tunings

    Performance-related Http.sys settings fall into two broad categories: cache management, and connection and request management. All registry settings are stored under the following entry:


    If the HTTP service is already running, you must restart it for the changes to take effect.

    Cache Management Settings

    One benefit that Http.sys provides is a kernel-mode cache. If the response is in the kernel-mode cache, you can satisfy an HTTP request entirely from kernel mode, which significantly lowers the CPU cost of handling the request. However, the kernel-mode cache of IIS 7.5 is a physical memory–based cache and the cost of an entry is the memory that it occupies.

    An entry in the cache is helpful only when it is used. However, the entry always consumes physical memory, whether the entry is being used or not. You must evaluate the usefulness of an item in the cache (the savings from being able to serve it from the cache) and its cost (the physical memory occupied) over the lifetime of the entry by considering the available resources (CPU and physical memory) and the workload requirements. Http.sys tries to keep only useful, actively accessed items in the cache, but you can increase the performance of the Web server by tuning the Http.sys cache for particular workloads.

    The following are some useful settings for the Http.sys kernel-mode cache:

    UriEnableCache. Default value 1.

    A nonzero value enables the kernel-mode response and fragment cache. For most workloads, the cache should remain enabled. Consider disabling the cache if you expect very low response and fragment cache usage.

    UriMaxCacheMegabyteCount. Default value 0.

    A nonzero value specifies the maximum memory that is available to the kernel cache. The default value, 0, enables the system to automatically adjust how much memory is available to the cache. Note that specifying the size sets only the maximum and the system might not let the cache grow to the specified size.

    UriMaxUriBytes. Default value 262144 bytes (256 KB).

    This is the maximum size of an entry in the kernel-mode cache. Responses or fragments larger than this are not cached. If you have enough memory, consider increasing the limit. If memory is limited and large entries are crowding out smaller ones, it might be helpful to lower the limit.

    UriScavengerPeriod. Default value 120 seconds.

    The Http.sys cache is periodically scanned by a scavenger, and entries that are not accessed between scavenger scans are removed. Setting the scavenger period to a high value reduces the number of scavenger scans. However, the cache memory usage might increase because older, less frequently accessed entries can remain in the cache. Setting the period to too low a value causes more frequent scavenger scans and might result in too many flushes and cache churn.

    Request and Connection Management Settings

    In Windows Server 2008 R2, Http.sys manages connections automatically. The following registry keys that were used in earlier releases are considered deprecated and are not necessary in Windows Server 2008 R2:















    1   ...   4   5   6   7   8   9   10   11   ...   24

    Download 0.5 Mb.

    Bosh sahifa

        Bosh sahifa

    Performance Tuning Guidelines for Windows Server 2008 R2 April 12, 2013 Abstract

    Download 0.5 Mb.