Code Monkey home page Code Monkey logo

dperf's Introduction

dperf Apache V2 License

English | 中文

dperf is a DPDK based 100Gbps network performance and load testing software.

Advantage

  • High performance:
    • Based on DPDK, dperf can generate huge traffic with a single x86 server: tens of millions of HTTP CPS,hundreds of Gbps throughput and billions of concurrent connections.
  • Detailed statistics:
    • Provides detailed statistics and identify every packet loss.
  • Support multiple scenarios:
    • Load testing and stability testing for Layer 4 Load Balancer and other Layer 4 gateways
    • Network performance testing for servers on cloud
    • Performance test of network package processing capability for NIC and CPU
    • Can be used as a high performance HTTP server or client for load testing

Performance

HTTP Connections per Second

Client Cores Server Cores HTTP CPS
1 1 2,101,044
2 2 4,000,423
4 4 7,010,743
6 6 10,027,172

HTTP Throughput per Second

Client Cores Server Cores RX(Gbps) TX(Gbps) Client CPU Usage(%) Server CPU Usage(%)
1 1 18 18 60 59
2 2 35 35 60 59
4 4 46 46 43 43

HTTP Current Connections

Client Cores Server Cores Current Connections Client CPU Usage(%) Server CPU Usage(%)
1 1 100,000,000 34 39
2 2 200,000,000 36 39
4 4 400,000,000 40 41

UDP TX PPS

Client Cores TX MPPS Client CPU Usage(%)
1 15.96 95
2 29.95 95
4 34.92 67
6 35.92 54
8 37.12 22

Note: this test is under one 25Gbps Mellanox CX4

Client & Server Configuration

Above performance is obtained with below configurations:

  • MEM: 512GB(hugepage 100GB)
  • NIC: Mellanox MT27710 25Gbps * 2
  • Kernel: 4.19.90

Statistics

dperf outputs various statistics every second:

  • TPS, CPS, various PPS
  • Errors of TCP/Socket/HTTP
  • Packets loss/drop
  • Retransmissions of TCP Flags
seconds 22                 cpuUsage 52
pktRx   3,001,058          pktTx    3,001,025          bitsRx   2,272,799,040      bitsTx  1,920,657,600      dropTx  0
arpRx   0                  arpTx    0                  icmpRx   0                  icmpTx  0                  otherRx 0          badRx 0
synRx   1,000,345          synTx    1,000,330          finRx    1,000,350          finTx   1,000,350          rstRx   0          rstTx 0
synRt   0                  finRt    0                  ackRt    0                  pushRt  0                  tcpDrop 0
skOpen  1,000,330          skClose  1,000,363          skCon    230                skErr   0
httpGet 1,000,345          http2XX  1,000,350          httpErr  0
ierrors 0                  oerrors  0                  imissed  0

Getting Started

Set hugepages

#edit '/boot/grub2/grub.cfg' like this, and reboot the OS
linux16 /vmlinuz-... nopku transparent_hugepage=never default_hugepagesz=1G hugepagesz=1G hugepages=8

Build DPDK

#edit 'config/common_base' to enable PMDs
#Mellanox CX4/CX5 requires 'CONFIG_RTE_LIBRTE_MLX5_PMD=y'
#HNS3 requires 'CONFIG_RTE_LIBRTE_HNS3_PMD=y'
#VMXNET3 requires 'CONFIG_RTE_LIBRTE_VMXNET3_PMD=y'

TARGET=x86_64-native-linuxapp-gcc #or arm64-armv8a-linuxapp-gcc

cd /root/dpdk/dpdk-stable-19.11.10
make install T=$TARGET -j16

Build dperf

cd dperf
make -j8 RTE_SDK=/root/dpdk/dpdk-stable-19.11.10 RTE_TARGET=$TARGET

Bind interface

#Mellanox NIC skip this step!
#Suppose your PCI number is 0000:1b:00.0

