[jcifs] Want to group up the file copying perfromance

Michael B Allen ioplex at gmail.com
Mon Sep 30 23:58:23 MDT 2013


On Fri, Sep 13, 2013 at 8:12 AM, yatin.baraiya <baraiya.yatin at gmail.com> wrote:
> Hi all
>
>  right now i am using the jcifs-1.3.17.jar for the copying the files to
> windows server machine,
> i had trying the approx. 1gb size file copying to remote file Repository
> [which is windows server],
>
> while i am using java  for the the file copying, i am using the bufferszie
> of the byte is :16384 kb,
> it takes the 3 minute and 35 seconds approx to copying it.
>
> Then i had think that Suppose i increase the bufferszie , i had double to
> previous one : 32768....then it  should to takes the less time to copying
> it,
> but unless it decrease my file copying  performance , now it takes the 4
> minute to copying the my file.
>
> Then i had try to manually copying the 1 gb files to remote file Repository
> ..it just takes the 1 minute  and 30 seconds only.
>
> then why it takes too much time with the java.?

Hi Yatin,

Get a packet capture using Netcap.exe and look at it with WireShark
and verify that the client is quickly locating and authenticating with
the target server. It is not uncommon to experience name service and
DFS problems that cause significant delays on startup or even during
writes.

Otherwise, JCIFS will be a little slower than Windows' native client
just because Java is running in the application layer whereas the
Windows client is running in the OS kernel.

You probably should not try changing the buffer sizes. Buffers are
themselves buffered by the OS networking socket layer as packet frames
which also have a size. Ideally, the JCIFS buffer size is such that
each network frame is fully utilized. But if you increase the JCIFS
buffer by too much, JCIFS will write a full frame and then a very
small frame, full frame, small frame, full frame, small frame, .....
In this case, half of the frames will be highly under-utilized and
thus JCIFS will waste a lot of time waiting for acknowledgment of
writes of only a few bytes.

If you study the network frame utilization using WireShark, you can
determine the optimal buffer size for the particular client and server
networking environment. But this is not recommended because if the
negotiated network packet frame size decreases for any reason,
performance will suffer as described above.

Generally, you should not set any JCIFS properties at all. There are
only very few obscure instances where JCIFS properties should be set.
And in almost all instances setting a property is only necessary to
work around a problem like an invalid nameservice or DFS environment.

Mike

-- 
Michael B Allen
Java Active Directory Integration
http://www.ioplex.com/


More information about the jCIFS mailing list