[jcifs] Re: jCIFS throughput: what to expect?

Michael B Allen ioplex at gmail.com
Wed Jun 18 16:34:23 GMT 2008


On 6/18/08, Laurent Millet <laurent.millet at airbus.com> wrote:
> Laurent Millet <laurent.millet <at> airbus.com> writes:
>  > > I would play with the snd_buf_size and rcv_buf_size properties maybe
>  > > (see the Overview page of the API documentation). To find the optimal
>  > > values you would have to look at a capture and verify that the
>  > > SMB_COM_{READ,WRITE}_ANDX packets are actually carrying full payloads
>  > > (as opposed to every other packet having a fragment which would
>  > > definitely kill performance).
>  >
>  > If the buffer size used to read data in Java code is big enough compared to
>  > [snd|rcv]_buf_size, I assume most payloads will be full and the last one a
>  > fragment. Is this correct?
>  > Anyway, I will check the packets on the wire.
>
>
> Hello,
>
>  For those of you that are interested, I've checked packets on the network. The
>  buffer size I use has an influence on the CIFS packets that are generated
>  (packet size is more or less capped by the snd_buf_size/rcv_buf_size value; the
>  value is not exactly the same, there seems to be some protocol overhead that
>  needs to be taken into account -- I haven't analyzed it further).
>
>  When the READ_ANDX/WRITE_ANDX packet is big enough, the TCP packet gets
>  fragmented. You can tweak the snd_buf_size/rcv_buf_size and java buffer size
>  values so that all fragments are full (up to MTU). However this is significant
>  only if the overall CIFS packet size is small. If you specify a buffer size that
>  is big enough, then the last fragment will not be a full TCP packet but as this
>  occurs only once in a while, overall throughput it still pretty good and
>  tweaking does not get you much further.
>
>  Hope this is clear enough :-)

Note that I think experiences can vary quite a bit depending on the
network. Obviously you want to prevent buffer fragmentation but you
might get different results depending on how big those buffers are.
The only way to really maximize throughput is to play with
snd_buf_size/rcv_buf_size, jcifs.smb.client.tcpNoDelay, and adjust
things as necessary to minimize buffer fragmentation (by looking at
wireshark).

Mike

-- 
Michael B Allen
PHP Active Directory SPNEGO SSO
http://www.ioplex.com/


More information about the jcifs mailing list