[linux-cifs-client] smbclient faster than cifs

Steve French smfltc at us.ibm.com
Wed Dec 8 18:32:50 GMT 2004


> What can I look at to help bring cifs to smbclient performance?

Quick and dirty change that should at least double or triple perf of the
cifs client: 

a) change CIFS_MAX_MSGSIZE in cifspdu.h to (63*1024) and recompile and
install cifs.ko
b) add (or change) the max xmit parm server's smb.conf to be bigger
(e.g. 64000) than the default (which is 16K).  If the server is windows
there is a similar way to do this IIRC but I forget how.
c) make sure to mount with the direct option (probably best to specify
it as "forcedirectio" (a synonym for the same flag) rather than "direct"
since there was a conflict in early versions of the patch with the
parsing for the dir_mode flag) ie 
	mount -t cifs //server/share /mnt -o user=xxxx,forcedirectio
d) make sure your client app is issuing large reads (256K or more would
be fine)


Longer term three changes are needed to the client (and probably some
changes to the Samba server too) to achieve optimal speed (in order by
ease of implemention)

1) increase the write sizes (especially important for gigabit).  cifs
currently will use a write size of one page 4K, readsize of 4 pages 16K
(server can negotiate less) unless direct is used in which case it can
go larger (the workaround above gets much of this benefit)

2) reduce the memcopies on the client - e.g. cifs client currently
copies twice in the writepage path which is inefficient

3) get more reads and writes on the same inode going in parallel over
the wire.  We really need a cifs_async_writepages implementation (anyone
want to try their hand at a patch?) somewhat like what JazzyJames tried
with cifs_readpages

I don't see any particular reason why smbclient would be faster once we
are doing the above.

Most of the hits to the code would be in cifs_readpages and a new
cifs_writepages routine (currently cifs only implements cifs_writepage
not cifs_writepages).  They are a few more changes needed to
CIFSSMBWrite and the new CIFSSendRcv but this is progressing a little at
a time inside the CONFIG_CIFS_EXPERIMENTAL ifdefs

Let me know if the quick solution mentioned above helped (and how much).

Thanks.



More information about the linux-cifs-client mailing list