modprobe uio
modprobe uio_pci_generic
/root/dpdk/dpdk-stable-19.11.10/usertools/dpdk-devbind.py -b uio_pci_generic 0000:1b:00.0

Start dperf server

#dperf server bind at 6.6.241.27:80,  gateway is 6.6.241.1
./build/dperf -c test/http/server-cps.conf

Send request from a client

#the client IP must be in the range of 'client' in the configuration file
ping 6.6.241.27
curl http://6.6.241.27/

Running the tests

Below example will start a HTTP CPS stress test. #run dperf server ./build/dperf -c test/http/server-cps.conf

#from another host, run dperf client
./build/dperf -c test/http/client-cps.conf

Documentation

See the website at https://dperf.org/.

Limitation

  • dperf requires that the HTTP message is in one packet, which is not suitable for the test of layer 7 load balancer;
  • dperf requires exclusive use of the network interfaces.
  • dperf does not have routing capability. It is recommended to build a test environment with a switch.

Contributing

dperf welcomes your contribution. See the CONTRIBUTING file for details.

Author

  • Jianzhang Peng, a Ph.D. graduate in Computer Science from the University of Science and Technology of China, served as a Principal Engineer at both Huawei and Baidu. He participated in the development of 7-layer and 4-layer load balancing systems. During his tenure at Baidu, he developed the dperf project. Even after leaving Baidu, he remains dedicated to the maintenance of the dperf project. Currently, he works in Singapore, focusing on researching and implementing low-latency network systems for high-frequency crypto quantitative trading.

Support

Thank you for considering supporting the dperf project, which is maintained by Jianzhang Peng. We are committed to providing a high-performance network load tester. Your sponsorship will help him maintain the project, address issues, and continually enhance its features.

License

dperf is distributed under the Apache License, Version 2.0.

dperf's People

Contributors

amberlipp avatar cchuancey avatar clarinette9 avatar crezov avatar digger-yu avatar pengjianzhang avatar sheva7777 avatar zhangpengfei-xyz avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

dperf's Issues

[help] ./build/dperf -c test/http/server-cps.conf 启动报错

[root@localhost dperf-main]# ./build/dperf -c test/http/server-cps.conf
EAL: Detected 4 lcore(s)
EAL: Detected 1 NUMA nodes
EAL: Multi-process socket /var/run/dpdk/rte/mp_socket
EAL: Selected IOVA mode 'PA'
EAL: Probing VFIO support...
port init fail
dpdk init fail

bad gateway

two physical machine with intel nic 82599,they connect directly no swither
one machine ip addr 1.1.1.1,the other one is 1.1.1.3

./build/dperf -c test/http/client-cps-82599.conf

EAL: Detected 56 lcore(s)
EAL: Detected 2 NUMA nodes
EAL: Multi-process socket /var/run/dpdk/rte/mp_socket
EAL: Selected IOVA mode 'PA'
EAL: No available hugepages reported in hugepages-1048576kB
EAL: Probing VFIO support...
EAL: PCI device 0000:af:00.0 on NUMA socket 1
EAL: probe driver: 8086:10fb net_ixgbe
socket allocation succeeded, size 0.01GB num 131070
bad gateway

file client-cps-82599.conf content show below:
mode client
cpu 0
duration 60s
cps 10k
port 0000:af:00.0 1.1.1.1 1.1.1.3
client 1.1.1.1 2
server 1.1.1.3 1
listen 80 1

dperf测试client统计是否存在问题

用了dperf测试cps,有几个问题想问一下。
client端一开始发包,前几秒只有发送,server端也没有收到报文,client也没有错误统计。
然后接下来是client端发包出现很多skErr统计
然后接下来才是正常收发新建统计正常了。
分别可以看下面的图:
图片
图片
图片

为啥 server.c 里面没什么代码?

麻烦问一下,咱们这个项目,为啥 server.c 里面没什么代码?看您在design-CN.md里面的描述,github上的项目代码,是要当作客户端来使用是吗?用来测试服务器到底能承受多大的压力

