https://github.com/wxiao1002/mqtt-bench
MQTT client for bench broker.MQTT Broker 发布消息测试工具
https://github.com/wxiao1002/mqtt-bench
benchmarking iot mqtt-benchmark mqtt-client mqtt-protocol
Last synced: 5 months ago
JSON representation
MQTT client for bench broker.MQTT Broker 发布消息测试工具
- Host: GitHub
- URL: https://github.com/wxiao1002/mqtt-bench
- Owner: wxiao1002
- License: apache-2.0
- Created: 2023-04-18T06:49:08.000Z (about 3 years ago)
- Default Branch: main
- Last Pushed: 2023-09-21T01:49:02.000Z (almost 3 years ago)
- Last Synced: 2024-01-29T18:14:20.505Z (over 2 years ago)
- Topics: benchmarking, iot, mqtt-benchmark, mqtt-client, mqtt-protocol
- Language: Go
- Homepage:
- Size: 54.7 KB
- Stars: 2
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README-en.md
- License: LICENSE
Awesome Lists containing this project
README
# MQTT Bench
MQTT publish message test tool
## Quick start
### Compiled package
- Download the corresponding version of the package through https://github.com/wxiao1002/mqtt-bench/releases
- Run and pass in parameters, the following is a linux demonstration
```
./mqtt-bench-linux -csvPath /root/clients.csv -broker tcp://localhost:1883 -clients 1000 -benchmarkTime 20 -messageInterval 1
```
- The above demonstration is to read the /root/clients.csv file to parse the username and password, generate 1000 clients and connect to tcp://localhost:1883, and publish a message at a frequency of 1 second for 20 minutes
### Source code running
- git clone https://github.com/wxiao1002/mqtt-bench.git
- run the code
```
go run main.go -csvPath /root/clients.csv -broker tcp://localhost:1883 -clients 1000 -benchmarkTime 20 -messageInterval 1
```
### Parameter analysis
- broker: mqtt broker address
- csvPath: read user password address, first column user, second column password
- clients: how many connections are created, the number read by csv is greater than or equal to this value
- benchmarkTime: pressure test time, starting from minute
- messageInterval: the time interval for producing messages, in seconds
- topic: publish topic, if it is empty, it will be api/{username}/attributes, username is a placeholder and will be automatically replaced with username
# operation result
[](https://imgse.com/i/pPdN091)
# packaging
- sh build/linux.sh
- sh build/linux_arm.sh
- sh build/windows.sh