[jcifs] Speed please..

Christopher R. Hertel crh at ubiqx.mn.org
Tue Oct 3 16:12:03 GMT 2006


Patrick,

Mike will have the real-world answers; I'm mostly the theory guy.  What I
can add to this discussion, however, is provide some background based on
some work I've done on CIFS over WAN links.

There are a few key factors that limit CIFS I/O speed over WAN links.  The
one that is probably impacting you is that CIFS is basically a
request/response protocol.  The client sends a request, and the server
processes the request and sends a response.  Because of this highly serial
behavior, CIFS is very sensitive to network latency and jitter.

I'd suggest grabbing two packet captures, transferring the same file via the
local LAN and via the I'net.  Compare the size of the I/O messages and the
round trip times of each client request.  My *guess* is:

- The round-trip times will be much longer for the Internet messages.
- The message sizes will be the same (since jCIFS is nicely consistent).

Let us know what you find.  I'd be surprised and interested if my guesses
are wrong... but it won't be the first time.  :)

Chris -)-----

Patrick Cerri wrote:
> 
> Hi Mike,
>  
> Just downloaded latest version and Socket Bind issue resolved.. cool.
>  
> Please can you now help me find out why the most I can download of an
> online samba server is 1Mbps - 3Mbps ?
>  
> On the internal work network I get ridiculously fast speeds using JCIFS,
> it's only when going over the internet.
>  
> It's basically 10% of the overall speed of the line..
>  
> I have played with the settings at both the client and server ends.
>  
> I have setup an example - the username and password are valid for now...
>  
> You can test this file - its 10MB.
>  
> The most I can get is 3.2 Mbps, but my actual connection is 24Mbps...
>  
> I can download at those speeds over HTTP on the same server.
>  
> public static void main( String[] argv ) {
>         try {
>             SmbFile sb                  = new
> SmbFile("smb://yoyo:yoyoyoyo@88.208.201.61/homes/home/wrong.mov");
>             SmbFileInputStream in = new SmbFileInputStream(sb);
> 
>             int c;
>             long counter = 0;
>             byte[] buf = new byte[16384];
>             long timenow = System.currentTimeMillis();
>             while ((c = in.read(buf)) > 0){
>                 counter     += c;
>                 long time   = System.currentTimeMillis()+1;
>                 int tsecs   = (int)(time - timenow) / 1000;
>                 float speed = ((float)counter / 100000) / tsecs;
>                 System.out.println("Read : "+counter+" in "+tsecs+" secs
> @ ~"+speed+" Mbps");
>             }
>         } catch (MalformedURLException ex) {
>             ex.printStackTrace();
>         } catch (SmbException ex) {
>             ex.printStackTrace();
>         } catch (UnknownHostException ex) {
>             ex.printStackTrace();
>         } catch (IOException ex) {
>             ex.printStackTrace();
>         }  
>     }
>  
>  
> Please - any help appreciated.
>  
> paddy.
>  
>  
>  
>  

-- 
"Implementing CIFS - the Common Internet FileSystem" ISBN: 013047116X
Samba Team -- http://www.samba.org/     -)-----   Christopher R. Hertel
jCIFS Team -- http://jcifs.samba.org/   -)-----   ubiqx development, uninq.
ubiqx Team -- http://www.ubiqx.org/     -)-----   crh at ubiqx.mn.org
OnLineBook -- http://ubiqx.org/cifs/    -)-----   crh at ubiqx.org


More information about the jcifs mailing list