dperf client supports HTTP; Testing nginx with dperf!! Try it!

  1. In the internal network, packet loss and disorder are unlikely to occur
  2. The message conforms to HTTP format and dperf does not need to check
  3. Only HTTP is supported, HTTPS is not supported
  4. Support testing nginx

pull request #116

mode client
cpu 0
protocol http
duration 1d
keepalive 1ms
http_host localhost
http_path /file/16k

cps 1
cc 8

port 0000:00:04.0 172.16.192.111 172.16.199.174

client 172.16.192.111 1
server 172.16.199.174 1
listen 80 1

Release v1.1.0

Main Featrues:

  • VXLAN
  • show latency(RTT)
  • RSS. support NICs without FDIR
  • Support DPDK-21.11, DPDK-22.03
  • bond
  • kni
  • jumbo frame
  • TCP/UDP flood and without FDIR
  • server close idle sockets
  • quiet: turn off output statistics
  • tcp rst on or off
  • allow server ip num to be less than cpu number
  • wait stage
  • specify packet size
  • tos

kni

For: bgp、ospf、ssh

pull request #36

[help] Fix a bug on intel X710

我的client配置:

mode                        client
tx_burst                    128
launch_num                  10
cpu                         2 4 6 8

payload_size                341
duration                    2m

cps                         1000000
cc                          1000000
keepalive_request_interval  1ms

#port                       pci             addr      gateway    [mac]
port                        0000:19:00.0    192.168.100.62  192.168.100.63  70:c7:f2:de:b3:34

#                           addr_start      num
client                      192.168.100.1    50

#                           addr_start      num
server                      192.168.100.63    4
#                           port_start      num
listen                      80              32

server配置:

#daemon
mode            server
tx_burst        128
cpu             2 4 6 8

duration        2m
payload_size    341
keepalive       1

port            0000:1a:00.0    192.168.100.63    192.168.100.62  e4:43:4b:5c:e5:10

#               addr_start      num
client          192.168.100.1    50

#               addr_start      num
server          192.168.100.63   4

#               port_start      num
listen          80              32

测试结果:
server显示:

seconds 86                 cpuUsage 98  0   0   0   
pktRx   7,074,688          pktTx    7,074,682          bitsRx   3,395,861,856      bitsTx  3,056,262,624      dropTx  0         
arpRx   0                  arpTx    0                  icmpRx   0                  icmpTx  0                  otherRx 1          badRx 0         
synRx   0                  synTx    0                  finRx    0                  finTx   0                  rstRx   0          rstTx 7,074,682 
synRt   0                  finRt    0                  ackRt    0                  pushRt  0                  tcpDrop 0                 
skOpen  0                  skClose  0                  skCon    250,190            skErr   0                 
httpGet 0                  http2XX  0                  httpErr  0                 
ierrors 0                  oerrors  0                  imissed  20,097,229 

client端显示:

seconds 74                 cpuUsage 89  1   1   1   
pktRx   7,086,922          pktTx    7,424,515          bitsRx   3,401,732,328      bitsTx  3,218,193,680      dropTx  0         
arpRx   0                  arpTx    0                  icmpRx   0                  icmpTx  0                  otherRx 2          badRx 0         
synRx   0                  synTx    337,600            finRx    0                  finTx   0                  rstRx   0          rstTx 7,086,915 
synRt   337,600            finRt    0                  ackRt    0                  pushRt  0                  tcpDrop 0                 
skOpen  0                  skClose  92,040             skCon    907,960            skErr   92,040            
httpGet 0                  http2XX  0                  httpErr  0                 
ierrors 0                  oerrors  0                  imissed  409,862 

cpu利用率很不均匀,带宽也不够。

是否支持100G网卡?

1》使用的是什么dpdk版本?
2》是否支持100G网卡?支持的哪些厂家的什么类型的网卡?(Mellanox,博通??)

Dpdk 20

dpdk-stable-20.11.5 installing :

