最後更新: 2024-10-04
目錄
- Linux Version
- Windows Version
Linux Version
https://github.com/microsoft/ntttcp-for-linux
Compile
mkdir /usr/src/ntttcp; cd /usr/src/ntttcp wget https://github.com/microsoft/ntttcp-for-linux/archive/refs/tags/1.4.0.ta... tar -zxf 1.4.0.tar.gz cd ntttcp-for-linux-1.4.0/src apt install build-essential # gcc, make make cp ntttcp /usr/local/bin
Help
ntttcp -h
Linux Version Usage
Receiver(-r)
# -V Verbose mode
# -r Run as a receiver
ntttcp -r -V
Or
ntttcp
The default settings
- 5000/TCP, 5001~5016/TCP # 16 ports
- 16 threads created and run across all CPUs,
- allocating 64K receiver buffer
- run for 60 seconds
Sender(-s)
ntttcp -V -s IP
The default settings
- Server port starting at 5001/TCP
- 64 threads created and run across all CPUs
- 4 threads per each receiver port
-
connections per each sender thread: 1
connections = (16 x 4 threads x 1) - sender socket buffer: 128K
- run for 60 seconds
Example 2(-H, -W, -t)
18:00:13 INFO: Test cycle time negotiated is: 60 seconds
Receiver
-H # [receiver only]
# hold receiver always running even after one test finished(可作多次測試)
# 使用後會無視 -t 到時的 exit
ntttcp -H
Sender
-t N # duration in seconds / negotiated time
# 當 Sender 及 Receiver 都有會使用 -t 時, 會使用較大的 -t (Default: 60)
-W N # Warm-up time in seconds [default: 0]
# 總測試時間: 3 + 120
ntttcp -W -t 120 -s 192.168.33.21
Example 3
Receiver
-P # Number of ports listening on receiver side [default: 16] [max: 512]
receiver only settings
-e # use "epoll()" instead of "select()"
./ntttcp -V -W 3 -P 64 -H -e
Sender
-P # Number of ports listening on receiver side [default: 16] [max: 512]
Sender only settings
-n number of threads per each receiver port [default: 4] [max: 25600]
-l number of connections per each sender thread [default: 1] [max: 1000]
ntttcp -V -W 3 -P 64 -n 2 -l 4 -s 192.168.33.21
# ports(-P) x threads(-n) x connections per threads(-l) connections: 64 X 2 X 4
Other Opts
-K NIC
-p N # Destination port number, or starting port number [default: 5001]
sync port: 'destination port - 1/TCP' [default: 5000/TCP]
-f N # Fixed source port number, or starting port number [default: 25001]
-u # UDP mode (不建議使用)
mapping(-m) # Windows syntax
NumberOfReceiverPorts(Threads),Processor,ReceiverAddress(IP)
NumberOfReceiverPorts(-P): 16(default) ~ 512
Processor: *, 0, 1, etc
e.g.
ntttcp -s -m 16,*,IP
Windows Version
https://github.com/microsoft/ntttcp/
Windows Firewall
netsh advfirewall firewall add rule program=c:\tools\ntttcp.exe name="ntttcp" protocol=any dir=in action=allow enable=yes profile=ANY
* To run throughput tests between a Windows and a Linux, 必須使用 no-sync mode
- Linux flag: -N
- Windows flag:-ns