It may be the case that you are running out of nio2 worker threads, or memory or buffers - trying to transmit so many concurrent files puts a lot of pressure on the memory and I/O. Trying increasing the "nio2-workers" configuration value:
SshClient client = ... PropertyResolverUtils.updateProperty(FactoryManager.NIO_WORKERS, ...your-number-of-workers...); * Same code can be done for server-side * Can also use a -Dorg.apache.sshd.config.nio-workers=...some number... system property when starting the JVM In any case, it might not help as well in view of the massive amount of data you are trying to transmit. I do believe some limitation/throttling mechanism is in order to make sure no more than X concurrent files are transmitted. ================== Hi Team,I'm trying to upload the multiple files using apache mina sshd. It works fine for less number of files, but when I try to increase the number of files to 100. Then I'm getting the following exception.Please help me here to resolve the below issue.org.apache.sshd.common.channel.exception.SshChannelClosedException: write(ChannelOutputStream[ChannelExec[id=221, recipient=2]-ClientSessionImpl[david@/192.168.33.23:22]] SSH_MSG_CHANNEL_DATA) len=8192 - channel already closed at org.apache.sshd.common.channel.ChannelOutputStream.write(ChannelOutputStream.java:110) at org.apache.sshd.common.util.io.IoUtils.copy(IoUtils.java:128) at org.apache.sshd.common.scp.ScpHelper.sendStream(ScpHelper.java:552) at org.apache.sshd.common.scp.ScpHelper.sendFile(ScpHelper.java:483) at org.apache.sshd.common.scp.ScpHelper.send(ScpHelper.java:442) at org.apache.sshd.common.scp.ScpHelper.send(ScpHelper.java:420) at org.apache.sshd.client.scp.AbstractScpClient.lambda$upload$0(AbstractScpClient.java:151) at org.apache.sshd.client.scp.DefaultScpClient.runUpload(DefaultScpClient.java:142) at org.apache.sshd.client.scp.AbstractScpClient.upload(AbstractScpClient.java:150) at org.apache.sshd.client.scp.ScpClient.upload(ScpClient.java:108) at org.apache.sshd.client.scp.ScpClient.upload(ScpClient.java:104) at org.apache.sshd.UploadFile.call(UploadFile.java:18) at java.util.concurrent.FutureTask.run(Unknown Source) at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source) at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source) at java.lang.Thread.run(Unknown Source)ThanksSeshkrishna