[
https://issues.apache.org/jira/browse/SSHD-812?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16416761#comment-16416761
]
Goldstein Lyor edited comment on SSHD-812 at 3/28/18 3:51 AM:
--------------------------------------------------------------
You raise an interesting issue - I have not considered relying on the _id_ - it
may be done, provided the thread that issues the requests and the one that
processes the responses are coordinated, and somehow the response handler
orders and dispatches the replies according to the _id_ field. Not the best
idea, but I guess it is possible.
As far as making the {{SftpSUbsystem}} multi-threaded - that's a more complex
issue (see below) that I am not sure we want to get into it (we need to
consider whether the ROI is worth the effort). I am re-opening the issue as a
possible future enhancement though.
was (Author: lgoldstein):
You raise an interesting issue - I have not considered relying on the _id_ - it
may be done, provided the thread that issues the requests and the one that
processes the responses are coordinated, and somehow the response handler
orders and dispatches the replies according to the _id_ field. Not the best
idea, but I guess it is possible. As far as asynchronous processing on the
server side - AFAIK it is happening already because we are using asynchronous
I/O (unless your server is set up differently). In any case, the default number
of NIO workers is
{code:java}
int DEFAULT_NIO_WORKERS = Runtime.getRuntime().availableProcessors() + 1
{code}
You can increase them (not too much though) by setting the
{code:java}
/**
* Number of NIO worker threads to use.
* @see #DEFAULT_NIO_WORKERS
*/
String NIO_WORKERS = "nio-workers";
{code}
property on the SSH server before starting it
{code:java}
PropertyResolverUtils.updateProperty(server, FactoryManager.NIO_WORKERS ...my
number...)
{code}
As far as making the {{SftpSUbsystem}} multi-threaded (it is already
asynchronous since it is being invoked by the NIO worker threads) - that's a
more complex issue that I am not sure we want to get into it (we need to
consider whether the ROI is worth the effort). I am re-opening the issue as a
possible future enhancement though.
> support asynchronization mode for sftp subsystem
> ------------------------------------------------
>
> Key: SSHD-812
> URL: https://issues.apache.org/jira/browse/SSHD-812
> Project: MINA SSHD
> Issue Type: New Feature
> Affects Versions: 1.7.0
> Environment: java1.8, linux
> Reporter: Zhenliang Su
> Assignee: Goldstein Lyor
> Priority: Minor
> Labels: asynchronous, sftp
> Attachments: Main.java, doRead.png
>
>
> I used SSHD as a middleman between client and target sftp server.
> I found that, when filezilla client directly connect to the target sftp
> server, it transfers fast. When filezilla client connect to the middleman, it
> transfers slow.
> I analyzed the source code of
> org.apache.sshd.server.subsystem.sftp.SftpSubsystem#doRead, and I found it
> behaves like block mode, and client's other SSH_FXP_READ request blocked in
> the same thread.
>
> my middleman code:
> [^Main.java]
>
--
This message was sent by Atlassian JIRA
(v7.6.3#76005)