You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@mina.apache.org by "Jonathan Valliere (Jira)" <ji...@apache.org> on 2021/03/31 02:31:00 UTC

[jira] [Comment Edited] (SSHD-1153) NIO2 IOServiceFactory, NIO Worker Threads and the performance

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

Jonathan Valliere edited comment on SSHD-1153 at 3/31/21, 2:30 AM:
-------------------------------------------------------------------

The Apache Mina and Netty adapters will both queue the message to be written asynchronously later.. but in the same thread that processes received messages.  The NIO2 implementation uses the Java AsyncronousSocketChannel API to write to sockets in a secondary thread outside of the receiver side.  Maybe, the latency is reduced due to this behavior?

How much of a performance difference are you actually seeing?


was (Author: johnnyv):
The most obvious thing is that the NIO2 implementation will write to the socket concurrently in the same thread that generates the message.  The Apache Mina and Netty adapters will both queue the message to be written asynchronously later.  AFAIK, given the single-threaded nature of SSH, it isn't an issue.

> NIO2 IOServiceFactory, NIO Worker Threads and the performance
> -------------------------------------------------------------
>
>                 Key: SSHD-1153
>                 URL: https://issues.apache.org/jira/browse/SSHD-1153
>             Project: MINA SSHD
>          Issue Type: Question
>            Reporter: Susmit Sarkar
>            Priority: Critical
>         Attachments: image-2021-03-29-23-52-39-814.png, image-2021-03-29-23-54-01-301.png, image-2021-03-29-23-55-16-337.png, image-2021-03-29-23-55-33-299.png
>
>
> IoServiceFactoryFactory ==> *NIO2, MINA, NETTY*
> How does this works internally, and how performance will be affected with the different IoServiceFactoryFactory.
> We did lots of performance testing and found NIO2 is the best performing of the 3? Why is it the best of the other 2, and why Apache selects it as default. (Tested with 50-75 concurrent threads. Did 2 types of test *[1.] PUT for 1.5kb files for 75 concurrent threads [2.] PUT for 100 MB files for 40-50 concurrent threads*)
> How do NIO Worker Threads affect the performance? Attaching a screenshot from the thread dump which I took
> !image-2021-03-29-23-52-39-814.png!
> All the threads in park state and some are runnable in different phases of execution. I am not able to decipher what does the stacks mean:
> The details which I got are (*PARKED*):
>  !image-2021-03-29-23-54-01-301.png!
> For *RUNNABLE:*
> *!image-2021-03-29-23-55-33-299.png!*
> *Lastly, I want to bring this to notice not all threads are used out of 75 threads I see 50 to be in runnable and the remaining 25 to be in the parked state, is it the expected behavior?*
>  



--
This message was sent by Atlassian Jira
(v8.3.4#803005)

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@mina.apache.org
For additional commands, e-mail: dev-help@mina.apache.org