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

Performance for system ssh and scp commands needs to be improved #639

Closed
abhitoshj opened this issue Jul 5, 2024 · 5 comments · Fixed by #717, #841, #842, #843 or #844
Closed

Performance for system ssh and scp commands needs to be improved #639

abhitoshj opened this issue Jul 5, 2024 · 5 comments · Fixed by #717, #841, #842, #843 or #844
Assignees
Labels
bug Something isn't working triaged This issue was discussed in the maintainers round

Comments

@abhitoshj
Copy link
Collaborator

Is your feature request related to a problem? Please describe.
Whenever k2s system ssh and k2s system scp commands are executed, they take sometime more than 20-30 seconds to begin execution.
When many such commands have to executed in sequence, significate delays are observed.

Describe the solution you'd like
Improve performance of k2s system ssh and scp commands.

Describe alternatives you've considered
When many ssh commands have to be executed in sequence, I generally abstract all such commands in a bash script or a powershell script. This powershell script or bash script is copied onto the node using k2s system scp command and then executed with k2s system ssh commands, So the overall execution time is less than a minute.

Additional context
N.A.

@krotz-dieter krotz-dieter added triaged This issue was discussed in the maintainers round bug Something isn't working labels Jul 11, 2024
@siprbaum
Copy link

Just wanting to at least present another option: start a connection to the node at the beginning and end it when everything is done. This would mean only the initial connection is slow, but the next connections will multiplex on the previous connection.

https://www.cyberciti.biz/faq/linux-unix-reuse-openssh-connection/

@achimkist
Copy link
Collaborator

achimkist commented Sep 9, 2024

ssh and scp are wrapped in a powershell script. The reason why it takes so long is the loading of the modules. Currently the "main" modules (infra. node, cluster modules) are loaded. When loading only the really needed ones the performance can be improved by 50%:

for ssh cmd:
current implementation: TotalMilliseconds : 6765.2381
loading only needed modules: TotalMilliseconds : 3598.6043

for scp cmd:
current implementation: TotalMilliseconds : 8059.982
loading only needed modules: TotalMilliseconds : 3614.6283

@achimkist achimkist linked a pull request Sep 9, 2024 that will close this issue
@jgriegershs jgriegershs self-assigned this Oct 7, 2024
@jgriegershs
Copy link
Collaborator

Just wanting to at least present another option: start a connection to the node at the beginning and end it when everything is done. This would mean only the initial connection is slow, but the next connections will multiplex on the previous connection.

https://www.cyberciti.biz/faq/linux-unix-reuse-openssh-connection/

This can already be achieved with k2s system ssh [m|w] without adding a command. As result, the prompt to the node stays open until closed by the user or calling system. During that prompt multiple commands can be executed writing to the stdin stream.

@jgriegershs
Copy link
Collaborator

Ongoing discussion: #788 .

Related discussions: #787 and #789 .

@jgriegershs jgriegershs reopened this Nov 5, 2024
@jgriegershs jgriegershs reopened this Nov 5, 2024
@jgriegershs jgriegershs reopened this Nov 6, 2024
@jgriegershs jgriegershs reopened this Nov 6, 2024
@jgriegershs
Copy link
Collaborator

jgriegershs commented Nov 11, 2024

k2s node copy command is implemented as part of the performance issues mitigation.

This re-work will continue with #854, #855 and #856.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment