1
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 5 years have passed since last update.

scp -pr が遅いのを何とかする

Last updated at Posted at 2020-04-30

scp -pr が遅いのを何とかする

大量の小さなファイルを scp -pr をすると遅いのを何とかする.

$ du -hs 201703
2.3G    201703
$ find . -name '*.gz'|wc -l
32736

というわけで、2.3GB、3万個のファイルの転送. 素直に scp -pr すると

$ time scp -pr 201703 user@203.0.113.4:~/tmp/
Password:

...
...

real    6m46.450s
user    0m28.824s
sys     0m58.958s

と 5.8MB/s 程度だった.

これを工夫すると

$ time tar cf - 201703 | ssh user@203.0.113.4 'cd tmp; tar xf -'
Password:

real    1m50.797s
user    0m16.753s
sys     0m25.793s

21.4MB/s に改善.

1
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
1
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?