Presented by: Matthew Hester IT Pro Evangelist Microsoft Corporation...

26
32 vs. 64 bit

Transcript of Presented by: Matthew Hester IT Pro Evangelist Microsoft Corporation...

32 vs. 64 bit

I started off thinking...."This talk consists of just accepting that 64bit is here so you might as well just get on board - the end".

Presented by:

Matthew HesterIT Pro EvangelistMicrosoft Corporation

[email protected]@matthewhesterhttp://blogs.technet.com/matthewms

My Boss Martin [email protected]

Microsoft Windows Server 2008 R2Administration Instant Reference

Why is 64-bit important TODAY?1. 32-bit technology is aging technology –

we have long been approaching its limits1989: 486 DX, first 32-bit Intel-Chip1993: Windows NT 3.1, first 32-bit OS from Microsoft

2. 64-bit technology has been available for other Operating Systems for years. Some examples:

1992: DEC ALPHA processor - Windows NT (even Windows 2000 in the Beta phase)1992: IBM PowerPC processor1995: SUN UltraSPARC processor1996: HP updated PA-RISC processor to 64-bit

3. Microsoft is betting all its horses on 64-bit Technology

4. Superb 64-bit hardware now available to support most workloads on Windows!

b/w = 32-bit SWcolored = 64-bit SW

DEC ALPHA

Terminology

Virtual memory - This is a method of extending the available physical memory on a computer. In a virtual memory system, the operating system creates a page file, or swap file, and divides memory into units called pages. The total amount of memory that is available to programs is the amount of physical memory in the computer in addition to the size of the page file.

Paging File - This is a disk file that the computer uses to increase the amount of physical storage for virtual memory

Paged Pool - This is a region of virtual memory in system space that can be paged in and out of the working set of the system process. Used by Kernel-mode components to allocate system memory.

Non-paged Pool - This is a memory pool that consists of ranges of system virtual addresses that are guaranteed to be resident in physical memory at all times and thus can be accessed from any address space without incurring paging input/output (I/O).

System cache - These are pages that are used to map open files in the system cache

System PTEs (Page Table Entries) - A pool of system Page Table Entries (PTEs) that is used to map system pages such as I/O space, Kernel stacks, and memory descriptor lists.

Intro to 64bit Computing

When we talk about 32-bit or 64-bit processors, we talk about the number of bits that a processor's registers can store

All computed data is eventually stored in a register before it is processed64-bit processor = register width is 64 bits (twice as much data per register compared to a 32-bit processor)CPUs have different registers, e.g. GPR and FPR

Two main data types stored in the GPRs (general purpose registers)

Integer data (the actual data being computed)Address data (memory pointers)

The register width of the memory pointers is one of the key advantages of 64-bit processors

32-bit registers can directly address 232bits = 4 giga-bytes64-bit registers can directly address 264bits =16 exa-bytes*

= 16 billion GB

* 16 exa-bytes can technically be addressed using 64-bits, but no HW currently has this capability

Execution Unit

CPU

Registers

L1 Instr. Cache

L2 Mem. Cache

L3 Mem. Cache

RAM Memory

/3 GB switch

The Memory Limitations in 32-bit Windows

Using 32-bit Windows Server, user processes are limited to flat 4 GB virtual address space

64-bit Systems free the Kernel from sharing

Windows OS typically occupies the first 2 GB of memory Can be influenced using the /3GB and /UserVA boot.ini switches

doesn't really improve performance for most apps

Only useful for apps that have been compiled with /LARGEADDRESSAWARE compiler option32-bit applications running on 64-bit Windows can each be assigned up to 4GB User Memory in the Virtual Address spaceDoes NOT negatively impact Kernel Memory

2 GB

2 GB

Virtual Address Space

Kernel Memory

User Memory

1 GB

3 GB

Kernel Memory

User Memory

all 32-bit Apps

4 GB

32bit apps on 64bit OS

12 GB2 GB

Kernel Memory

User Memory

32-bit App1

4 GB

4 GBUser

Memory32-bit App3/largeaddressaw

are

User Memory

32-bit App2

2 GB

Server App Address Space

4 GB

Server App Address Space

Physical Memory

12 GB 12 GB

More about the 32-bit Memory Limitations…

Workarounds do exist for 32-bit Windows Server to leverage more than 4 GB physical memory

Physical Addressing Extensions (PAE) and Address Windowing Extensions (AWE) must be used by applications to map to additional memoryDownside: translating between virtual and physical memory strongly impacts performance

64-bit Systems eliminate the 4 GB memory barrier

Can directly address the physical memory

Server App Address Space

Physical Memory

4 GB

12 GB

AWE Window

AWE Memory

Microsoft Windows Memory Architecture

Memory allocation settings 32-bit x86 64-bit x64/Itanium

Total amount of virtual address space 4 GB 16 TB