....
Installing lib/librte_kni.a to /home/dpdk-stable-20.11.5/mydpdk/lib/x86_64-linux-gnu
Installing lib/librte_kni.so.21.0 to /home/dpdk-stable-20.11.5/mydpdk/lib/x86_64-linux-gnu
Installing lib/librte_latencystats.a to /home/dpdk-stable-20.11.5/mydpdk/lib/x86_64-linux-gnu
...

check "librte_kni.so.21" file

dpdk/dpdk-stable-20.11.5/mydpdk/lib/x86_64-linux-gnu# ls -lh | grep librte_kni.so
lrwxrwxrwx 1 root root 16 4月 27 16:53 librte_kni.so -> librte_kni.so.21
lrwxrwxrwx 1 root root 18 4月 27 16:53 librte_kni.so.21 -> librte_kni.so.21.0
-rwxr-xr-x 1 root root 32K 4月 27 16:53 librte_kni.so.21.0

build dperf :

export PKG_CONFIG_PATH=dpdk/dpdk-stable-20.11.5/mydpdk/lib/x86_64-linux-gnu/pkgconfig/

The way you give : "dpdk/dpdk-stable-20.11.2/mydpdk/lib64/pkgconfig/"
cd dperf
make

use dperf

./dperf: error while loading shared libraries: librte_kni.so.21: cannot open shared object file: No such file or directory

I will change dpdk 20.11.5 to 20.11.2, tks.

客户端连不上服务端

服务启动信息如下:
[root@localhost dperf-main]# ./build/dperf -c test/http/server-cps.conf
EAL: Detected 2 lcore(s)
EAL: Detected 1 NUMA nodes
EAL: Multi-process socket /var/run/dpdk/rte/mp_socket
EAL: Selected IOVA mode 'PA'
EAL: No available hugepages reported in hugepages-1048576kB
EAL: Probing VFIO support...
EAL: PCI device 0000:00:14.0 on NUMA socket -1
EAL: probe driver: 8086:100e net_e1000_em
socket allocation succeeded, size 0.01GB num 131070
Get gateway's MAC address successfully

seconds 0 cpuUsage 0
pktRx 0 pktTx 0 bitsRx 0 bitsTx 0 dropTx 0
arpRx 0 arpTx 0 icmpRx 0 icmpTx 0 otherRx 0 badRx 0
synRx 0 synTx 0 finRx 0 finTx 0 rstRx 0 rstTx 0
synRt 0 finRt 0 ackRt 0 pushRt 0 tcpDrop 0
skOpen 0 skClose 0 skCon 0 skErr 0
httpGet 0 http2XX 0 httpErr 0
ierrors 0 oerrors 0 imissed 0

获取网关地址:
16:55:23.121987 ARP, Request who-has 6.6.241.1 tell 6.6.241.11, length 46
16:55:23.121989 ARP, Request who-has 6.6.241.1 tell 6.6.241.11, length 46
16:55:23.121990 ARP, Reply 6.6.241.1 is-at 66:fe:68:7e:19:25, length 46
16:55:23.121992 ARP, Reply 6.6.241.1 is-at 66:fe:68:7e:19:25, length 46

请求 http://6.6.241.11 连接超时,客户端使用连接不上服务

使用版本如下:
dpdk-stable-19.11.11
dperf-main 最新代码

感谢!!!@pengjianzhang

dperf启动失败,求帮助

hello,我想用dperf来测试一下dpvs的cps性能,安装完成后启动server失败
./build/dperf -c test/http/server-cps.conf
EAL: Detected 64 lcore(s)
EAL: Detected 2 NUMA nodes
EAL: Multi-process socket /var/run/dpdk/rte/mp_socket
EAL: Selected IOVA mode 'VA'
EAL: Probing VFIO support...
EAL: VFIO support initialized
port init fail
dpdk init fail

大页内存已配置:
cat /proc/meminfo | grep Huge
AnonHugePages: 77824 kB
ShmemHugePages: 0 kB
FileHugePages: 0 kB
HugePages_Total: 49
HugePages_Free: 48
HugePages_Rsvd: 0
HugePages_Surp: 0
Hugepagesize: 1048576 kB

