精彩评论
- al2359(2年前 (2023-02-06))
求科学离线插件,谢谢!34401355@qq.com
评:改版梅林固件安装SS【shadowsocks】科学上网插件教程 - al2359(2年前 (2023-02-06))
求科学离线插件,谢谢!!!
评:改版梅林固件安装SS【shadowsocks】科学上网插件教程
Iperf3 是一个网络性能测试工具。Iperf可以测试最大TCP和UDP带宽性能,具有多种参数和UDP特性,可以根据需要调整,可以报告带宽、延迟抖动和数据包丢失.对于每个测试,它都会报告带宽,丢包和其他参数,可在Windows、Mac OS X、Linux、FreeBSD、移动终端等各种平台使用,是一个简单又实用的小工具。
1.在VPS上安装Iperf3:
#在 Debian/Ubuntu 上使用下列命令安装:
apt-get install -y iperf3
2.在PC端下载Iperf3:
根据自己情况下载对应版本即可
https://iperf.fr/iperf-download.php
3.在vps上开启Iperf3程序:
首先通过SSH连接VPS,也可使用screen窗口打开,-p后面替换为想要开启测试的端口号
4.在PC端开始测试:
首先打开刚才下好的那个Iperf3文件夹,在最上面输入cmd,进入dos窗口。
5.输入测速指令:
把xxx替换为你要测试的VPS的IP,-p后面替换为想要开启测试的端口号
6.如何看测试结果:
以上指令为连续10次测速,你只需要看开头为[sum]的数字就行,这个数字是你直接和vps裸连的测试时的数据,不代表你科学上网的速度,也不代表是你和vps永远都是这个速度。
背景
在做性能测试网络带宽多大是听运维的还是自己测试过,今天介绍一款常用测试网络工具iperf3,做性能测试一切用数据说话。iperf3是用来测量一个网络最大带宽的工具。它支持调节各种参数比如发送持续时间,发送/接收缓存,通信协议。每次测试,它都会报告网络带宽,丢包率和其他参数。
安装:
下载相应版本
https://iperf.fr/iperf-downlo...
Linux之centos7安装方法
yum install iperf3.x86_64 -y
win下载解压
在地址栏中敲cmd就能打开cmd窗口:
显示该目录:
linux启动服务端 iper3 -s
查看linux中的ip地址为:
打开wind命令行
iperf3 -c 192.168.128.128 -p 5201 -i 1 -t 10 -w 111K
从下图可看出本机与虚拟机是1000MBytes局域网
client端输出:
客户端命令解释:
-c表示服务器的IP地址;
-p表示服务器的端口号;
-i设置每次报告之间的时间间隔,单位为秒,如果设置为非零值,就会按照此时间间隔输出测试报告,默认值为零;
-t设置传输的总时间,Iperf在指定的时间内,重复的发送指定长度的数据包,默认是10秒钟;
-w设置套接字缓冲区为指定大小,对于TCP方式,此设置为TCP窗口大小,对于UDP方式,此设置为接受UDP数据包的缓冲区大小,限制可以接受数据包的最大值。
Linux窗口显示:
server端输出:
以上是测试压力机与服务器之前的网络带宽简单方法,大家做性能测试是否也是这样确定网络带宽大小。
分享一个HashMap和Hashtable的区别
共同点:
底层都是哈希算法,都是双列集合
区别:
1、HashMap是线程不安全的,效率高, Hashtable是线程安全的,效率低
2、HashMap可以存储null键和null值 Hashtable不可以存储null键和null值
測試網路速度是否為理想狀況時,一般利網路芳鄰、FTP傳軟來達成測試的目地,但如果需要重覆測試時,這樣的測法可能比較沒有效率了,所以iperf這樣的工具對於測試網路傳輸的速度來說就較方便。iPerf3已釋出,此篇文章前半段維持iPerf2內容,增加後半段補充iPerf3的測試紀錄,iPerf2/3這兩個版本並不相容,但都能測試出網路效能,依照你的軟體環境及測試環境選擇版本,客戶端與伺服端的版本必需要相同。
官網中有各種版本提供使用,選擇好你要使用的環境下載並解壓就能使用。
示範中使用Windows環境測試,所以下載Iperf 2.0.5-2,接下來就開始看下去該怎麼使用。
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.
將上面的整理一下,將Server、Client共通歸類一起做說明,其他的再分開解釋。
參數說明
-s 啟動server模式,例如:iperf -s
-c 啟動client模式,命令後接server的位址,例如:iperf -c 192.168.1.3
通用參數
-f [k|m|K|M] 報告結果顯示的單位,以Kbits, Mbits, KBytes, MBytes,例如:iperf -c 192.168.1.3 -f K
-i sec 報告顯示的時間間隔(以秒為單位),例如:iperf -c 192.168.1.3 -i 2
-l [KM] 緩衝區大小,預設是8KB,例如:iperf -c 192.168.1.3 -l 16
-m 顯示MTU最大值
-o 將報告與錯誤信息輸出到檔案,例如:iperf -c 192.168.1.3 -o c:\iperf-log.txt
-p server使用的連接埠或client使用的連接埠,兩端連接埠要一致,例如:iperf -s -p 9999
-u 使用udp通訊規格
-w 指定TCP框架大小,預設是8KB
-B 綁定一個主機地址,可以是介面或是廣播位址,當主機端同時有很多位址時才需要綁定
-C 相容舊版本(兩端版本不致時使用)
-M 設定TCP封包的最大MTU值
-N 設定TCP不延時
-V 傳輸ipv6資料封包
server專用
-D 背景服務方式運行,例如:iperf -s -D
-U 使用單一執行緒使用UDp模式
client專用
-b UDP測試專用,可以設定每秒傳送的速度
-d 同時進行雙向傳輸測試
-n 指定傳輸的大小,例如: iperf -c 192.168.1.3 -n 100000
-r 單獨進行雙向傳輸測試
-t 測試時間長度,預設10秒,例如: iperf -c 192.168.1.3 -t 5
-F 使用指定檔案來傳輸
-I 使用stdin方式當做傳輸內容
-T 指定ttl值
使用iperf需要要有2台電腦,一台為serve端,另一台為client端,測試環境使用windows環境與Giga網路來當做示範,分為Server與Client。
Server端的命令預設非常的簡單,只要執行
iperf –s
如下圖就開始運作。
Client端設定比較多,主要是看你要選擇怎麼樣的測試方式,示範中使用下面的命令:
iperf –c 192.168.3.58 –w 100M –t 120 –i 10
解釋一下:
-c 192.168.3.58 :Server端的IP
-w 100M :測試的檔案大小
-t 120:監視測量數據時間為120秒
-i 10:每隔10秒將數據顯示出來
$
依照所執行的命令需要測約120秒左右時間,看到下圖結果報告顯示總共測試從0.0~121.3秒,傳輸9.28GByte,
平均速度(Bandwidth)約在657Mbits/sec之間,對於Giga環境已經發揮6成的速度,這在Giga環境下測試的值並不是理想值,測試時必需要關閉一些網路軟體或是內建的QoS機制才有可能發揮到極速,所以速度並沒有我第一次在測試時平均可以跑到800Mbits/sec。
iPerf約莫許久後終於發行3.0版本,通稱為iPerf3,其舊的2.0版本稱iPerf2,如你要使用iPerf3新版本測試網路效能時,客戶端與伺服器端版本必需要都是iPerf3才能完成測試,這點官網有提到iPerf3 is not backwards compatible with iPerf2.,其他參數可以依照前半段文章不需要做變更就能繼續測試。
iPerf目前支援更多平台,前往官網下載頁面下載,後面測試的版本使用iPerf 3.1.3
下面舉出使用iPerf3進行客戶端與伺服器配測試的紀錄檔供參考。
客戶端使用Windows,而伺服器端使用Arch Linux
D:\iperf-3.1.3-win64>iperf3 -c 192.168.16.200 -w 100M -t 120 -i 10
Connecting to host 192.168.16.200, port 5201
[ 4] local 192.168.16.223 port 58573 connected to 192.168.16.200 port 5201
[ ID] Interval Transfer Bandwidth
[ 4] 0.00-10.00 sec 1.20 GBytes 1.03 Gbits/sec
[ 4] 10.00-20.00 sec 1.10 GBytes 947 Mbits/sec
[ 4] 20.00-30.00 sec 1.10 GBytes 947 Mbits/sec
[ 4] 30.00-40.00 sec 1.10 GBytes 947 Mbits/sec
[ 4] 40.00-50.00 sec 1.10 GBytes 948 Mbits/sec
[ 4] 50.00-60.00 sec 1.10 GBytes 948 Mbits/sec
[ 4] 60.00-70.00 sec 1.10 GBytes 945 Mbits/sec
[ 4] 70.00-80.00 sec 1.10 GBytes 946 Mbits/sec
[ 4] 80.00-90.00 sec 1.10 GBytes 947 Mbits/sec
[ 4] 90.00-100.00 sec 1.10 GBytes 947 Mbits/sec
[ 4] 100.00-110.00 sec 1.10 GBytes 947 Mbits/sec
[ 4] 110.00-120.00 sec 1.10 GBytes 947 Mbits/sec
- - - - - - - - - - - - - - - - - - - - - - - - -
[ ID] Interval Transfer Bandwidth
[ 4] 0.00-120.00 sec 13.3 GBytes 954 Mbits/sec sender
[ 4] 0.00-120.00 sec 13.2 GBytes 947 Mbits/sec receiver
iperf Done.
因剛好沒有2台Windows供測試,伺服器端使用Arch Linux
[danny@lab-p5e-vm ~]$ iperf3 -s
--------------------------------------------------[danny@lab-p5e-vm ~]---------
Server listening on 5201
-----------------------------------------------------------
Accepted connection from 192.168.16.223, port 58572
[ 5] local 192.168.16.200 port 5201 connected to 192.168.16.223 port 58573
[ ID] Interval Transfer Bandwidth
[ 5] 0.00-1.00 sec 108 MBytes 903 Mbits/sec
[ 5] 1.00-2.00 sec 113 MBytes 948 Mbits/sec
[ 5] 2.00-3.00 sec 113 MBytes 948 Mbits/sec
[ 5] 3.00-4.00 sec 113 MBytes 948 Mbits/sec
[ 5] 4.00-5.00 sec 113 MBytes 947 Mbits/sec
[ 5] 5.00-6.00 sec 113 MBytes 948 Mbits/sec
[ 5] 6.00-7.00 sec 113 MBytes 949 Mbits/sec
[ 5] 7.00-8.00 sec 113 MBytes 945 Mbits/sec
[ 5] 8.00-9.00 sec 113 MBytes 944 Mbits/sec
[ 5] 9.00-10.00 sec 113 MBytes 949 Mbits/sec
[ 5] 10.00-11.00 sec 113 MBytes 947 Mbits/sec
[ 5] 11.00-12.00 sec 113 MBytes 949 Mbits/sec
[ 5] 12.00-13.00 sec 113 MBytes 946 Mbits/sec
[ 5] 13.00-14.00 sec 113 MBytes 949 Mbits/sec
[ 5] 14.00-15.00 sec 113 MBytes 949 Mbits/sec
[ 5] 15.00-16.00 sec 113 MBytes 947 Mbits/sec
[ 5] 16.00-17.00 sec 112 MBytes 941 Mbits/sec
[ 5] 17.00-18.00 sec 113 MBytes 949 Mbits/sec
[ 5] 18.00-19.00 sec 113 MBytes 944 Mbits/sec
[ 5] 19.00-20.00 sec 113 MBytes 949 Mbits/sec
[ 5] 20.00-21.00 sec 113 MBytes 947 Mbits/sec
[ 5] 21.00-22.00 sec 113 MBytes 948 Mbits/sec
[ 5] 22.00-23.00 sec 113 MBytes 949 Mbits/sec
[ 5] 23.00-24.00 sec 113 MBytes 947 Mbits/sec
[ 5] 24.00-25.00 sec 113 MBytes 946 Mbits/sec
[ 5] 25.00-26.00 sec 113 MBytes 949 Mbits/sec
[ 5] 26.00-27.00 sec 113 MBytes 948 Mbits/sec
[ 5] 27.00-28.00 sec 113 MBytes 947 Mbits/sec
[ 5] 28.00-29.00 sec 113 MBytes 949 Mbits/sec
[ 5] 29.00-30.00 sec 111 MBytes 933 Mbits/sec
[ 5] 30.00-31.00 sec 113 MBytes 949 Mbits/sec
[ 5] 31.00-32.00 sec 113 MBytes 947 Mbits/sec
[ 5] 32.00-33.00 sec 113 MBytes 949 Mbits/sec
[ 5] 33.00-34.00 sec 113 MBytes 948 Mbits/sec
[ 5] 34.00-35.00 sec 113 MBytes 944 Mbits/sec
[ 5] 35.00-36.00 sec 113 MBytes 946 Mbits/sec
[ 5] 36.00-37.00 sec 113 MBytes 948 Mbits/sec
[ 5] 37.00-38.00 sec 113 MBytes 944 Mbits/sec
[ 5] 38.00-39.00 sec 113 MBytes 949 Mbits/sec
[ 5] 39.00-40.00 sec 113 MBytes 949 Mbits/sec
[ 5] 40.00-41.00 sec 113 MBytes 947 Mbits/sec
[ 5] 41.00-42.00 sec 113 MBytes 949 Mbits/sec
[ 5] 42.00-43.00 sec 113 MBytes 948 Mbits/sec
[ 5] 43.00-44.00 sec 113 MBytes 948 Mbits/sec
[ 5] 44.00-45.00 sec 113 MBytes 947 Mbits/sec
[ 5] 45.00-46.00 sec 113 MBytes 949 Mbits/sec
[ 5] 46.00-47.00 sec 113 MBytes 949 Mbits/sec
[ 5] 47.00-48.00 sec 113 MBytes 949 Mbits/sec
[ 5] 48.00-49.00 sec 113 MBytes 947 Mbits/sec
[ 5] 49.00-50.00 sec 113 MBytes 945 Mbits/sec
[ 5] 50.00-51.00 sec 113 MBytes 949 Mbits/sec
[ 5] 51.00-52.00 sec 113 MBytes 948 Mbits/sec
[ 5] 52.00-53.00 sec 113 MBytes 948 Mbits/sec
[ 5] 53.00-54.00 sec 113 MBytes 950 Mbits/sec
[ 5] 54.00-55.00 sec 113 MBytes 947 Mbits/sec
[ 5] 55.00-56.00 sec 113 MBytes 948 Mbits/sec
[ 5] 56.00-57.00 sec 113 MBytes 948 Mbits/sec
[ 5] 57.00-58.00 sec 113 MBytes 949 Mbits/sec
[ 5] 58.00-59.00 sec 113 MBytes 948 Mbits/sec
[ 5] 59.00-60.00 sec 113 MBytes 947 Mbits/sec
[ 5] 60.00-61.00 sec 111 MBytes 931 Mbits/sec
[ 5] 61.00-62.00 sec 113 MBytes 946 Mbits/sec
[ 5] 62.00-63.00 sec 112 MBytes 940 Mbits/sec
[ 5] 63.00-64.00 sec 113 MBytes 949 Mbits/sec
[ 5] 64.00-65.00 sec 113 MBytes 947 Mbits/sec
[ 5] 65.00-66.00 sec 113 MBytes 944 Mbits/sec
[ 5] 66.00-67.00 sec 113 MBytes 949 Mbits/sec
[ 5] 67.00-68.00 sec 113 MBytes 948 Mbits/sec
[ 5] 68.00-69.00 sec 113 MBytes 948 Mbits/sec
[ 5] 69.00-70.00 sec 113 MBytes 948 Mbits/sec
[ 5] 70.00-71.00 sec 112 MBytes 942 Mbits/sec
[ 5] 71.00-72.00 sec 113 MBytes 947 Mbits/sec
[ 5] 72.00-73.00 sec 113 MBytes 949 Mbits/sec
[ 5] 73.00-74.00 sec 113 MBytes 948 Mbits/sec
[ 5] 74.00-75.00 sec 113 MBytes 949 Mbits/sec
[ 5] 75.00-76.00 sec 113 MBytes 948 Mbits/sec
[ 5] 76.00-77.00 sec 113 MBytes 948 Mbits/sec
[ 5] 77.00-78.00 sec 113 MBytes 945 Mbits/sec
[ 5] 78.00-79.00 sec 113 MBytes 948 Mbits/sec
[ 5] 79.00-80.00 sec 112 MBytes 937 Mbits/sec
[ 5] 80.00-81.00 sec 113 MBytes 949 Mbits/sec
[ 5] 81.00-82.00 sec 113 MBytes 949 Mbits/sec
[ 5] 82.00-83.00 sec 112 MBytes 941 Mbits/sec
[ 5] 83.00-84.00 sec 113 MBytes 948 Mbits/sec
[ 5] 84.00-85.00 sec 113 MBytes 946 Mbits/sec
[ 5] 85.00-86.00 sec 113 MBytes 948 Mbits/sec
[ 5] 86.00-87.00 sec 113 MBytes 948 Mbits/sec
[ 5] 87.00-88.00 sec 113 MBytes 949 Mbits/sec
[ 5] 88.00-89.00 sec 113 MBytes 948 Mbits/sec
[ 5] 89.00-90.00 sec 113 MBytes 949 Mbits/sec
[ 5] 90.00-91.00 sec 113 MBytes 949 Mbits/sec
[ 5] 91.00-92.00 sec 113 MBytes 948 Mbits/sec
[ 5] 92.00-93.00 sec 113 MBytes 949 Mbits/sec
[ 5] 93.00-94.00 sec 113 MBytes 949 Mbits/sec
[ 5] 94.00-95.00 sec 113 MBytes 945 Mbits/sec
[ 5] 95.00-96.00 sec 113 MBytes 949 Mbits/sec
[ 5] 96.00-97.00 sec 112 MBytes 943 Mbits/sec
[ 5] 97.00-98.00 sec 113 MBytes 945 Mbits/sec
[ 5] 98.00-99.00 sec 113 MBytes 947 Mbits/sec
[ 5] 99.00-100.00 sec 113 MBytes 948 Mbits/sec
[ 5] 100.00-101.00 sec 113 MBytes 948 Mbits/sec
[ 5] 101.00-102.00 sec 113 MBytes 948 Mbits/sec
[ 5] 102.00-103.00 sec 113 MBytes 945 Mbits/sec
[ 5] 103.00-104.00 sec 113 MBytes 947 Mbits/sec
[ 5] 104.00-105.00 sec 113 MBytes 944 Mbits/sec
[ 5] 105.00-106.00 sec 113 MBytes 948 Mbits/sec
[ 5] 106.00-107.00 sec 113 MBytes 948 Mbits/sec
[ 5] 107.00-108.00 sec 113 MBytes 947 Mbits/sec
[ 5] 108.00-109.00 sec 113 MBytes 947 Mbits/sec
[ 5] 109.00-110.00 sec 113 MBytes 946 Mbits/sec
[ 5] 110.00-111.00 sec 113 MBytes 945 Mbits/sec
[ 5] 111.00-112.00 sec 113 MBytes 949 Mbits/sec
[ 5] 112.00-113.00 sec 113 MBytes 949 Mbits/sec
[ 5] 113.00-114.00 sec 113 MBytes 948 Mbits/sec
[ 5] 114.00-115.00 sec 113 MBytes 947 Mbits/sec
[ 5] 115.00-116.00 sec 112 MBytes 940 Mbits/sec
[ 5] 116.00-117.00 sec 113 MBytes 947 Mbits/sec
[ 5] 117.00-118.00 sec 113 MBytes 949 Mbits/sec
[ 5] 118.00-119.00 sec 113 MBytes 949 Mbits/sec
[ 5] 119.00-120.00 sec 113 MBytes 945 Mbits/sec
[ 5] 120.00-120.03 sec 3.39 MBytes 945 Mbits/sec
- - - - - - - - - - - - - - - - - - - - - - - - -
[ ID] Interval Transfer Bandwidth
[ 5] 0.00-120.03 sec 0.00 Bytes 0.00 bits/sec sender
[ 5] 0.00-120.03 sec 13.2 GBytes 947 Mbits/sec receiver
-----------------------------------------------------------
Server listening on 5201
-----------------------------------------------------------
從舊文章測試擷圖與新文章測試結果也能看到效能上的差異,其中舊文章使用的是介面卡的網路卡,而新增加的是使用內建的網路卡,使用的Switch Hub是一樣的,效能上面能看到一些差距。
「梦想一旦被付诸行动,就会变得神圣,如果觉得我的文章对您有用,请帮助本站成长」
上一篇:西藏未解的十二大神秘事件!
求科学离线插件,谢谢!34401355@qq.com
评:改版梅林固件安装SS【shadowsocks】科学上网插件教程求科学离线插件,谢谢!!!
评:改版梅林固件安装SS【shadowsocks】科学上网插件教程