This gets an 804M file across the wire much more quickly:
dooferlad@homework2 ~/dev/go/src/github.com/juju/juju $ time juju attach hacky name=/home/dooferlad/a-file.bin
real 0m37.085s
user 0m5.807s
sys 0m0.755s
Which is about 170Mbps
But not as fast as scp:
dooferlad@homework2 ~/dev/go/src/github.com/juju/juju $ time juju scp /home/dooferlad/a-file.bin 0:/home/ubuntu
Looks like it is the go DES implementation being slow:
dooferlad@homework2 ~/dev/go/ src/github. com/juju/ juju $ go tool pprof $(which juju) /tmp/profile179 913735/ cpu.pprof des.expandBlock des.cryptBlock des.permuteInit ialBlock des.permuteFina lBlock des.(*desCipher ).Encrypt cipher. (*cbcEncrypter) .CryptBlocks cipher. fastXORBytes des.(*tripleDES Cipher) .Encrypt
Entering interactive mode (type "help" for commands)
(pprof) top10
11.37s of 11.57s total (98.27%)
Dropped 23 nodes (cum <= 0.06s)
Showing top 10 nodes out of 30 (cum >= 11.22s)
flat flat% sum% cum cum%
7.86s 67.93% 67.93% 9.95s 86.00% crypto/des.feistel
2.09s 18.06% 86.00% 2.09s 18.06% crypto/
0.71s 6.14% 92.13% 11s 95.07% crypto/
0.21s 1.82% 93.95% 0.21s 1.82% crypto/
0.13s 1.12% 95.07% 0.13s 1.12% crypto/
0.12s 1.04% 96.11% 0.12s 1.04% crypto/sha1.block
0.07s 0.61% 96.72% 7.47s 64.56% crypto/
0.06s 0.52% 97.23% 11.34s 98.01% crypto/
0.06s 0.52% 97.75% 0.06s 0.52% crypto/
0.06s 0.52% 98.27% 11.22s 96.97% crypto/
Having removed DES from the ciphers that Juju will use:
dooferlad@homework2 ~/dev/go/ src/github. com/juju/ juju $ go tool pprof $(which juju) /tmp/profile383 480576/ cpu.pprof aes.encryptBloc kAsm cipher. (*cbcEncrypter) .CryptBlocks cipher. fastXORBytes aes.(*aesCipher ).Encrypt aes.(*aesCipher GCM).Encrypt aes.encryptBloc k cipher. xorBytes der).Read
Entering interactive mode (type "help" for commands)
(pprof) top10
530ms of 570ms total (92.98%)
Showing top 10 nodes out of 45 (cum >= 60ms)
flat flat% sum% cum cum%
190ms 33.33% 33.33% 190ms 33.33% crypto/
120ms 21.05% 54.39% 120ms 21.05% crypto/sha1.block
110ms 19.30% 73.68% 110ms 19.30% syscall.Syscall
30ms 5.26% 78.95% 290ms 50.88% crypto/
30ms 5.26% 84.21% 30ms 5.26% crypto/
10ms 1.75% 85.96% 210ms 36.84% crypto/
10ms 1.75% 87.72% 10ms 1.75% crypto/
10ms 1.75% 89.47% 200ms 35.09% crypto/
10ms 1.75% 91.23% 40ms 7.02% crypto/
10ms 1.75% 92.98% 60ms 10.53% io.(*LimitedRea
This gets an 804M file across the wire much more quickly: src/github. com/juju/ juju $ time juju attach hacky name=/home/ dooferlad/ a-file. bin
dooferlad@homework2 ~/dev/go/
real 0m37.085s
user 0m5.807s
sys 0m0.755s
Which is about 170Mbps
But not as fast as scp: src/github. com/juju/ juju $ time juju scp /home/dooferlad /a-file. bin 0:/home/ubuntu
dooferlad@homework2 ~/dev/go/
real 0m6.269s
user 0m3.651s
sys 0m1.153s
This is 1GBps