ES23: Optimizing Applications For Remote File Access Over WAN.
Download
Report
Transcript ES23: Optimizing Applications For Remote File Access Over WAN.
ES23
Mathew George
Sr. Software Engineer
Microsoft Corporation
Why care about file access over a WAN?
What makes an application WAN unfriendly?
Why should I change my application?
Understanding the network parameters
Connectivity from branch offices to nearest data center, Fall 2007
North
America
Europe
Asia
South
America
Mean
14
33 26
Std dev
28
43 28
Min
1.3
0.9 3.5
Max
155
155 92
Continental Bandwidth (Mb/s)
5.5
7.2
0.5
25
North
America
Mean
Std dev
Min
Max
108
69
20
375
Europe
Asia
109
91
5
372
Continental Latencies (ms)
163
81
20
460
The SMB file I/O stack
Network
Stack
Application
Win32/NT File I/O APIs
SMB Server
Client Cache
Server Cache
SMB
Redirector
Filesystem
Network
Stack
Disk
SMB Client
File Server
Network
Copying a large file
CopyFile
Opening a Word document
Platform Improvements
Network
Stack
Application
Win32/NT File I/O APIs
SMB Server
Server Cache
Client Cache
SMB
Redirector
Filesystem
Network
Stack
Disk
SMB Client
File Server
Network
Platform Improvements
Robocopy throughput comparison
between Windows Server 2003 and
Windows Server 2008 transferring a
4.5 GB file over a 1 Gbps WAN link.
Pull = Copy from server to local disk
Push = Copy from local disk to server
Application Guidelines
ReadFile WriteFile
DeviceIoControl
GetOverlappedResult)
Idle
Utilized
Non-pipelined
Pipelined
The effect of pipelining on network utilization
Application Guidelines
CopyFile
CopyFile
Application guidelines
FlushFileBuffers
Understanding the Windows I/O model
CreateFile
ReadFile, WriteFile, LockFile,
GetFileInformationByHandle, ReadDirectoryChanges
GetFileAttributes
SetFileAttributes, DeleteFile, MoveFile
Understanding caching in the SMB context
Understanding caching in the SMB context
Oplocks
BATCH oplock
Level II oplock
Data caching lost by opening multiple handles
Client
Server
CreateFile( GENERIC_READ | GENERIC_WRITE )
Create completes
ReadFile
ReadFile completes.
Data is cached.
CloseHandle
CreateFile( GENERIC_READ | GENERIC_WRITE )
WriteFile
Close is not sent out on wire.
Cached handle is re-used.
Data is written to cache.
CreateFile( GENERIC_READ )
Cache is destroyed.
Create completes
WriteFile
No more caching !
SMB2 leasing in Windows 7
SMB2 leasing in action
Client
CreateFile( GENERIC_READ | GENERIC_WRITE )
Create completes
ReadFile
ReadFile completes.
Data is cached.
CloseHandle
CreateFile( GENERIC_READ | GENERIC_WRITE )
WriteFile
Close is not sent out on wire.
Cached handle is re-used.
Data is written to cache.
CreateFile( GENERIC_READ )
Create completes
WriteFile
Data is written to cache.
Server
More Windows 7 caching enhancements
Windows 7 BranchCache in action
Windows 7
Server
First access to a
file on the
server pulls
down the file
over the slow
WAN link
(WAN access)
High latency
Low-bandwidth
WAN link
Windows 7 Clients
Second access to
the same file from
another user in the
branch is satisfied
from the peer
(local subnet
access)
Client 1
Client 2
Subsequent access
from the same
client is satisfied
from the
transparent cache
(local machine
access)
Application guidelines for effective caching
Application guidelines for effective caching
Platform Support for Metadata Caching
Application guidelines for metadata access
GetFileAttributes GetFileSize GetFileTime
FindFirstFile FindNextFile
GetFileInformationByHandleEx
GetFileInformationByHandle(Ex) API
GetFileInformationByHandleEx
General considerations
CancelSynchronousIo
CreateFile
CancelIoEx
CopyFile
http://technet.microsoft.com/enus/sysinternals/bb896645.aspx
http://blogs.technet.com/netmon/
Evals & Recordings
www.microsoftpdc.com
© 2008 Microsoft Corporation. All rights reserved. Microsoft, Windows, Windows Vista and other product names are or may be registered trademarks and/or trademarks in the U.S. and/or other countries.
The information herein is for informational purposes only and represents the current view of Microsoft Corporation as of the date of this presentation. 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 provided after the date of this presentation.
MICROSOFT MAKES NO WARRANTIES, EXPRESS, IMPLIED OR STATUTORY, AS TO THE INFORMATION IN THIS PRESENTATION.