JUST DO IT ~

我只想当个程序员

网络命令 iperf vnstat scp


网络测试
安装:
 sudo apt install iperf 
 brew install  iperf 

 ~~~~~~~~~~~~~~~~~~~~~
tcp 测试
服务器:
            iperf -s 

客户端: 
            iperf -c   服务ip

udp 测试
server :
                 iperf -s -u 
client :

                 iperf -c ip  -u

                 iperf -c ip -u  -i 10 -f m

-u 使用udp 

-i  间隔报告时间

-f m 显示M单位 

-n 长度  发送特定长度 
-t  1000 发送时间持续1000秒
 






~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
scp 命令

拷贝到远程机器
scp solarized.zip  gao@10.0.0.124:~


从远程拷贝本地

scp -r root@192.168.120.204:/opt/soft/mongodb /opt/soft/


~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
监控网卡带宽

sudo api install vnstat 

brew install vnstat    

http://humdi.net/vnstat/
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
参考:

iperf vnstat  网络监控入门
http://www.yangchenyun.com/2012/02/measure-network-performance/

每天一个linux命令scp
http://www.cnblogs.com/peida/archive/2013/03/07/2947326.html



~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

/usr/local/Cellar/coreutils/8.23_1/bin> iperf --help

Usage: iperf [-s|-c host] [options]

       iperf [-h|--help] [-v|--version]


Client/Server:

  -f, --format    [kmKM]   format to report: Kbits, Mbits, KBytes, MBytes

  -i, --interval  #        seconds between periodic bandwidth reports---------> 多少秒 分段 报告

  -l, --len       #[KM]    length of buffer to read or write (default 8 KB)

  -m, --print_mss          print TCP maximum segment size (MTU - TCP/IP header)

  -o, --output    <filename> output the report or error message to this specified file

  -p, --port      #        server port to listen on/connect to

  -u, --udp                use UDP rather than TCP

  -w, --window    #[KM]    TCP window size (socket buffer size)

  -B, --bind      <host>   bind to <host>, an interface or multicast address

  -C, --compatibility      for use with older versions does not sent extra msgs

  -M, --mss       #        set TCP maximum segment size (MTU - 40 bytes)

  -N, --nodelay            set TCP no delay, disabling Nagle's Algorithm

  -V, --IPv6Version        Set the domain to IPv6


Server specific:

  -s, --server             run in server mode

  -U, --single_udp         run in single threaded UDP mode

  -D, --daemon             run the server as a daemon


Client specific:

  -b, --bandwidth #[KM]    for UDP, bandwidth to send at in bits/sec

                           (default 1 Mbit/sec, implies -u)

  -c, --client    <host>   run in client mode, connecting to <host>

  -d, --dualtest           Do a bidirectional test simultaneously

  -n, --num       #[KM]    number of bytes to transmit (instead of -t)  --------> 发送长度

  -r, --tradeoff           Do a bidirectional test individually

  -t, --time      #        time in seconds to transmit for (default 10 secs)   ------>   每秒发送次数 

  -F, --fileinput <name>   input the data to be transmitted from a file

  -I, --stdin              input the data to be transmitted from stdin

  -L, --listenport #       port to receive bidirectional tests back on

  -P, --parallel  #        number of parallel client threads to run

  -T, --ttl       #        time-to-live, for multicast (default 1)

  -Z, --linux-congestion <algo>  set TCP congestion control algorithm (Linux only)


Miscellaneous:

  -x, --reportexclude [CDMSV]   exclude C(connection) D(data) M(multicast) S(settings) V(server) reports

  -y, --reportstyle C      report as a Comma-Separated Values

  -h, --help               print this message and quit

  -v, --version            print version information and quit


[KM] Indicates options that support a K or M suffix for kilo- or mega-


The TCP window size option can be set by the environment variable

TCP_WINDOW_SIZE. Most other options can be set by an environment variable

IPERF_<long option name>, such as IPERF_BANDWIDTH.


Report bugs to <iperf-users@lists.sourceforge.net>

/usr/local/Cellar/coreutils/8.23_1/bin> 


posted on 2015-05-01 22:43 小高 阅读(361) 评论(0)  编辑  收藏 所属分类: LinuxMac OSXGUN命令


只有注册用户登录后才能发表评论。


网站导航:
 

导航

<2015年5月>
262728293012
3456789
10111213141516
17181920212223
24252627282930
31123456

统计

常用链接

留言簿(3)

随笔分类(352)

收藏夹(19)

关注的blog

手册

搜索

积分与排名

最新评论

阅读排行榜

评论排行榜