[ 
https://issues.apache.org/jira/browse/SSHD-742?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15981406#comment-15981406
 ] 

Goldstein Lyor commented on SSHD-742:
-------------------------------------

Before we can answer this rather general issue there are several key issues 
that need to be clarified:

{quote}
Is there any way I can improve the performance?
{quote}
Any specific part of SSHD ? The _Java Flight Recorder_ report you mention seems 
to be related to the shell, but SSH is much more than that - e.g., command 
channel, SFTP, SCP. Is there a particular area of performance you are 
interested in ?

{quote}
the throughput was particularly low - 2400 requests per second
{quote}
Please be specific - what are these "requests" you measure ? What cipher are 
you using ? Are you using compression ?

{quote}
The documentation is kinda sparse
{quote}
It is actually quite detailed - perhaps is lacks emphasis on what interests you 
- if so, please specify what is missing so we can complete it. In any case, 
there are many (many, many.,..) configuration parameters that can be used to 
tweak the performance, but unless a specific performance metric and/or target 
use-case is indicated it is difficult to advise on which parameters to 
concentrate and how to tweak them.

{quote}
 I was quite disappointed because the throughput was particularly low
{quote}
"Low" compared to what benchmark ? What exact environment were you using - O/S, 
Heap memory size, GC configuration, concurrent NIO threads, which I/O factory ? 
etc., etc.. 

I have reviewed the code and there are many issues that adversely affect 
performance in the way the server/client are set-up - here are jst a few
{code:java|title=Server}
ExecutorService threadPool = Executors.newSingleThreadExecutor(); // used to 
run commands but only one at a time
server.setNioWorkers(1);   // severly limits throughput

// Exit callback not propagated to the MessageReceiver and thus channel is not 
closed as it should be - clearly documented as a requirement: "Once the command 
is done, it should call the ExitCallback#onExit method to indicate that it has 
finished"
@Override
public void start(Environment environment) {
        threadPool.submit(new MessageReceiver(input, output, MESSAGE_SEPARATOR, 
payload));
}
{code}
{code:java|title=Client}
// Should be inside a try-with-resource block
ClientChannel channel = session.createChannel(Channel.CHANNEL_SUBSYSTEM, 
"messaging");

channel.open();   // not the proper way to open a channel
{code}

> Are there any ways to improve performance?
> ------------------------------------------
>
>                 Key: SSHD-742
>                 URL: https://issues.apache.org/jira/browse/SSHD-742
>             Project: MINA SSHD
>          Issue Type: Question
>    Affects Versions: 1.4.0
>         Environment: https://github.com/maseev/sshd-echo
>            Reporter: Miron Aseev
>            Priority: Minor
>
> I created a simple client-server application (see the environment section) 
> that uses MINA SSHD library, just to test the performance. I was quite 
> disappointed because the throughput was particularly low - 2400 requests per 
> second on average on localhost.
> According to Java Flight Recorder, the application spends most of its time in 
> ChannelPipedInputStream/ChannelPipedOutputStream on different monitor objects.
> Is there any way I can improve the performance? The documentation is kinda 
> sparse and doesn't mention any tuning suggestions. Maybe I can avoid using 
> these piped streams somehow or set some parameters related to the transport 
> layer?
> All suggestions are greatly appreciated.



--
This message was sent by Atlassian JIRA
(v6.3.15#6346)

Reply via email to