Sie sind auf Seite 1von 12

Windows Server 2003 Kernel Scaling Improvements

Microsoft Corporation
Published: October 2003

Abstract

Microsoft Windows Server™ 2003 enables large x86-based and 64-bit enterprise class multiprocessor systems
to scale very well. This document describes many of the significant kernel scalability improvements in
Windows Server 2003.
Microsoft® Windows Server™ 2003 White Paper

The information contained in this document represents the current view of


Microsoft Corporation on the issues discussed as of the date of
publication. Because Microsoft must respond to changing market
conditions, it should not be interpreted to be a commitment on the part of
Microsoft, and Microsoft cannot guarantee the accuracy of any
information presented after the date of publication.
This White Paper is for informational purposes only. MICROSOFT
MAKES NO WARRANTIES, EXPRESS, IMPLIED OR STATUTORY, AS
TO THE INFORMATION IN THIS DOCUMENT.
Complying with all applicable copyright laws is the responsibility of the
user. Without limiting the rights under copyright, no part of this document
may be reproduced, stored in or introduced into a retrieval system, or
transmitted in any form or by any means (electronic, mechanical,
photocopying, recording, or otherwise), or for any purpose, without the
express written permission of Microsoft Corporation.
Microsoft may have patents, patent applications, trademarks, copyrights,
or other intellectual property rights covering subject matter in this
document. Except as expressly provided in any written license
agreement from Microsoft, the furnishing of this document does not give
you any license to these patents, trademarks, copyrights, or other
intellectual property.
© 2003 Microsoft Corporation. All rights reserved.
Microsoft, Active Directory, Windows, and Windows Server are either
registered trademarks or trademarks of Microsoft Corporation in the
United States and/or other countries.
The names of actual companies and products mentioned herein may be
the trademarks of their respective owners.
Microsoft® Windows Server™ 2003 White Paper

Contents
Contents........................................................................................................................................3

Introduction...................................................................................................................................1

Scheduling.....................................................................................................................................2

Memory Management...................................................................................................................3

Kernel Spinlocks...........................................................................................................................5

Heap...............................................................................................................................................6

Processes, Threads, Handles, Objects, and Named Pipes.......................................................7

Summary........................................................................................................................................8
Related Links.................................................................................................................................9
Microsoft® Windows Server™ 2003 White Paper

Introduction

In Microsoft Windows Server™ 2003, significant work has been completed to improve overall kernel
scalability. Detailed analysis, with both software and hardware tools on systems with up to
32 processors, was used to significantly improve Windows Server 2003 scalability on large x86-based
and 64-bit systems with eight or more processors. A number of different workloads were used to
analyze scalability on Windows Server 2003, such as Transaction Processing Performance Council
TPC-C and SAP Sales and Distribution (SD) workload. This document describes the improvements that
have been made to the following areas:
• Scheduling

• Memory management

• Kernel spinlocks
• Heap

• Processes, threads, handles, objects, and named pipes

In addition, several other Windows Server 2003 features and components, such as Internet Information

Services (IIS), Active Directory , and various networking components have been improved significantly.
Although these improvements are not specifically outlined in this document, the improvement of the
overall efficiency of the Windows kernel benefits a large number of services and applications.
 
The scalability improvements in Windows Server 2003 enabled the 64-bit NEC Intel Itanium 2 32way
TX7/i9510 server to achieve 308,620 tpmC using Microsoft SQL Server™ 2000 (64-Bit) and more than
doubled throughput with the Unisys ES7000 32way x86-based Enterprise Server using SQL Server
2000 on the industry standard TPC-C workload. (For more information, see the Transaction Processing
Performance Council Web site at www.tpc.org). Windows Server 2003 dramatically improves scalability
on large enterprise class multiprocessor systems.

Windows Server 2003 Kernel Scaling Improvements 1


Microsoft® Windows Server™ 2003 White Paper

Scheduling
Windows Server 2003 contains many enhancements based on analysis, improvement, and verification
of scheduler data structures and code paths. These include:
• Significant reduction in dispatch scheduler spinlock usage.

o Reduction in frequency of lock acquires on many different paths.

o Reduction in the average and maximum length of time the lock is held.

o Change in ranking of scheduler and per thread asynchronous procedure call (APC) lock to
reduce time holding scheduler lock.

