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

[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.

时间: 2024-08-02 07:24:45

[20130109]使用bbcp传输文件.txt的相关文章

[20131226]linux下使用pigz高效传输文件.txt

[20131226]linux下使用pigz高效传输文件.txt http://zlib.net/pigz/ pigz, which stands for parallel implementation of gzip, is a fully functional replacement for gzip that exploits multiple processors and multiple cores to the hilt when compressing data. pigz was

[20130110]linux传输文件-tar+nc+各种压缩方式.txt

[20130110]linux传输文件-tar+nc+各种压缩方式.txt 以前在linux下传输文件,特别一些大文件以及很多小文件,我个人经常喜欢tar+nc的传输方式. 实际上很简单: 在A机器上执行:tar -cvzf - /data/orcl/users01.dbf | nc -l 55555 在B机器上执行:nc A_IP 55555 | tar xvzf - -C /tmp --注意:-czf 后面有一个-,我曾经忘记写,导致1个文件破坏(切记!!!).这样解压在B机器的/tmp目录

如何在linux主机和windows主机之间传输文件

首先下载pytty,解压开发现里面有plink.exe pscp.exe psftp.exe putty.exe puttygen.exe puttytel.exe等可执行文件,如果只是想要链接主机做一些操作那么使用putty.exe就可一,具体使用可以参见上面给出的链接,要想要上传下载文件,那么需要使用pscp.exe这个文件. 下面讲解使用pscp命令在Linux和Windows之间传输文件. 通过命令行进入pscp.exe所在的文件夹,直接输入pscp会看到如下提示: PS:推荐像我一样将

串口传输文件 lrzsz

假设有一种开发环境,一块板子,除了串口,没有任何外部出入输出设备,没有sd卡,没有网线,这个时候如果你想跟这块板子传输交互文件,要怎么办? 根据modem所采用的文件传输协议:xmodem,ymodem,zmodem将其分类   xmodem:简单通用,传输信息单位是"包=128B",传输速度慢,适合电话线路质量差的情况下用  ymodem:由XMODEM演变来,效率可靠性高,包=128*8B:一次传输可发送或接受几个文件   zmodem:于上两种不同,已连续的数据流发送数据,效率更

【C/C++学院】(29)网络编程--实现跨平台传输文件(TCP版)

网络编程--实现跨平台传输文件(TCP版)源码下载地址     为了实现跨平台,需要对跨平台的代码进行条件编译. gcc的-D选项. 连接选项 -lWs2_32 代表要用Ws2_32.lib这个库 gcc编译选项,-D 代表定义一个宏,等同于在c语言当中定义 #defind WIN 在windows下,使用socket之前,必须使用WSAStartup初始化socket,程序运行结束以后必须调用WSACleanup释放相关资源 windown下,关闭socket使用closesocket函数 /

linux之间copy传输文件方法

不同的Linux之间copy文件通常有4种方法 1.ftp 2.samba服务 3.sftp 4.scp 前三种方法都比较繁琐,最简单的方法就是scp 命令scp 介绍 scp 本地用户名@IP地址:文件名1 远程用户名@IP地址:文件名2 [本地用户名@IP地址:] 可以不输入,可能需要输入远程用户名所对应的密码. 可能有用的几个参数: -v 和大多数linux命令中的-v意思一样,用来显示进度.可以用来查看连接,认证,或是配置错误. -C 使能压缩选项. -P 选择端口.注意-p已经被rcp

套接字编程-socket传输文件时遇到的问题!

问题描述 socket传输文件时遇到的问题! 先给出代码. 客户端: SOCKET sockClient = socket(AF_INET, SOCK_STREAM, 0); SOCKADDR_IN addrSrv; addrSrv.sin_addr.S_un.S_addr = inet_addr("127.0.0.1"); addrSrv.sin_family = AF_INET; addrSrv.sin_port = htons(4444); HANDLE fp =CreateFi

asp.net使用Socket.Send发送信息及Socket.SendFile传输文件的方法_实用技巧

本文实例讲述了asp.net使用Socket.Send发送信息及Socket.SendFile传输文件的方法.分享给大家供大家参考,具体如下: // Displays sending with a connected socket // using the overload that takes a buffer. public static int SendReceiveTest1(Socket server) { byte[] msg = Encoding.UTF8.GetBytes("Th

使用Go语言实现远程传输文件_Golang

前言 之前有一篇介绍如何使用Go语言通过SSH协议来执行远程命令:如何使用Go语言实现远程执行命令 同样,通过SSH协议也可以使用Go语言来远程传输文件. 除了 SSH 的库,为了传输文件,还需要用到 github.com/pkg/sftp 这个库. 实现方式 废话不多说,直接看代码. 由于是基于 SSH 协议实现的远程文件传输,所以先创建 SSH 的连接,再创建传输文件的 sftp 客户端. func connect(user, password, host string, port int)