The Samba-Bugzilla – Bug 4433
Samba over NFS Performance Problems in case of big files
Last modified: 2007-03-06 05:35:47 UTC
In case of have "Samba over NFS Transfer" with two different servers, big files transfer take a long time (2GB Files estimateted 45 -60 minutes). In case of Samba storing the file directly on a local disk, it takes not more than 7 min. which is a good time. Tested on Linux SusE 10.1 and Solaris 8+10.
I found that the reason for that in the utime() call in smbd/vfs-wrap.c line 620. If I remove this line and put:
int vfswrap_utime(vfs_handle_struct *handle,
const char *path, struct utimbuf *times)
--->> result = 0; /* Thomas Wild - Patched for Smb over NFS */
in, it speeds up 10 times the transfer to 6 minutes for a 2GB.
Watching by sniffer:
snoop rpc nfs
server2-> server1 NFS R WRITE3 OK 16384 (ASYNC)
server1-> server2 NFS C GETATTR3 FH=51C0
server2-> server1 NFS R GETATTR3 OK
server1-> server2 NFS C WRITE3 FH=51C0 at 17006592 for 16384 (FSYNC)
where FSYNC seems to be the problem which caused by utime call!
In my opinion, but I'm not sure, this call is not really necessary. It causes a lot of FSYNC over NFS and delays the transfer dramatically. After I removed this line, the speed increased 10 times without any side effects. So my question is this behavior intended or a bug?
My proposal is to make this function call adjustable in smb.conf or bypass it for NFS?
Thanks in advance.
Re-exporting NFS imported shares is definitely not recommended. You are always free to write your own little vfs module that just overrides this operation.