On Tue, Feb 2, 2010 at 12:26 AM, james bardin <jbar...@bu.edu> wrote: > On Mon, Feb 1, 2010 at 12:16 PM, james bardin <jbar...@bu.edu> wrote: >> >> >>>> Yes, the solution written entirely in c will be significantly faster. >>>> Since this is mostly python, cpu is the limiting factor. >>> >>> I have zero experience in ssh and encryption, but my expection was >>> that at least in the case of transfering 10+ Gb files, the process >>> will be bounded by network and not CPU. >>> > > Your email got me thinking, so I did a few tests: > > The biggest boost in performance was had by using the latest > pycrypto(2.1.0). You'll get a deprecation warning from paramiko that > you can ignore for now (bug already submitted in github). There was a > change to the HMAC code that made a huge difference in paramiko's > performance. > > I tried using a limited bandwidth connection, and paramiko was on par > with openssh when cpu wasn't a concern.
As expected, since sending data take much more time then encryption. > When bandwidth wasn't an issue (using loopback), paramiko was about > 85% of the speed of openssh on my machine. Those are really good news. I will try to upgrade the code. I am using the real IP to test my code ( I found the following code on the internet ) import socket import struct import fcntl def get_ip_address(fname='eth0'): SIOCGIFADDR = 0x8915 s = socket.socket(socket.AF_INET, socket.SOCK_DGRAM) io_result = fcntl.ioctl( s.fileno(), SIOCGIFADDR, struct.pack('256s', fname[:15] ) ) return socket.inet_ntoa( io_result[20:24] ) from one side all requests goes via router, from the other side I have "local" access to the both ends. In case of file transfer, the md5sum is executed on both files and compared. > Each newer version of python2.X was slightly faster as well. I am using Python 2.4 ( production sys admins are so conservative :-) ) and 2.6 in development, but as you noted there is no a big difference between them. Thank you for help. -- Roman Yakovenko C++ Python language binding http://www.language-binding.net/ _______________________________________________ paramiko mailing list paramiko@lag.net http://www.lag.net/cgi-bin/mailman/listinfo/paramiko