[jira] [Commented] (SSHD-742) Are there any ways to improve performance?

2017-04-25 Thread Goldstein Lyor (JIRA)

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

Goldstein Lyor commented on SSHD-742:
-

You have not wasted time - it's just that the issue was not clearly stated. In 
any case
{quote}
A request is relatively small (around 200 bytes). On the other hand, the 
response might be around 8 to 10 KB.
{quote}
IMO, SSH is not built for "requests" but rather for long-lived sessions, since 
it has quite an overhead in the initial session establishment as well as the 
whole encryption mechanism. In any case, if you do want to "compare" it to an 
HTTP-like mechanism, the closest you can get is to use *HTTPS* and ensure that 
you are not using the {{Keep-Alive}} option or any session re-use. Even then, I 
agree with [~gnt] that it would still be equivalent to comparing apples and 
oranges.

> 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)


[jira] [Commented] (SSHD-742) Are there any ways to improve performance?

2017-04-24 Thread Miron Aseev (JIRA)

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

Miron Aseev commented on SSHD-742:
--

I think you're right. It's kinda silly that I expect this kind of performance 
and low latency, where so many things are going on in the library itself. Sorry 
if I wasted your time. Have a good one.

> 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)


[jira] [Commented] (SSHD-742) Are there any ways to improve performance?

2017-04-24 Thread Guillaume Nodet (JIRA)

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

Guillaume Nodet commented on SSHD-742:
--

So the graph you show leads to roughly 6.000 req/sec for a single client.  
Given the additional layers (encryption, mac computation, etc...),I'm not sure 
what you really expect here.
One good comparison would be to replicate the test with a native ssh client / 
server to see how much requests you can have, that could be a good point of 
comparison, but comparing http to ssh is like comparing apple and oranges ;-)

> 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)


[jira] [Commented] (SSHD-742) Are there any ways to improve performance?

2017-04-24 Thread Goldstein Lyor (JIRA)

[ 
https://issues.apache.org/jira/browse/SSHD-742?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=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)