mina-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Lyor Goldstein (Jira)" <j...@apache.org>
Subject [jira] [Comment Edited] (SSHD-1090) sshd setPermanentTransferThreads functionality in Apache SSHD ( Transfer thread pool size)
Date Thu, 08 Oct 2020 14:16:00 GMT

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

Lyor Goldstein edited comment on SSHD-1090 at 10/8/20, 2:15 PM:
----------------------------------------------------------------

{quote}
Maverick Legacy SFTP server has the below api:
...
Is there any API simliar to the same functionality in APACHE Mina sshd library? If not then
how to achieve the same functionality in sshd
{quote}
I am not familiar with _Maverick_ framework and it is difficult to understand what the functionality
you describe does exactly. In any case, SSHD uses a thread pool - though it depends on the
{{IOServiceFactory}} being used. Assuming the default (NIO2) there is a configuration value
called {{nio-workers}}:
{code:java}
  /**
     * Number of NIO worker threads to use.
     */
    public static final Property<Integer> NIO_WORKERS
            = Property.validating(Property.integer("nio-workers", Runtime.getRuntime().availableProcessors()
+ 1),
                    w -> ValidateUtils.checkTrue(w > 0, "Number of NIO workers must
be positive: %d", w));
{code}
This value can be used to tune the concurrency level of the thread pool - however

* It is +constant+ - i.e., cannot grow/shrink dynamically.
* It is +global+ - has nothing to do with SFTP or SCP or any other sub-protocol but rather
with the SSH server as a whole.

Note that having a large thread pool does not necessarily improve throughput since there is
a context switch overhead.


was (Author: lgoldstein):
{quote}
Maverick Legacy SFTP server has the below api:
...
Is there any API simliar to the same functionality in APACHE Mina sshd library? If not then
how to achieve the same functionality in sshd
{quote}
I am not familiar with _Maverick_ framework and it is difficult to understand exactly what
the functionality you describe does exactly. In any case, SSHD uses a thread pool - though
it depends on the {{IOServiceFactory}} being used. Assuming the default (NIO2) there is a
configuration value called {{nio-workers}}:
{code:java}
  /**
     * Number of NIO worker threads to use.
     */
    public static final Property<Integer> NIO_WORKERS
            = Property.validating(Property.integer("nio-workers", Runtime.getRuntime().availableProcessors()
+ 1),
                    w -> ValidateUtils.checkTrue(w > 0, "Number of NIO workers must
be positive: %d", w));
{code}
This value can be used to tune the concurrency level of the thread pool - however

* It is +constant+ - i.e., cannot grow/shrink dynamically.
* It is +global+ - has nothing to do with SFTP or SCP or any other sub-protocol but rather
with the SSH server as a whole.

Note that having a large thread pool does not necessarily improve throughput since there is
a context switch overhead.

> sshd setPermanentTransferThreads functionality in Apache SSHD ( Transfer thread pool
size)
> ------------------------------------------------------------------------------------------
>
>                 Key: SSHD-1090
>                 URL: https://issues.apache.org/jira/browse/SSHD-1090
>             Project: MINA SSHD
>          Issue Type: New Feature
>    Affects Versions: 2.5.0
>            Reporter: Susmit Sarkar
>            Priority: Blocker
>              Labels: mina, sshd
>
> Hello MINA team,
> Maverick Legacy SFTP server has the below api:
> [http://maverick-legacy-server-javadocs.s3-website-eu-west-1.amazonaws.com/com/maverick/nio/DaemonContext.html#setPermanentTransferThreads(int])
> *public void setPermanentTransferThreads(int permanentTransferThreads)*
>  
>  Set the number of permanent transfer threads. Once a socket has either been accepted
or connected, the socket is registered with a transfer thread. This thread asynchronously
performs all the IO for the socket. If all the permanent threads become fully loaded then
additional threads will be created to handle additional connections and shutdown once they
have no sockets to service.
>   
>  Is there any API simliar to the same functionality in APACHE Mina sshd library? If not
then how to achieve the same functionality in sshd
>   
>   



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


Mime
View raw message