• Removal of context swap spinlock used for thread context switches and translation lookaside buffer
(TLB) invalidates.
• Improved anti-convoy features to reduce context swap, which can occur when several threads
repeatedly compete to acquire user mode locks.

• Improved timer processing and data structures.

• Replacement of global wait lists and ready queues with per-processor wait lists and ready queues.

• Reduction in per thread APC lock acquires.

• Removal of interrupt request level (IRQL) changes for fast mutexes.

• Improved kernel data structure alignment to reduce false sharing of data.

• Improved I/O float count by changing from a shared data count to balanced per-processor counts.

• Improved lookaside list auto-tuning.

• Increased use of inling for heavily used functions.

• Improved implementation of SYNCH_LEVEL IRQL spinlocks for x86-based systems (for example, the
scheduling dispatch lock).

• Support for Non-Uniform Memory Access (NUMA) systems.

Windows Server 2003 Kernel Scaling Improvements 2


Microsoft® Windows Server™ 2003 White Paper

Memory Management
Windows Server 2003 provides many scalability improvements to memory management that cover the
following areas:
• Address Windowing Extension (AWE) allows a server or application to quickly map, remap, and unmap
virtual addresses to a very large physical address space. As a result, servers (such as SQL Server 2000)
can access all physical memory (up to 64 GB) on an x86-based system that is limited to two gigabytes (GB)
of virtual address space.

• Disk I/O, when using Direct Memory Access (DMA), requires memory management to lock I/O buffers
into memory while I/O occurs.

• Memory management maps pages into virtual address space on demand. Soft page faults occur when
required data exists in physical memory but not in virtual memory, which might be the result of an
application or memory management unmapping memory to reuse virtual addresses for another purpose.

• Zero pages are used on demand to provide security for data sections and in response to an application
request for data pages. Windows zeros proactively, so the zeroing of a page can be done on demand to
reduce the cost of demand zero fault.

Windows Server 2003 memory management improves scalability by dramatically reducing spinlock
contention. Improvements to memory management include:
• Reduction in page frame spinlock.

o Reduction in the frequency of acquires on many paths, including disk I/O page lock and unlock
and soft page faults.

o Reductions in spinlock hold time and contention.

• Removal of the memory management system space lock for system address mapping.

• Support for user mode large page, available with the VirtualAlloc function but restricted to single
process usage (cannot be shared among processes). In terms of page size, the following are available:

o 4 MB pages on x86-based systems.

o 16 MB pages on Itanium architecture-based systems.

• Removal of AweLock, which improves scalability of AWE page map and unmap operations.

• Bypass of page frame spinlock for disk I/O to AWE and large pages.

• Increased physical memory support:

o Support increased from 32 GB on Windows 2000 to 64 GB on Windows Server 2003 for x86-
based computers.

o Support for 512 GB on Intel architecture-based systems.

• Increased virtual address space on 64-bit versions of the Windows Server 2003 family and, as a result,
dramatically improved overall system capacity. For example:

Windows Server 2003 Kernel Scaling Improvements 3


Microsoft® Windows Server™ 2003 White Paper

o More than 10 times the number of network connections can be made on 64-bit systems (more
than 1 million on 64-bit systems versus 100,000 on x86-based systems).

o The number of processes that can be created is increased by more than 22 times on 64-bit
systems (more than 550,000 on 64-bit versus 22,000 on x86-based systems).

In addition, large servers and applications can improve overall performance through the use of flat
memory that does not require frequent virtual or AWE map and unmap operations. For example,
performance and scaling on SQL Server 2000 and SAP is significantly better on 64-bit systems
because of a reduction of map and unmap operations.
• Reductions in IRQL raise and lower operations on all memory management, pool, and AWE mappings.

• Nonpaged and paged pool:

o Now have per-node areas to improve NUMA locality.

o Maximum Paged Pool Size is larger.


• Improvements in zeroing of free pages. For example:

o At boot, free pages are zeroed in parallel with a thread for each processor, which makes this
process occur much faster on a multiprocessor system.

o Runtime zeroing of AWE and large pages on demand provides faster parallel page zeroing.

• Improved memory management for Terminal Services.

o Images always share pages, regardless of frequent rebase collisions. This functionality reduces
the physical memory footprint and commitment while increasing the cache hit ratio.

o Many specify locks have been removed.

o Lookaside list usage has been increased for frequent terminal server nonpaged and paged pool
allocations.

