Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
HOWTO: Large File Copies over CIFS
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Documentation, Tips & Tricks
View previous topic :: View next topic  
Author Message
UberPinguin
Guru
Guru


Joined: 20 Nov 2005
Posts: 510
Location: 2416.94 Miles From Home

PostPosted: Thu Sep 27, 2007 2:55 am    Post subject: HOWTO: Large File Copies over CIFS Reply with quote

I work in a Windows Active Directory environment. Because of that, I deal with CIFS shares on a daily basis, and frequently have to copy very large files over the network (think hard drive backups in excess of 40 GB). If you've ever attempted this from a *nix box to a CIFS volume mounted with
Code:
# mount -o domain=somedomain,user=auser //windontserver/share /mnt/remote
you'll know that, partway through the copy, progress will slow to a crawl and eventually stop, with no errors reported. This is frustrating, to say the least. I have lost many hours of work to this situation.
Sifting through the mount(8) and mount.cifs(8) man pages, I came across the following:
mount.cifs(8):
directio
  Do  not  do inode data caching on files opened on this mount. This precludes mmaping files on this mount. In
  some cases with fast networks and little or no caching benefits on the client (e.g. when the application  is
  doing  large sequential reads bigger than page size without rereading the same data) this can provide better
  performance than the default behavior which caches reads (readahead) and writes  (writebehind)  through  the
  local  Linux  client  pagecache if oplock (caching token) is granted and held. Note that direct allows write
  operations larger than page size to be sent to the server. On some kernels this requires the cifs.ko  module
  to be built with the CIFS_EXPERIMENTAL configure option.
So, by changing the previous mount command to
Code:
# mount -o domain=somedomain,user=auser,directio //windontserver/share /mnt/remote
I gain improved performance for sequential read/writes. A brief test copying a 3.7GB bzipped tar file gave a consistent throughput of about 13-15 MB/s over a full-duplex 100Mb ethernet link from my laptop to the Windows 2003 server.
_________________
aidanjt wrote:
You see, instead of arguing from ignorance, and fear, there is only one way to verify a theory. And that's not by clutching a black book and begging the sky fairy for deliverance from the mad scientists and their big machines.
Back to top
View user's profile Send private message
likewhoa
l33t
l33t


Joined: 04 Oct 2006
Posts: 778
Location: Brooklyn, New York

PostPosted: Thu Sep 27, 2007 2:29 pm    Post subject: Reply with quote

BOOKMARKED. thanks UberPinguin.
Back to top
View user's profile Send private message
daschapa
Tux's lil' helper
Tux's lil' helper


Joined: 01 Sep 2006
Posts: 80

PostPosted: Fri Sep 28, 2007 1:29 am    Post subject: Reply with quote

You'll be saving many lives with this post. Thanx very much.
(Very much appreciated).your
_________________
======================
Back to top
View user's profile Send private message
niceness
Tux's lil' helper
Tux's lil' helper


Joined: 02 May 2006
Posts: 86
Location: NS, Serbia

PostPosted: Fri Sep 28, 2007 10:09 am    Post subject: Reply with quote

This is one of the most useful tips I have come across in a long time.
Thanks :D
Back to top
View user's profile Send private message
UberPinguin
Guru
Guru


Joined: 20 Nov 2005
Posts: 510
Location: 2416.94 Miles From Home

PostPosted: Tue Oct 02, 2007 4:09 pm    Post subject: Reply with quote

No problem, glad I could help :D
_________________
aidanjt wrote:
You see, instead of arguing from ignorance, and fear, there is only one way to verify a theory. And that's not by clutching a black book and begging the sky fairy for deliverance from the mad scientists and their big machines.
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Documentation, Tips & Tricks All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum