Login  
Search All Forums
Dart Home | PowerTCP SFTP & SSH for .NET | Custom Development Reply | PowerTCP SFTP & SSH for .NET Topics | Forums   
AuthorForum: PowerTCP SFTP & SSH for .NET
Topic: SSH TCP & CPU Usage
Tribander

From: USA
Posts: 8
Member Since: 03/09/14
posted March 9, 2014 12:32 PM

I have a VB.NET Winforms application that opens a session on our Linux server auto runs an application and according to UserID profile. I then feed ASCII keystrokes into the Linus app which updates records.

All is well and working splendidly I can see the data on the screens so I know how to logically interact with the app.

All is perfect until I close the session like the sample code illustrated:
sshModel.Close()
    Do While sshModel.State = ConnectionState.Connected
      System.Threading.Thread.Sleep(10)
    Loop
As soon as the session closes and the Winform app returns to idle waiting for another update to do (which could be seconds, minutes or hours) the CPU stays at 25% - 30% and if I repeat the process another 25% - 30% gets added on each iteration! I've don a Dispose on the Ssh1 in addition to Closing sshModel component. Am I only supposed to close the session before shutting down the application?
Nick B (Admin)

From: Utica, NY USA
Posts: 619
Member Since: 05/25/10

Extra Support Options
Custom Application Development

posted March 10, 2014 10:27 AM

Hello,

What sample did you base your disconnect code off of? It should not be necessary to perform that loop after sshModel.Close() if you're synchronously calling Ssh.Close() inside sshModel.Close(), and Ssh.ThreadingModel is ThreadingModel.Free; sshModel.State should be ConnectionState.Closed after Ssh.Close() is called.

I tested this with our included VB.NET Ssh Client sample, and was unable to reproduce your issue; sshModel.State is ConnectionState.Closed after calling sshModel.Close() (which calls ssh.Close()). I could connect to and disconnect from the server multiple times, with no observed CPU usage after disconnecting from the server.
Tribander

From: USA
Posts: 8
Member Since: 03/09/14
posted March 10, 2014 11:43 AM

Thanks for your prompt response. We based our app on the SshClient.40 project in the SshSamples.VB40 solution.

Since my original post yesterday I went directly to the sample project SshClient.40 project and logged on to the Linux server and proceeded to fill in the screen prompts. All went well however, just like our home-grown app I went to the Connection menu and clicked on the Log out item and again the CPU went up to 25% and stayed there until the sample application was ended!

I can send you screen shots to your email if you'd like me to.

You bring up a good point, our application does use any kind of GUI so Syncro mode would be better for this app.

Thanks,

Rick Erdmann
Nick B (Admin)

From: Utica, NY USA
Posts: 619
Member Since: 05/25/10

Extra Support Options
Custom Application Development

posted March 10, 2014 11:53 AM

Hello,

What SSH server software are you connecting to? This can be easily determined by connecting to the server's SSH/SFTP port via telnet (such as with Microsoft's command-line telnet application), and the server will respond with a single line stating its SSH version and usually the server name and version.

Are you using version 4.5 or 4.6 of our component? We just released an update on the 5th. (I tested your issue with both versions)
Tribander

From: USA
Posts: 8
Member Since: 03/09/14
posted March 10, 2014 12:15 PM

The Telnet session reports back: SSH-2.0-OpenSSH_4.3

The Dart.Ssh version I have on my development PC is 4.4.3.6 but we just purchased 3 more licenses last week and another associate has 4.5.0.3 and he is experiencing the exact same problem.

What do I need to do to get the 4.5.0.3 version on my PC? I have an active license.
Tribander

From: USA
Posts: 8
Member Since: 03/09/14
posted March 10, 2014 12:19 PM

By-the-way, I tested backing all the way out of the menus and that causes the session to drop on the host so Ssh never did initiate the close. The CPU again returned to 25% when the session was terminated by the host.
Tribander

From: USA
Posts: 8
Member Since: 03/09/14
posted March 10, 2014 12:37 PM

Further testing reveals that when I go into a bash shell on the server and do a simple command the CPU also returns to 25% and stays there until I end the sample VB app. Here is a copy of that session, after entering 'exit' the CPU returned to 25%.

Last login: Mon Mar 10 09:16:02 2014 from 10.6.99.37

-bash-3.2$ ls -l
total 0
-bash-3.2$ exit
logout
Nick B (Admin)

From: Utica, NY USA
Posts: 619
Member Since: 05/25/10

Extra Support Options
Custom Application Development

posted March 10, 2014 1:42 PM

Hello,

Please contact sales@dart.com for information on your order and download links for previous versions.

Your version of OpenSSH is out of date; the current version is 6.5. Is it possible to upgrade to, or test against the current version to see if your issue is resolved?

What are the specific steps I need to take to reproduce your issue? I've just been connecting to our server (OpenSSH) with our included Ssh Client sample, and then disconnecting (Ssh.Close()). I also tested your actions stated in your last post; connected to our server, entered 'ls -l', hit enter, entered 'exit', hit enter (closes the MDI window, but does not disconnect from the server), and was unable to reproduce your CPU usage.

Can you test with the current version of our component, and the included Ssh Client sample (unmodified)? The current version may be downloaded here: www.dart.com/sftp-ssh-net-trial.aspx
Tribander

From: USA
Posts: 8
Member Since: 03/09/14
posted March 10, 2014 2:19 PM

The steps you performed are the same ones I used.(ls -l followed by 'exit'). I am using an unmodified version of the sample just as it arrives after downloading.

I have sent an inquiry to sales to see what it's going to take to upgrade my Dart SSH upgraded to to 4.5. However, we have already tested this on another developer's PC that has the new version of SSH 4.5 with the same results.

In fact, this is how we first noted the problem. He deployed his app to production last Friday and about 20 minutes later got a call from the system admin that his app was pinning the server CPU at 100% So I guess it looks more and more like OpenSSH.

I am going to check on seeing if I can get a test set-up that is running OpenSSH version 6.5 to see if that eliminates the issue.

Thanks
Tribander

From: USA
Posts: 8
Member Since: 03/09/14
posted March 10, 2014 3:48 PM

I talked to the system guys and this is what we came up with: We could set-up an OpenSSH version 6.5 box but there is really little point because we have 15 plants across the country all running 4.5 which is required by the enterprise manufacturing plant software we run. So upgrading all that infrastructure really isn't an option to solve this unique problem.
Tribander

From: USA
Posts: 8
Member Since: 03/09/14
posted March 11, 2014 4:45 PM

I have decided to take a different approach that I'm hopping will serve as a work-around to the problem. We are going to selectively run the application that uses the Dart PowerTCP SSH to send the data and then end the program after the data has been transferred. This will then release the CPU when the Dart program terminates.

Upgrading all our servers to OpenSHH 6.5 is not an option.
Reply | PowerTCP SFTP & SSH for .NET Topics | Forums   
This site is powered by PowerTCP WebServer Tool PowerTCP WebServer for ActiveX