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

Miron Aseev commented on SSHD-742:
----------------------------------

{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}

I'm primarily interested in the command channel.

{quote}
Please be specific - what are these "requests" you measure ?
{quote}

A client sends an [XML 
document|https://github.com/maseev/sshd-echo/blob/master/sshd-echo-client/src/main/resources/request.xml]
 to the server, and the server sends an [XML 
response|https://github.com/maseev/sshd-echo/blob/master/sshd-echo-server/src/main/resources/response.xml]
 back to the client. A request is relatively small (around 200 bytes). On the 
other hand, the response might be around 8 to 10 KB.

{quote}
What cipher are you using ? Are you using compression ?
{quote}

Looks like I'm using the default ones that come with a default client and 
server.

{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}

The target use-case is the following: an RPC protocol over SSH. A client sends 
a rather small request (around 200 bytes of data) to a server and waits for a 
response. The server receives a request and sends some response in return 
(around 8 to 10 KB of data).

{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.. 
{quote}

To this [one|https://mina.apache.org/mina-project/performances.html]. It looks 
like MINA is capable of handling thousands of requests per second. I know it's 
a different project, but MINA SSHD contains two types of transport - MINA and 
NIO (which is the default transport in MINA SSHD because it's faster). My O/S 
is Linux 4.4.0-72-generic #93-Ubuntu SMP Fri Mar 31 14:07:41 UTC 2017 x86_64 
x86_64 x86_64 GNU/Linux. I didn't touch any JVM settings, so I use the default 
ones that come with java version "1.8.0_112". I use only one NIO thread on the 
server side. I also use the 
[NamedFactory|https://github.com/maseev/sshd-echo/blob/master/sshd-echo-server/src/main/java/io/github/maseev/sshd/echo/server/Server.java#L46]
 in order to get access to the input/output streams of the connection.

{quote}
{code}
ExecutorService threadPool = Executors.newSingleThreadExecutor(); // used to 
run commands but only one at a time
server.setNioWorkers(1);   // severly limits throughput
{code}
{quote}
They would have affected the performance if I had more than 1 client, but I 
don't, so they won't.

> 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