[jcifs] Copy large size file takes longer time

vittal mvittalreddy at gmail.com
Tue Nov 3 22:23:11 UTC 2015


If we map source drive (\\xxx.xx.xx.xx\abcd95\D\NJ$) from target machine
(aaaaaa.bbb.ccc), using window copy option transfer is quick 160MB takes 3
sec. Whereas this functionality we are doing from code implemented using
JAVA API with SAMBA protocol (jcifs-1.3.17.jar) takes longer time. This
implementation been working fine 8+ years, no change in implementation,
since recently performance degraded, transfer take 40+ minutes, sometime
transfer fails. Is it some would have changed on samba
server/configuration?, please advise.

On Mon, Nov 2, 2015 at 9:10 PM, vittal <mvittalreddy at gmail.com> wrote:

> Hi All,
> I would like to have advice on multiple issues, code snippet java code.
>
> void test(){
> SmbFile sFile = null;
> NtlmPasswordAuthentication auth = new
> NtlmPasswordAuthentication(activeUserDomain, activeUserID, activePwd);
> sFile = new SmbFile("smb:"+absoluteFilePath.replaceAll("\\\\", "/"), auth);
>
> File inFile = new File(tempZipDir,zipFileName);
> inFile.createNewFile();
> DataOutputStream outZ = new DataOutputStream(new FileOutputStream(inFile));
> InputStream inZ = sFile.getInputStream();
> copyStreams(inZ,outZ);
> }
>
> private static final void copyStreams ( InputStream in, OutputStream out )
> throws IOException
>     {
>      byte [  ]  buffer = new byte[1024];
>      int len;
>
>
>      while (  ( len = in.read(buffer)) >= 0 )  {
>        out.write( buffer, 0, len ) ;
>      }
>
>      in.close() ;
>      out.close() ;
>     }
>
> 1. Above snippet of code setup locally, worked for sometime, once I got
> connection time error, since than always  throws  below exception, similar
> behavior in my secondary machine as well, please advice, what might causing?
>
> java.net.ConnectException: Connection timed out: connect
>  at java.net.DualStackPlainSocketImpl.connect0(Native Method)
>  at
> java.net.DualStackPlainSocketImpl.socketConnect(DualStackPlainSocketImpl.java:79)
>  at
> java.net.AbstractPlainSocketImpl.doConnect(AbstractPlainSocketImpl.java:339)
>  at
> java.net.AbstractPlainSocketImpl.connectToAddress(AbstractPlainSocketImpl.java:200)
>  at
> java.net.AbstractPlainSocketImpl.connect(AbstractPlainSocketImpl.java:182)
>  at java.net.PlainSocketImpl.connect(PlainSocketImpl.java:172)
>  at java.net.SocksSocketImpl.connect(SocksSocketImpl.java:392)
>  at java.net.Socket.connect(Socket.java:579)
>  at java.net.Socket.connect(Socket.java:528)
>  at java.net.Socket.<init>(Socket.java:425)
>  at java.net.Socket.<init>(Socket.java:208)
>  at jcifs.smb.SmbTransport.ssn139(SmbTransport.java:226)
>  at jcifs.smb.SmbTransport.negotiate(SmbTransport.java:288)
>  at jcifs.smb.SmbTransport.doConnect(SmbTransport.java:353)
>  at jcifs.util.transport.Transport.run(Transport.java:240)
>  at java.lang.Thread.run(Thread.java:745
>
> 2. I am very new to smb implementation, I am trying to trouble shoot
> performance issue on existing implementation, same code have been working
> for years i.e. to copy zip file(3KB to 800MB) from samba server to
> appserver but since recent time copy function takes long time for a give
> file, please advice what might cause?
>
>
> --
> Regards
> ---------------------------------------
> Vittal
>



-- 
Regards
---------------------------------------
M.Vittal Reddy
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.samba.org/pipermail/jcifs/attachments/20151103/8cc67155/attachment.html>


More information about the jCIFS mailing list