[jcifs] SmbFileInputStream performance issue

Allen, Michael B (RSCH) Michael_B_Allen at ml.com
Mon Aug 12 08:48:20 EST 2002


That's weird. Try the Get.java example from Win2K and from the Linux
machine to Win2K and others. I just did this with the latest code and I
transferred an 11 MB file in 15 seconds:

[jcifs]$ java -Djcifs.properties=../miallen.prp Get \
       smb://miallen2/pub/mozilla-win32-1.0-talkback.zip
11224769 bytes transfered in 15 seconds at 748Kbytes/sec

Are you doing this on the Internet? Maybe it's a strange MTU thing. You
might try experimenting with the jcifs.smb.client.rcv_buf_size but if you
really* want to see what's happening quickly, run Ethereal on one end with a
filter of "port 137 || port 139" during a transfer and send the pcap to me
personally.

> -----Original Message-----
> From:	andy chernow [SMTP:achernow at yahoo.com]
> Sent:	Sunday, August 11, 2002 6:29 PM
> To:	jcifs at lists.samba.org
> Subject:	[jcifs] SmbFileInputStream performance issue
> 
> I have a problem with the SmbFileInputStream and how
> well it is performing.  I am only able to to grab a
> file from the server, using jCIFS, at ~25-35
> kilobytes/sec.  Here is my setup and then I will list
> my extremly simple code example.  
> 
> I have a RedHat 7.3 server running Samba2.2.5.  The
> server is on a T1 connection which is currently only
> used by me.  I have one user and one share setup for
> accessing the samba server.  Let's say the username is
> 'foo', password is 'bar' and share is 'testshare'.  
> 
> Simple test code.  All tests performed on win2k
> accessing the same samba server!
> 
> import java.io.*;
> import jcifs.smb.*;
> 
> class test
> {
>   static String url =
> "smb://foo:bar@hostname/testshare/file1.75MB.zip";
> 
>    public static void main(String[] args) throws
> Exception
>    {
>       FileOutputStream out = new
> FileOutputStream("file1.75MB.zip");
>       SmbFileInputStream in = new
> SmbFileInputStream(url);
> 
>       // this is copied from jcifs site
>       int n;
>       byte[] buf = new byte[8192];
>       while((n = in.read(buf)) != -1)
>          out.write(buf, 0, n);
>       out.close();
>       in.close();
>    }
> }
> 
> For some reason, the above is always very slow.  
> Cable Modem: ~36 kilobytes/second
> DSL Modem:   ~30 kilobytes/second
> 
> Now, if I map the share 'sharetest' on my Win2k
> machine as a Drive and then do a drag-n-drop of
> file1.75MB through standard windows mechanisms, it
> transfers at:
> Cable Modem: ~140 kilobytes/second
> DSL Modem:   ~130 kilobytes/second
> This test removes the possiblity that the Samba server
> has a poor config.
> 
> Using OpenSSH SCP, both get ~150 kilobytes/second
> Using ProFTPD FTP, both get ~140 kilobytes/second
> Using Apache  HTTP, both are ~125 kilobytes/second
> 
> So why when I use SmbFileInputStream am I seeing such
> a decrease in data transfer performance?  
> 
> I would appreciate any suggestions, I am currently at
> a loss.  Maybe I am missing something very simple.
> 
> Thank you in advance,
> /sLaKr
> 
> 
> __________________________________________________
> Do You Yahoo!?
> HotJobs - Search Thousands of New Jobs
> http://www.hotjobs.com




More information about the jcifs mailing list