Amount of virtual address space per 32-bit process

2GB (3GB with /Largeadressaware)

2GB (4GB with /Largeadressaware)

Amount of virtual address space for the 64-bit processes NA 8 TB

Amount of paged pool memory 540 MB 128 GB

Amount of non-paged pool memory

256 MB (128 MB w /3GB) 128 GB

Size of system cache 1 GB 1 TB

Comparing Memory & Address SpaceProcess Address Space

32-bit (2 GB/3GB)

64-bit (8 TB) – both x64 and Itanium

x64 Bit Architecture AdvantagesMemory

Direct (flat) addressing significantly reduces the driver development complexity (no need to deal with above 4GB memory issues)Native 64-bit applications have 8 TB of directly addressable Virtual Address Space4GT enabled applications can take advantage of the full 4GB address space and do not have to share memory with OS (no boot.ini switches required)Increase in memory space contributes to large I/O caches

x64 Bit Architecture AdvantagesScalability

x64 architecture uses twice as many general-purpose registers, each a full 64bits wide, and doubles the number of 128-bit wide SSE/SSE2 (Streaming Single Instruction-Stream…) registers to 16. Better multiprocessing scalability (support up to 64 processors)

x64 Bit Architecture AdvantagesSecurity

Kernel Patch Protection (Patch Guard) - Microsoft Windows Server 2003 SP1 and later versions of Windows for x64-based systems do not allow the kernel to be patched except through authorized Microsoft-originated hotfixes – assists in fighting rootkits.Windows Vista x64 and Windows Server 2008 require driver signing by manufacturersData Execution Prevention (DEP) is always enabled for 64bit applications even if /noexecute=OptOut policy level is specified

32-bit Applications on x64Advantages

Executed in WOW64 environmentNative hardware emulationPerformance similar to x86

Take advantage of flat memory model and have full access to 4GB VAS.Benefit from increased I/O capabilities of x64 platformPAE enabled applications can take advantage of memory above 4GB without any special boot.ini switches

32-bit Applications on x64Limitations

Listed in http://support.microsoft.com/kb/282423No Mixed 64-Bit/32-Bit Processes• 64-bit programs cannot load and call 32-bit MDAC. • 64-bit Microsoft Internet Explorer cannot load 32-bit ActiveX controls. • The 64-bit shell cannot load 32-bit Inproc shell extensions. • 32-bit installer programs cannot load and register 64-bit DLLs.No 16-Bit Code• No 16-bit code can run, except for recognized InstallShield and Acme installers (these are hard-coded in Wow64 to allow them to work). • 16-bit Setup bootstraps are not supported. • 16-bit MS-DOS and Microsoft Windows 3.x utilities will not start.No Kernel-Mode 32-Bit CodeThere is no support for Kernel-mode or 32-bit code such as: • 32-bit virus-detection or 32-bit file system filters. • 32-bit video adapter or 32-bit network adapter drivers. • 32-bit Kernel-mode printer driversCcccNo OS/2 or Posix Program SupportThere is no support for OS/2 or Posix programsHigh bit pointer usage in some older applications – developers never expected full 4GB availability and used higher bits in pointers to store additional information:http://blogs.msdn.com/slavao/archive/2006/03/12/550096.aspx

32-bit Applications on x64Limitations

Is generally not recommended for server applicationsCan present interoperability issues:

IIS – documented in http://technet2.microsoft.com/windowsserver/en/library/ee52acd2-84e0-417c-92b3-80b1cb3848281033.mspx?mfr=true

On 64-bit Windows, 32-bit processes cannot load 64-bit DLLs, and 64-bit processes cannot load 32-bit DLLsMust configure IIS to create 32-bit worker processes.

SCOM 2007 64-bit Agents cannot use 32-bit performance counters (SCCM 2007)

Windows 32bit vs 64bit Comparison

- Comparative Study: Microsoft Update Downloads

64-bit Hardware running 32bit vs 64bit Windows

Windows Server 2003 Enterprise Edition SP1

Windows Server 2003 Enterprise x64 Edition

Mbits/Sec Avg 784 Mbits/Sec Avg 976

Concurrent Connections Avg 15,746 Concurrent Connections Avg 13,600

Get Req/Sec Avg 2,000 Get Req/Sec Avg 3,400

Get Req/Sec Max 2,200 Get Req/Sec Max 6,800

CPU Avg 32% CPU Avg 60%

Application Process (VM Usage)

2GBApplication Process (VM

Usage)3.2GB

HTTP 500 Errors 2% HTTP 500 Errors 0%

– Stress generated by live HTTP traffic from Windows Update Downloads– 32bit bottlenecked by 2GB VM limit vs 4GB capabilities on 64bit– Improved compute times on 64bit increased Req/Sec while lowering Concurrent

