BBCP is a point-to-point Network File Copy tool created by Andy Hanushevsky of SLAC (Stanford Linear Accelerator Center).
1. Installation
Visit BBCP's homepage: http://www.slac.stanford.edu/~abh/bbcp/, download the corresponding binary version or source code, if it is the source code, you need to compile.
wget http://www.slac.stanford.edu/~abh/bbcp/bin/amd64_rhel60/bbcp
Put it directly below the/usr/local/bin:
Mv-f bbcp/usr/local/bin/bbcp && chmod +x/usr/local/bin/bbcp
And then you can start using it.
Note: If your server has a firewall enabled, be aware that you need to open the 5031 port INPUT chain.
For example, to copy a file from 172.16.66.65 to 172.16.66.66, make the following rules:
Iptables-i input-s 172.16.66.66-p TCP--dport 5031-j ACCEPT
Also, the target segment of the BBCP copy needs to be installed BBCP.
2. Testing
This test is a copy of the test.tar.gz file.
DU-SB test.tar.gz
1863814120 test.tar.gz
Du-sh test.tar.gz
1.8G test.tar.gz
2.1 Test SCP
Time Scp-p 1222 test.tar.gz [email protected]:/tmp/
[email protected] ' s password:
test.tar.gz 100% 1777MB 63.5mb/s 00:28
Real 0m28.658s
User 0m4.832s
SYS 0m4.113s
Copy time is about 28.6s
2.2 Test BBCP
Time/usr/local/bin/bbcp-4-k-a-r-f-v-p 2-w 9m-s 16-t ' ssh-p 1222-x-a-ofallbacktorsh=no%i-l%u%H/usr/local /BIN/BBCP ' test.tar.gz [email protected]:/tmp/
[email protected] ' s password:
bbcp:indexing files to be copied ...
bbcp:copying 0 files and 0 links in 0 directories.
bbcp:appending to/tmp/test.tar.gz at offset 0
bbcp:171110 16:32:20 12% done; 135.9 MB/s, Avg 135.9 MB/s
bbcp:171110 16:32:22 22% done; 95.0 MB/s, Avg 113.0 MB/s
bbcp:171110 16:32:24 33% done; 98.7 MB/s, AVG 107.9 MB/s
bbcp:171110 16:32:26 41% done; 66.5 MB/s, Avg 96.9 MB/s
bbcp:171110 16:32:28 46% done; 45.4 MB/s, Avg 86.2 MB/s
bbcp:171110 16:32:30 52% done; 51.3 MB/s, Avg 80.1 MB/s
bbcp:171110 16:32:32 59% done; 65.7 MB/s, Avg 78.0 MB/s
bbcp:171110 16:32:34 64% done; 46.4 MB/s, Avg 74.0 MB/s
bbcp:171110 16:32:36 70% done; 49.9 MB/s, Avg 71.2 MB/s
bbcp:171110 16:32:38 75% done; 48.1 MB/s, Avg 68.8 MB/s
bbcp:171110 16:32:40 83% done; 65.5 MB/s, AVG 68.5 MB/s
bbcp:171110 16:32:42 87% done; 42.4 MB/s, AVG 66.3 MB/s
bbcp:171110 16:32:44 94% done; 62.0 MB/s, Avg 66.0 MB/s
File/tmp/test.tar.gz created; 1863814120 bytes at 65.3 MB/s
1 file copied at effectively 60.3 MB/s
Real 0m29.504s
User 0m0.062s
SYS 0m1.383s
Copy time is about 29.5s
Judging from the test results above, BBCP is not rumored to be much faster than the SCP.
Detailed parameters:
-4 using IPv4 IP to transmit
-K retains all files that are not transferred, and allows overwriting on retry, with-f even if the plus-K is all retransmitted, typically used with-a, the default does not use-K when the transmission is not completed when the transmission is interrupted when the transfer is not finished the destination file is deleted
-A retains checkpoint information for verifying file integrity
-R recursively transfers all files under the specified path
-C uses compression to reduce bytes transferred over the network but requires additional CPU resources, which can be very poor if CPU resources are low. BBCP compressing the data using ZIP compression level 1-9,1 fastest, 9 maximum compression rate is the slowest speed
-D Multi-directory replication, which can be separated by a space using multiple sources. such as:/home/ddroot/data dir1/data1 dir2/data2
-P 2 shows the process of transmission every two seconds
-V Display copy information
-V Print debug information
-F Force purging of data on a remote host for failed transmissions
-F does not check the remaining space of the target server
-W Set disk (I/O) buffers
Algorithm for (window = Netspeed/8*rtt = 1000mb/8*74ms = 1000/1000/8*74 = 9.25 M)
Corresponding Links: http://www.slac.stanford.edu/~abh/bbcp/#_Toc332986061
-S 16 Sets the concurrency number to 16
Reference Official recommendation: http://www.slac.stanford.edu/~abh/bbcp/#_Streams_ (-s)
-T "ssh-x-a-p 1222-ofallbacktorsh=no-i/home/ddroot/.ssh/id_rsa-l ddroot 172.16.66.66/usr/bin/bbcp"
Specify the authentication method for the remote host:
Port specified with-p 1222;
Set-ofallbacktorsh=no to reduce SSH response time;
Set-i/home/ddroot/.ssh/id_rsa to specify SSH Key;
Set-l ddroot Specify login user;
172.16.66.66 is the remote host address;
/USR/BIN/BBCP is the BBCP path for the remote host;
--port PN1 Specifies the receive data port, default 5031
-Z PN1:PN2 Specify the receive data port range
For more details, see: Using bbcp and the BBCP homepage mentioned above.
Http://pcbunn.cithep.caltech.edu/bbcp/using_bbcp.htm
http://www.slac.stanford.edu/~abh/bbcp/
Measured BBCP multi-threaded transfer tool