Difference between revisions of "Server-Side Copy"

(Server-Side copy page)
 
(describe resulting disk/network state)
Line 13: Line 13:
 
[[File:Traditional_copy.png]]  
 
[[File:Traditional_copy.png]]  
 
|
 
|
  * Client issues read requests to server
+
'''Sequence'''
  * Server reads file data off disk
+
# Client issues read requests to server
  * Server sends data to client
+
# Server reads file data off disk
  * Client sends duplicate file data to server
+
# Server sends data to client
  * Server writes duplicate file data to disk
+
# Client sends duplicate file data to server
 +
# Server writes duplicate file data to disk
 +
 
 +
 
 +
'''Result'''
 +
* File data traverses network and disk
 +
* Duplicate file data stored on disk
 
|}
 
|}
  
Line 28: Line 34:
 
[[File:Serverside_copy.png]]  
 
[[File:Serverside_copy.png]]  
 
|
 
|
  * Client issues FSCTL_SRV_COPYCHUNK requests to server
+
'''Sequence'''
  * Server reads file data off disk
+
# Client issues FSCTL_SRV_COPYCHUNK requests to server
  * Server writes duplicate file data to disk
+
# Server reads file data off disk
 +
# Server writes duplicate file data to disk
 +
 
 +
 
 +
'''Result'''
 +
* File data traverses disk only
 +
** Network round trip avoided
 +
* Duplicate file data stored on disk
 
|}
 
|}
  
Line 41: Line 54:
 
[[File:Btrfs_serverside_copy.png]]  
 
[[File:Btrfs_serverside_copy.png]]  
 
|
 
|
  * Client issues FSCTL_SRV_COPYCHUNK requests to server
+
'''Sequence'''
  * Server issues BTRFS_IOC_CLONE_RANGE filesystem ioctl
+
# Client issues FSCTL_SRV_COPYCHUNK requests to server
 +
# Server issues BTRFS_IOC_CLONE_RANGE filesystem ioctl
 +
 
 +
 
 +
'''Result'''
 +
* File data does '''not'' traverse network or disk
 +
** Filesystem meta-data update only
 +
* No duplication of file data
 +
** Source and destination files share the same on disk data extents
 
|}
 
|}

Revision as of 13:30, 13 November 2013

Introduction

Samba 4.1.0 was the first release to ship with support for server-side copy operations via the SMB2 FSCTL_SRV_COPYCHUNK request. Clients making use of server-side copy support, such as Windows Server 2012, can experience considerable performance improvements for file copy operations, as file data need not traverse the network. This feature is enabled by default on the smbd file server.


Traditional File Copy

Prior to Samba 4.1.0, clients traditionally copied files by reading the source file data over the network and writing it back to the server through to the destination file on disk.

Traditional copy.png

Sequence

  1. Client issues read requests to server
  2. Server reads file data off disk
  3. Server sends data to client
  4. Client sends duplicate file data to server
  5. Server writes duplicate file data to disk


Result

  • File data traverses network and disk
  • Duplicate file data stored on disk


Server-Side Copy

With Samba 4.1.0 and later, clients can offload copy operations to the server using Copy-Chunk requests. In processing such a request, the network round-trip is avoided.

Serverside copy.png

Sequence

  1. Client issues FSCTL_SRV_COPYCHUNK requests to server
  2. Server reads file data off disk
  3. Server writes duplicate file data to disk


Result

  • File data traverses disk only
    • Network round trip avoided
  • Duplicate file data stored on disk


Btrfs Enhanced Server-Side Copy

Along with server-side copy support, a Btrfs specific Samba VFS Module was newly added with 4.1.0. This module improves the performance and efficiency of server-side copy operations on Btrfs backed shares, by using the Btrfs clone-range IOCTL.

Btrfs serverside copy.png

Sequence

  1. Client issues FSCTL_SRV_COPYCHUNK requests to server
  2. Server issues BTRFS_IOC_CLONE_RANGE filesystem ioctl


Result

  • File data does 'not traverse network or disk
    • Filesystem meta-data update only
  • No duplication of file data
    • Source and destination files share the same on disk data extents