Connections(Improved HTTP Request Processing Times)

17

Windows 64bit Analysis - Comparative Study: www.Microsoft.com Perf

Test Case: 64-bit Hardware running 64bit Windows

Windows Server 2003 Enterprise x64 Edition Results

Concurrent Connections Avg 11,697

Connection Attempts/Sec Avg 430

Connection Attempts/Sec Max 577

Get Req/Sec Avg 778

Get Req/Sec Max 956

CPU Avg 96%

– Stress generated by live HTTP traffic on www.Microsoft.com – 32bit bottlenecked by 2GB VM limit vs 4GB capabilities on 64bit– Improved compute times on 64bit increased Req/Sec while lowering Concurrent

Connections– (Improved HTTP Request Processing Times)

18

32-bit App Compatibility in WOW64

Folder redirection ensures separation of 32-bit program and system filesTypically a non-issue for 32-bit applications, as completely handled by WOW64

The two different Program Files directories are only meant to keep 32-bit and 64-bit application binaries apart; 32-bit binaries don't have to be stored in the "Program Files (x86)" folder

32-bit App Compatibility in WOW64

Registry redirection separates the "Software" node of 32-bit apps in the Windows Registry

Again, typically a non-issue for 32-bit applications, as completely handled by WOW64Registry keys for 32-bit and 64-bit versions ofsame application can co-exist

20

32-bit vs. 64-bit App Performance

64-bit doesn't make everything faster! However, when your app has memory constraints, the performance gains quickly become apparentExample 1: .NET Web-Applications (CachePerf testapp)

1,000 Unique Searches 10,000with Windows

.NET 2.0

Source: http://msdn.microsoft.com/vstudio/java/compare/benchmark64/default.aspx

Worker-Process: 32-bit 64-bit 32-bit 64-bit

32-bit vs. 64-bit App Performance

Example 2: AD Performance – need to understand caching limits…

AD Caching Limitations: Performance heavily depends on how much of the AD database the LSASS process (AD) can cache in memory…

Operating System of DC standard LSASS cache (max)

with /3GB Boot.ini switch

Windows 2000 (32-bit)* 0.5 GB 1 GB

Windows 2003/8 (32-bit)

1.5 GB 2.6 GB

Windows 2003/8 x64 8 TB N/A* /3GB switch only available in Advanced Server Edition

32-bit vs. 64-bit App Performance

Example 2: LDAP queries against Active Directory DCs running on 32-bit Windows vs. 64-bit Windows with AD DIT at 10 GB (can't be cached on the x86 32-bit DC)

x64 System: 2 x 2.2 GHz AMD Opteron, 14 GB RAMx86 System: 2 x 2.4 GHz Xeon, 4 GB RAM

System

Avg query time Avg entries touched

Avg entries / sec

x64 25,422 ms 1,039,281 41,186

x86 *300,016 ms 374,692 1,249

x64 8,224 ms 213,336 25,941

x86 59,951 ms 213,336 3,560

Query1: touches as many objects as possible (1 Million)

Query2: touches approx. 200k objects

* Query on x86 32-bit DC exceeded LDAP policy limit for query duration (300 ms)

32-bit vs. 64-bit Memory Requirements

Beware that to leverage the 64-bit benefit you also need to add more physical memory to your server…

WS2008 64-bit Server with 4GB physical memory requires more memory for the OS than an equivalent 32-bit Server

WS2008 Ent. x64, 4GB WS2008 Ent. x86, 4GB

Base OS (no roles

or features)

Special Use-Case: Server Virtualization

General Benefit of 64bit for Virtualization:Larger kernel address space allows better scaling to support more VMs per server, allowing a higher degree of consolidationMore virtual address space per VM allows increased performance for VMs themselves

Deployment Scenarios for 64-bit WindowsApplication or

Service Benefit of 64-bit computing

SQL Database Server Allows large databases to be fully cached in memory, dramatically improving SQL query performance.

Active Directory Domain Controller

The increased virtual address space allows large AD databases to be fully cached into memory, dramatically improving LDAP query performance

IIS Web Server

Increases the number of application pools per web-servers and the virtual address space available per application pool. Results in better performance and better mean time between application and Web service recycling, thereby increasing overall website availability.

SharePoint Portal Server

SharePoint heavily relies on IIS and thus gains similar benefits when hosted on a 64-bit OS.

Terminal Server More virtual kernel address space for the OS gives the ability to handle many more users per Terminal Server.

Exchange Server

More addressable memory reduces the problem with fragmentation of virtual memory and allows the Exchange Store to cache more mailbox data per user. This results in fewer I/O operations to disk which significantly increases performance.

Virtual Server / Hyper-V

Larger kernel address space allows better scaling to support more VMs per server, allowing a higher degree of consolidation. More virtual address space per VM allows increased performance for VMs themselves.