I am working on a client application with python. GUI is created with PyQt.
Basically, the application connects to the server via ssh and retrieves information thereby reading files generated by the server software. I am using paramko module.
My question is:
Should I open an ssh connectivity right when the client application is started and keep until it quits? Or I should create a new ssh connectivity whenever a button in client app triggers information retrieval?
How would it affect the performance?
Any suggestion and reference would be highly appreciated.
Whenever you have ssh to server 1 port is block from both the side, if you have connection when client starts then it will block that port and no one could communicate to server , also you increasing server load just keeping the connection open. 
So, my advice is to start ssh whenever the need is and stop once task is completed.
Client application's connectivity with server