• Claims-based working set trimming, which is now used for multiprocessor as well as uniprocessor (UP)
systems. Claims-based working set trimming improves page trimming.

• Larger system cache and maximum sizes for system PTEs.

• Substantially reduced working set mutex hold times.

• Removal of commitment lock.

• Change of the virtual address descriptor (VAD) tree to an AVL balanced tree (that is, no longer a splay
binary search tree). The VAD is now bitmapped for fast allocations and elimination of long searches.

Windows Server 2003 Kernel Scaling Improvements 4


Microsoft® Windows Server™ 2003 White Paper

Kernel Spinlocks
Spinlocks provide an effective method to synchronize shared kernel data structures. The Windows
kernel uses spinlocks in many places to provide atomic data updates. In Windows 2000, queued
spinlocks were introduced and applied to several global hot locks. Queued spinlocks improve
synchronization of shared data that is heavily used by:
• Implementing first in first out (FIFO) for processors waiting for the spinlock.

• Removing the race condition that occurs when multiple processors are waiting for the spinlock.

• Reducing bus usage (due to removal of the race condition) and providing a per-processor indicator for
the status of the spinlock.

However, queued spinlocks in Windows 2000 are limited to the global static type and require
preallocation of a portion of the queue area for each lock on each processor. Windows Server 2003
provides a new type of queued spinlock called in-stack queued spinlock, which can be used on
nonglobal spinlocks with multiple instances and does not require a preallocation of queue area. In this
case, the queue area used is on the stack, which provides temporal locality. In-stack queued spinlocks
also reduce bus utilization and provide balanced FIFO ordering on Windows Server 2003. The only
restriction on the use of in-stack queued spinlocks is that the activation record that existed when the
lock was acquired must still exist when the lock is released.

Windows Server 2003 Kernel Scaling Improvements 5


Microsoft® Windows Server™ 2003 White Paper

Heap
Windows Server 2003 provides several improvements to the heap. The heap is used by many
applications and services including Windows components. The heap provides the capability to
dynamically allocate and free of data structures. Heap improvements include:
• Reduction in the amount of time required to create a heap, reducing process creation time.

• Capability of monitoring heap usage with Perfmon (enabled through the registry).

• A new type of heap in Windows Server 2003 called the low fragmentation heap (LFH). Applications and
services can select the LFH through an API. LFH improves performance and scalability while reducing the
potential for fragmentation.

Windows Server 2003 Kernel Scaling Improvements 6


Microsoft® Windows Server™ 2003 White Paper

Processes, Threads, Handles, Objects, and Named Pipes


Windows Server 2003 contains improvements to processes, threads, objects, handles, and named
pipes, including:
• Reduction in the time required for handle table inheritance and rundown, which improves process
creationespecially when handles are inherited.

• Reduction in the number of registry touches for each process that is created.

• Reductions in process lock usage.

• Creation of a pushlock for a fast read/write lock.

• Enhancements to Object Manager, which now has finer granularity locking.

• Reduction in lock usage and contention for the handle table.


• Reduction in lock contention on named pipes.

Windows Server 2003 Kernel Scaling Improvements 7


Microsoft® Windows Server™ 2003 White Paper

Summary
Kernel improvements in Windows Server 2003 provide scalability gains for large x86-based and 64-bit
systems with eight or more processors. Specifically, improved scheduling, memory management, kernel
spinlocks, and heap functionality coupled with enhancements to process creation, threads, handles,
objects, and named pipes give Windows Server 2003 significantly enhanced scalability on large
enterprise class multiprocessor systems.

Windows Server 2003 Kernel Scaling Improvements 8


Microsoft® Windows Server™ 2003 White Paper

Related Links
See the following resources for further information:
• Transaction Processing Performance Council Web site at www.tpc.org.

• Lab Report: Windows Server 2003 Outperforms Predecessors at


http://www.microsoft.com/windowsserver2003/evaluation/performance/etest.mspx.

• Performance and Scalability on the Windows Server 2003 Web site at


http://www.microsoft.com/windowsserver2003/evaluation/performance/default.mspx.

For the latest information about Windows Server 2003, see the Windows Server 2003 Web site at
http://www.microsoft.com/windowsserver2003.

Windows Server 2003 Kernel Scaling Improvements 9

Das könnte Ihnen auch gefallen