Test environment


https://zhuanlan.zhihu.com/p/170333403
https://muralidba.blogspot.com/2018/04/how-can-i-check-my-network-and-disk-io.html
apt-get install -y netcat-traditionalapt-get install -y iproute2apt-get install -y iperf3
网络性能
使用的是本机的两台Docker-ubuntu测试
本机测试
- iperf3
```shell
/# iperf3 -c 172.17.0.2
Connecting to host 172.17.0.2, port 5201
[ 5] local 172.17.0.3 port 49004 connected to 172.17.0.2 port 5201
[ ID] Interval Transfer Bitrate Retr Cwnd
[ 5] 0.00-1.00 sec 10.9 GBytes 93.8 Gbits/sec 1082 499 KBytes
[ 5] 1.00-2.00 sec 12.0 GBytes 103 Gbits/sec 261 559 KBytes
[ 5] 2.00-3.00 sec 12.1 GBytes 104 Gbits/sec 422 568 KBytes
[ 5] 3.00-4.00 sec 12.1 GBytes 104 Gbits/sec 7 708 KBytes
[ 5] 4.00-5.00 sec 12.1 GBytes 104 Gbits/sec 0 708 KBytes
[ 5] 5.00-6.00 sec 12.3 GBytes 105 Gbits/sec 312 708 KBytes
[ 5] 6.00-7.00 sec 12.2 GBytes 105 Gbits/sec 488 376 KBytes
[ 5] 7.00-8.00 sec 3.77 GBytes 32.4 Gbits/sec 578 420 KBytes
^C[ 5] 8.00-8.12 sec 1.50 GBytes 106 Gbits/sec 157 481 KBytes
[ ID] Interval Transfer Bitrate Retr [ 5] 0.00-8.12 sec 89.0 GBytes 94.2 Gbits/sec 3307 sender [ 5] 0.00-8.12 sec 0.00 Bytes 0.00 bits/sec receiver iperf3: interrupt - the client has terminated
```shell/# iperf3 -s-----------------------------------------------------------Server listening on 5201-----------------------------------------------------------Accepted connection from 172.17.0.3, port 49002[ 5] local 172.17.0.2 port 5201 connected to 172.17.0.3 port 49004[ ID] Interval Transfer Bitrate[ 5] 0.00-1.00 sec 10.9 GBytes 93.8 Gbits/sec[ 5] 1.00-2.00 sec 12.0 GBytes 103 Gbits/sec[ 5] 2.00-3.00 sec 12.1 GBytes 104 Gbits/sec[ 5] 3.00-4.00 sec 12.1 GBytes 104 Gbits/sec[ 5] 4.00-5.00 sec 12.1 GBytes 104 Gbits/sec[ 5] 5.00-6.00 sec 12.3 GBytes 105 Gbits/sec[ 5] 6.00-7.00 sec 12.2 GBytes 105 Gbits/sec[ 5] 7.00-8.00 sec 3.77 GBytes 32.4 Gbits/sec[ 5] 7.00-8.00 sec 3.77 GBytes 32.4 Gbits/sec- - - - - - - - - - - - - - - - - - - - - - - - -[ ID] Interval Transfer Bitrate[ 5] 0.00-8.00 sec 89.0 GBytes 95.6 Gbits/sec receiveriperf3: the client has terminated-----------------------------------------------------------Server listening on 5201
- nc, dd
/# nc -vvlnp 12345 >/dev/nulllistening on [any] 12345 ...connect to [172.17.0.2] from (UNKNOWN) [172.17.0.3] 52648
/# dd if=/dev/zero bs=1M count=1K | nc -vvn 172.17.0.2 12345(UNKNOWN) [172.17.0.2] 12345 (?) open1024+0 records in1024+0 records out1073741824 bytes (1.1 GB, 1.0 GiB) copied, 2.46329 s, 436 MB/s
双机测试
磁盘性能
/home# wget https://mirrors.tuna.tsinghua.edu.cn/ubuntu-releases/xenial/ubuntu-16.04.7-server-amd64.iso/home# ls -ltotal 901124-rw-r--r-- 1 root root 922746880 Aug 10 2020 ubuntu-16.04.7-server-amd64.iso
/home# time nc 172.17.0.2 12345 < ubuntu-16.04.7-server-amd64.iso(UNKNOWN) [172.17.0.2] 12345 (?) : Connection refused
Docker没有打开端口?
/home# dd if=/dev/zero bs=1M count=1K conv=fdatasync of=ubuntu-16.04.7-server-amd64.iso1024+0 records in1024+0 records out1073741824 bytes (1.1 GB, 1.0 GiB) copied, 0.773657 s, 1.4 GB/s
/home# ls -ltotal 1048580-rw-r--r-- 1 root root 1073741824 Feb 15 16:20 ubuntu-16.04.7-server-amd64.isoroot@3f1d5b77f46d:/home# irbirb(main):001:0> 1073741824/0.77365=> 1387890937.7625542irb(main):002:0> 1073741824/0.77365/100000=> 13878.909377625541irb(main):003:0>
