This is an open-source tool to compare MQTT, CoAP, HTTPs various stats.
UV package and project manager highly recommended and all instructions are provided with the assumption of you having uv.
UV installation and usage guide
Wireshark is needed for this benchmark
Mosquitto is needed for MQTT testing
After installing run uv venv from root directory of this repository
Run source .venv/bin/activate to activate the virtual env
Run uv pip install -r requirements.txt to install the needed packages
Run net start mosquitto or directly from executable to start Mosquitto
Go to the folder of the protocol you want to test(CoAP, HTTP, MQTT)cd data-gather/coap cd data-gather/httpcd data-gather/mqtt
Benchmark script is structred in the following way:
bash run_test_no_cpu.sh <count> <rate> <concurrency>
Count - amount of messages to send
Rate - rate at which to send them
Concurrency - number of proccesses that will do the sending
Example of a benchmark which sends 100 messages at 10 msg/s with 1 concurrent proccess:bash run_test_no_cpu.sh 100 10 1
If you are on and Linux based distro using an Intel CPU you can run the benchmark with additional CPU usage stastics by running run_test.sh insted of run_test_no_cpu.sh
If you ran with no cpu usage stats you will get two files, one text file and one Wireshark file
python3 http_test_receiver.py --port 8080 --count 100
python3 http_test_sender.py --url http://localhost:8080 --rate 10 --payload-size 500
python3 test_aggregator.py --sender sender_report.txt --receiver receiver_report.txt --output results.txt
net start mosquitto
or run directly
C:\Program Files\mosquitto\mosquitto.exe -v
python3 mqtt_receiver.py --broker localhost --port 1883 --topic test/sensor --count 100
python3 mqtt_sender.py --broker localhost --port 1883 --topic test/sensor --count 100 --concurrency 10 --rate 10 --payload-size 500
python3 test_aggregator.py --sender sender_report.txt --receiver receiver_report.txt --output results.txt
python3 coap_receiver.py --host localhost --port 5683 --resource test --count 100
python3 coap_sender.py --host localhost --port 5683 --resource test --count 100 --time 10 --rate 10 --payload-size 500 --concurrency 1
python3 test_aggregator.py --sender sender_report.txt --receiver receiver_report.txt --output results.txt