[20130109]使用bbcp传输文件.txt

简介: [20130109]使用bbcp传输文件.txt今天看了一些blog,发现一些blog提到了bbcp。使用它来传输大文件据说很快。相关站点:http://www.slac.
[20130109]使用bbcp传输文件.txt

今天看了一些blog,发现一些blog提到了bbcp。使用它来传输大文件据说很快。

相关站点:
http://www.slac.stanford.edu/~abh/bbcp/bin/
http://www.slac.stanford.edu/~abh/bbcp/

--不行,可以自己下载编译:
git clone http://www.slac.stanford.edu/~abh/bbcp/bbcp.git
cd bbcp
make
cp bin/amd64_linux26/bbcp /usr/local/bin/bbcp


1.开始测试:
一看文档,晕!这么多参数,使用简单一点看看:
http://www.slac.stanford.edu/~abh/bbcp/

bbcp -P 2 /data/orcl/users01.dbf oracle@remote_host:/tmp/users01.dbf
--提示,执行文件名明明在那里,为什么不行。直接进入/usr/local/bin目录执行,也一样。
bash: bbcp: command not found
bbcp: bbcp unexpectedly terminated on XXX.XXX.XXX.XXX

--仔细看了相关文档
bbcp assumes the remote system's non-interactive environment contains the path to the bbcp utility.
This can be determined by with the following command:
ssh remotesystem which bbcp

--也就是远端也需要这个一个执行文件。将bbcp拷贝过去。

#  bbcp -P 2 /data/orcl/users01.dbf oracle@remote_host:/tmp/users01.dbf
oracle@xxX.xxx.xxx.xxx's password:
bbcp: Creating /tmp/users01.dbf
bbcp: 130109 16:50:04  5% done; 55.7 MB/s
bbcp: 130109 16:50:06  15% done; 63.2 MB/s
bbcp: 130109 16:50:08  25% done; 66.1 MB/s
bbcp: 130109 16:50:10  36% done; 71.3 MB/s
bbcp: 130109 16:50:12  47% done; 72.8 MB/s
bbcp: 130109 16:50:14  55% done; 70.0 MB/s
bbcp: 130109 16:50:16  65% done; 70.7 MB/s
bbcp: 130109 16:50:18  74% done; 70.4 MB/s
bbcp: 130109 16:50:20  84% done; 70.4 MB/s
bbcp: 130109 16:50:22  95% done; 71.6 MB/s

--文件大小1.4G,大约20秒完成。
# du -sm /tmp/users01.dbf
1467    /tmp/users01.dbf

2.使用scp做一个比较:
scp     /data/orcl.20121016/users01.dbf oracle@192.168.101.209:/tmp/users01.dbf

users01.dbf 100% 1465MB  45.8MB/s   00:32

lftp也做了一个测试,稍微快一点,大约30秒。1536180224 bytes transferred in 30 seconds (48.95M/s)


3.另外bbcp有一个好处,如果拷贝文件已经存在,提示文件存在直接退出。
加入-f 参数
--force | -f     

forces the copy by erasing the target prior to copying the source file. By default, if the target already exists for the
source file, the copy fails. See also the –K option modifier.

如果在拷贝文件时,在远程机器使用ps -elf | grep bbcp 看。
# ps -elf | grep bbcp | grep -v grep
0 S oracle    7398  7397  1  81   0 - 12251 wait   17:04 ?        00:00:00 bbcp SNK
1 S oracle    7427  7398 68  76   0 - 22495 184466 17:04 ?        00:00:13 bbcp SNK

--会有2个进程。

看了一些文档从调整性能讲重要的两个参数(我自己认为),我估计如果机器忙,带宽不足,也许会影响这个网络。

1.2.1        Window Size (-w)
The first and most important option is –w. This determines the TCP window size as well as the default I/O size.  The
default of 128Kis usually good enough for LAN and larger values are likely to hurt performance.

1.2.2        Streams (-s)
The -- s options is the second most important tuning parameter. This specifies the number of parallel TCP streams. A
na?ve explanation would say that streams can make up for not having a large enough window. The idea is that if you can’
t get enough packets moving in a single window, then create multiple windows and run them simultaneously. This is only
partially true. While multiple streams do provide multiple windows, multiple windows also parallelize traffic with
independent time-outs, re-transmissions, and greatly improved I/O overlapping. This is a cumulative effect that
dramatically increases the overall bandwidth utilization. But, too much of a good thing can also be bad, as you will see
below.
目录
相关文章
|
9月前
|
运维 网络安全
巧用 nc 命令传输文件
今天在业务上云的时候,遇到了些问题。最终发现问题的根源不好排查,于是——把生产环境的全量配置文件,还有日志全量打包下载到开发机器分析!生产和开发机内网不通,都是走公网传输,但是速度特别慢……
144 3
|
9月前
ENVI_IDL: 文本文件的读取(主要是txt、csv文件)
ENVI_IDL: 文本文件的读取(主要是txt、csv文件)
266 0
|
12月前
|
存储 C++ iOS开发
【C++之文件与文件流】f1.dat 和 f2.dat 文件的读写
【C++之文件与文件流】f1.dat 和 f2.dat 文件的读写
|
数据安全/隐私保护
pyton对txt文件的读取写入和加密(含代码)
pyton对txt文件的读取写入和加密(含代码)
230 0
|
数据安全/隐私保护
两台服务器间传输文件【scp命令】
两台服务器间传输文件【scp命令】
两台服务器间传输文件【scp命令】
vbs 读取txt是读取特定的行
读取第三行的内容:Set fso = CreateObject("scripting.filesystemobject")path="A.TXT文件的路径"Set A=fso.OpenTextFile(path,1)For i=1 To 2A.
1049 0
使用FileStream向txt格式的文本文件 "追加" 新内容并读取
原文:使用FileStream向txt格式的文本文件 "追加" 新内容并读取 1 //得到文件路径。 2 static string filePath = AppDomain.CurrentDomain.BaseDirectory+"\\TxtFile.txt"; 3 static void Main(string[] args) 4 { 5   //调用写入方法。
905 0
expect+scp传输文件发现文件丢失
背景 使用expect+scp去跨机器传输文件,(别问我为什么,因为公司的测试机器都是通过堡垒机的,无法绕开堡垒机,只能暂时使用这个方法了),结果发现从A传递到B的tar.gz文件大小不一致了的,当时心里MMP了   步骤 1.
1751 0
|
缓存 关系型数据库 Oracle
[20171120]11G关闭直接路径读.txt
[20171120]11G关闭直接路径读.txt --//今天做filesystemio_options参数测试时,遇到一个关于直接路径读的问题. --//如果看以前的博客介绍,设置"_serial_direct_read"=never或者events '10949 trace name context forever';就可以关闭直接路径读.
1008 0