网卡:
mlx cx4

dpdk版本:
19.11.10

内核版本:
5.4

one port used multiple network addrs,how config client.conf and server.conf?

  • such as:
192.168.33.241--->192.168.66.241
192.168.44.241--->192.168.88.241
  • client.conf example:
    one port used multiple network addrs,
#port           pci             addr         gateway
port            0000:01:00.1    192.168.33.241   192.168.33.211
port            0000:01:00.1    192.168.44.241   192.168.44.211
  • server.conf example:
    one port used multiple network addrs,
#port           pci             addr         gateway
port            0000:02:00.1    192.168.66.241   192.168.66.211
port            0000:02:00.1    192.168.88.241   192.168.88.211

LVS性能测试CPS只达到20w/s

拓扑:
dclient: 3.10.0-1160.49.1.el7.x86_64/内存64G/10G网卡1
dserver: 3.10.0-1160.49.1.el7.x86_64/内存64G/10G网卡
1
lvs: 5.6.2-1.el7.elrepo.x86_64cx/内存64G/10G网卡*2,一内一外

lvs配置:共提供80-89端口
virtual_server 192.168.90.100 80 {
delay_loop 6
lb_algo rr
lb_kind NAT
persistence_timeout 0
protocol TCP
real_server 192.168.80.101 80 {
weight 1
}
}
..........................

dclient配置:
mode client
tx_burst 128
launch_num 10
cpu 0
payload_size 1
duration 2m
cps 200k
port 0000:82:00.0 192.168.90.10 192.168.90.1 bc:97:e1:e7:3e:a0
client 192.168.90.11 20
server 192.168.90.100 1
listen 80 10

dserver配置:
mode server
tx_burst 128
cpu 0
duration 10m
payload_size 1
keepalive 1
port 0000:03:00.1 192.168.80.101 192.168.80.1 bc:97:e1:e7:3e:a1
client 192.168.80.1 150
client 192.168.90.1 150
server 192.168.80.101 1
listen 80 10

结果CPS大概能到20w左右,如果再高就会出现很多skErr,tcpDrop
seconds 255 cpuUsage 13
pktRx 800,284 pktTx 600,218 bitsRx 492,970,520 bitsTx 441,750,464 dropTx 0
arpRx 0 arpTx 0 icmpRx 0 icmpTx 0 otherRx 2 badRx 0
synRx 200,054 synTx 200,054 finRx 200,102 finTx 200,102 rstRx 0 rstTx 0
synRt 0 finRt 0 ackRt 0 pushRt 0 tcpDrop 0
skOpen 200,054 skClose 200,064 skCon 183,601 skErr 0
httpGet 200,062 http2XX 200,062 httpErr 0
ierrors 0 oerrors 0 imissed 350

能帮忙分析一下CPS没有达到50w左右的原因吗,内存不够?网卡带宽不够?LVS设备需要一些调优手段?dclient直接到dserver至少能测试到百万级的cps能力,可能跟我分配的大页内存有限有关,但也能排除了这两个点的嫌疑,压力肯定够了,问题应该出现在LVS这个点上。

The sample CC performance conf is faulty, as the client cannot receive packets

client conf:

#port pci addr gateway [mac]
port 0000:01:00.0 6.6.245.3 6.6.245.1 b4:a9:fc:ab:7a:85
# addr_start num
client 6.6.245.3 100

The client is configured with 100 IPs, but only one port is configured, and cannot receive packets back other than the port-bound IP.
The socket was not successfully established and could not continue sending packets on the socket, and the socket on the server side was closed after a timeout.

Another problem is that this configuration does not match the documentation.
https://github.com/baidu/dperf/blob/main/docs/configuration-CN.md#client

发送包的保存功能

请问两台服务器互打http时,能不能将发的包以某种形式保存在文件里呢,我目前的研究需要记录每个包的五元组(srcip, dstip, srcport, dstport, protocol)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.