Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ssh connection pool #613

Open
bolatik opened this issue Feb 4, 2025 · 2 comments
Open

ssh connection pool #613

bolatik opened this issue Feb 4, 2025 · 2 comments

Comments

@bolatik
Copy link

bolatik commented Feb 4, 2025

hi, is there any way to measure connection pools?

and when we use it, do we always open and then close the connection? or can we leave it until the container is rebooted? I don't quite understand this point.

for example, in my case, I have to monitor a folder on a remote server every five seconds. I don't think it's reasonable to open a connection every 5 seconds

@bolatik
Copy link
Author

bolatik commented Feb 4, 2025

Opening a new connection every 5 seconds can put a strain on the server and increase latency. Especially if there are many such tasks. On the other hand, long-lived connections can be broken due to timeouts or network problems. It may be worth using a connection pool or one persistent connection with a check for its activity.

@puellanivis
Copy link
Collaborator

There is no need to open a new connection every 5 seconds. Using a Realpath(".") before every command will ensure that the connection is still valid. You should only need to reconnect if it fails.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants