Syed Atif Ali Whats the fastest encryption to transfer files with SCP ?
Description :
Many times it is required to transfer files across machines on the same network , all machinesbeing on the same network and behind proxy its useless to transfer them with an encryptionwhich is more CPU ntensive than other and also slower than others.There can be other methods to transfer files of course , ftp , sftp , rsync, but this document is justabout scp command.
Objective :
To find out what is the faster cypher to define in scp command to transfer files on an internallocal network.
Environment :
Two Linux machines, with same openssh versions.Connected on a 100 Mbps LAN . Both being idle nothing is running on them at the moment .Before each test files will be cached on the file system buffer , so the tests are not affected withcache.
Tests :
Copy 1000 small, medium , large files across the network using different cyphers in scp command and measure their real time.
These are the file sizes :
Small : 10K
Medium: 100K
Large:1000K
Overall arcfour performed better than any other cypher used. It is safe to say that arcfour
can beused to transfer files using scp on an internal network.
You can define which cypher to use by -c option of scp.
Simple %CPU usage for a domain is calculated by sampling
virDomainGetInfo periodically and looking at the
virDomainInfo
cpuTime field. This 64 bit field counts nanoseconds of CPU time used
by the domain since the domain booted.
Let t be the number of seconds between samples. (Make
sure that t is measured as accurately as possible, using
something like gettimeofday(2) to measure the real
sampling interval).
Let cpu_time_diff be the change in cpuTime
over this time, which is the number of nanoseconds of CPU time used by
the domain, ie:
cpu_time_diff = cpuTimenow — cpuTimet seconds ago
Let nr_cores be the number of processors (cores) on the
system.
Use virNodeGetInfo
to get this.
Then, %CPU used by the domain is:
%CPU = 100 × cpu_time_diff / (t × nr_cores × 109)
Because sampling doesn't happen instantaneously, this can be
greater than 100%. This is particularly a problem where you have
many domains and you have to make a virDomainGetInfo
call for each one.