Closed TheAustinSwamy closed 2 years ago
The acceptor thread is still relevant if you are going to allow port forwarding. Local port forwarding will need to place a listening socket on the acceptor thread in order to function correctly.
TBH I don't know what will happen if you set acceptor threads to zero. Did you try this and what happened?
Connect threads are used to establish the initial connection of any socket. Once connected, the socket gets moved to the transport thread. Generally these days the transport thread is an I/O thread where data is moved from the socket into a temporary buffer for an executor thread to process, or from the buffer into the socket for sending to the remote side.
Thanks! Not doing any port forwarding. If i don't sent the acceptor threads to 0, using synergy just as client in a webapp, redeploying the webapp over and over again on tomcat causes CPU to spike to 100%.
I'm guessing that does not generate any shutdown in the JVM? The shutdown hook should take care of cleaning up.
Id be happy to look at any logs or information you can provide to try and stabilize that situation.
User did not respond with any useful information to continue looking at this issue.
When i use the Client API (see code below at the bottom) as mentioned in the API docs, default SshClientContext creates and initializes the SShEngine.DefaultInstance() which does the startup of the instance.
During startup, 1 acceptor thread, 1 connector thread and 2 transfer threads are created. The following properties control the number of threads and I can change the thread count.
maverick.config.connect.threads (default 1 thread) maverick.config.transfer.threads (default 2 threads) maverick.config.accept.threads (default 1 thread)
When using the only as a client, is it safe to turn off acceptor threads by setting the system property maverick.config.accept.threads to 0. I don't see a need to spin this thread.
Also, what are connect and transfer threads used for. Any guidance on setting the appropriate values for them.
try(SshClient ssh = new SshClient("localhost", 22, "lee", "xxxxxx".toCharArray())) { runTask(new SftpClientTask(ssh) { protected void doSftp() { } }); }