Jeremy Allison
2023-Aug-18 17:24 UTC
[Samba] Increase data length for SMB2 write and read requests for Windows 10 clients
On Fri, Aug 18, 2023 at 04:25:28PM +0000, Jones Syue ??? wrote:>Hello Ivan, > >'FastCopy' has an option to revise max I/O size and works for SMB :) >it is a tool for file transferring and could be installed to win10, >download here: https://fastcopy.jp/ > >This is an example for writing, a job would write a file named '1GB.img' >from a local disk 'H:' to a remote SMB mounted net disk 'Z:', >open 'FastCopy' tool and specify several options like: >1. specify 'Source': H:\1GB.img >2. specify 'DestDir': Z:\ >3. go to Option > Main Settings > I/O Setting > I/O unit (MB), >the default value is '1' and changes it to '8'. >4. click button 'Execute' to start file transferring. > >Then we could see logs said that write size is 8MB (8388608): >[2023/08/18 23:32:02.418926, 3] ../../source3/smbd/smb2_write.c:219(smb2_write_complete_internal) > smb2: fnum 4162336292, file 1GB.img, length=8388608 offset=226492416 wrote=8388608 >And wireshark said that write size is 8MB (8388608): >SMB2 23414 Write Request Len:8388608 Off:100663296 File: 1GB.img > >Another example for reading, just switch the disk letter between Source >and DestDir: >1. specify 'Source': Z:\1GB.img >2. specify 'DestDir': H:\ >3. click button 'Execute' to start file transferring. > >And wireshark said that read size is 8MB (8388608): >SMB2 171 Read Request Len:8388608 Off:260046848 File: 1GB.imgOH - that's *really* interesting ! I wonder how it is changing the SMB3+ redirector to do this ?
Jones Syue 薛懷宗
2023-Aug-21 09:53 UTC
[Samba] Increase data length for SMB2 write and read requests for Windows 10 clients
Hello Jeremy,> OH - that's *really* interesting ! I wonder how it is > changing the SMB3+ redirector to do this ?It looks like applications could do something and give a hint to SMB3+ redirector, so far not quite sure how to make it, per process monitor (procmon) could show that write I/O size seems could be pass from the application layers, (https://learn.microsoft.com/en-us/sysinternals/downloads/procmon) this is a example for writing, using applications (Fastcopy.exe, explorer.exe, and robocopy.exe) to transfer a file named '1GB.img' from local disk 'H:' to remote SMB mount disk 'Z', and monitor them with procmon: 1. FastCopy (FastCopy.exe), 8MB (need to revise FastCopy default setup) Process Name Operation Path Detail System TCP Send 10.19.7.63:64845 -> 10.19.250.98:445 Length: 8388724, startime: 3459115, endtime: 3459149, seqnum: 0, connid: 0 System TCP Receive 10.19.7.63:64845 -> 10.19.250.98:445 Length: 84, seqnum: 0, connid: 0 FastCopy.exe WriteFile \\10.19.250.98\Public\1GB.img Offset: 92,274,688, Length: 8,388,608, Priority: Normal 2. File Explorer (explorer.exe), 1MB, drag-and-drop files. Process Name Operation Path Detail explorer.exe ReadFile H:\1GB.img Offset: 55,574,528, Length: 1,048,576, Priority: Normal System ReadFile H:\1GB.img Offset: 55,574,528, Length: 1,048,576, I/O Flags: Non-cached, Paging I/O, Priority: Normal System WriteFile \\10.19.250.98\Public\1GB.img Offset: 55,574,528, Length: 1,048,576, Priority: Normal System TCP Send 10.19.7.63:64845 -> 10.19.250.98:445 Length: 1048692, startime: 3545682, endtime: 3545689, seqnum: 0, connid: 0 System TCP Receive 10.19.7.63:64845 -> 10.19.250.98:445 Length: 84, seqnum: 0, connid: 0 3. robocopy (robocopy.exe), 1MB, command 'robocopy.exe h: z: 1GB.img /NP' Process Name Operation Path Detail Robocopy.exe ReadFile H:\1GB.img Offset: 520,093,696, Length: 1,048,576, Priority: Normal System WriteFile \\10.19.250.98\Public\1GB.img Offset: 520,093,696, Length: 1,048,576, Priority: Normal System TCP Send 10.19.7.63:64845 -> 10.19.250.98:445 Length: 1048692, startime: 3618938, endtime: 3618945, seqnum: 0, connid: 0 System TCP Receive 10.19.7.63:64845 -> 10.19.250.98:445 Length: 84, seqnum: 0, connid: 0 Perhaps i could do 'procmon' with other benchmark tool like iometer, get back here later :) Found a video talking about SMB2 redirector and large I/O size, thouhd it is not up-to-date SMB3+ redirector still good to know about related design thoughts in the history: https://learn.microsoft.com/en-us/events/pdc-pdc08/es23 0:15:46 SMB2 Redirector 0:17:13 CopyFile API, 1MB I/O request 0:22:46 Application Guidelines -- Regards, Jones Syue | ??? QNAP Systems, Inc.
Reasonably Related Threads
- Increase data length for SMB2 write and read requests for Windows 10 clients
- Increase data length for SMB2 write and read requests for Windows 10 clients
- Increase data length for SMB2 write and read requests for Windows 10 clients
- Increase data length for SMB2 write and read requests for Windows 10 clients
- Increase data length for SMB2 write and read requests for Windows 10 clients