login about faq

Good day, I really like Python SSH module, however it eats 100% CPU, when I try to connect to multiple servers in threads(even 10-15 threads). Both Win and Linux. Is there a way to reduce it? The most simple example I stitched up:

import chilkat, threading, time

def Connect():        
    ssh = chilkat.CkSsh()    
    if not ssh.Connect('Host', 22) : return        
    ssh.put_IdleTimeoutMs(5000)        
    if not ssh.AuthenticatePw('user', 'pw'): return

chilkat.CkSsh().UnlockComponent("Anything for 30-day trial")    
for _ in range(15):
    threading.Thread(None, Connect).start()        
while threading.active_count() > 1:
    time.sleep(1)

asked Oct 24 at 11:18

Standard_user's gravatar image

Standard_user
11

edited Oct 24 at 13:04

Be the first one to answer this question!
toggle preview

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here

By RSS:

Answers

Answers and Comments

Markdown Basics

  • *italic* or __italic__
  • **bold** or __bold__
  • link:[text](http://url.com/ "title")
  • image?![alt text](/path/img.jpg "title")
  • numbered list: 1. Foo 2. Bar
  • to add a line break simply add two spaces to where you would like the new line to be.
  • basic HTML tags are also supported

Tags:

×89
×18

Asked: Oct 24 at 11:18

Seen: 96 times

Last updated: Oct 24 at 13:04

powered by OSQA