All Projects → daoshenzzg → mqtt-mock

daoshenzzg / mqtt-mock

Licence: other
mqtt压测工具。支持subscribe、publish压测方式,支持模拟客户端连接数。

Programming Languages

go
31211 projects - #10 most used programming language

Projects that are alternatives of or similar to mqtt-mock

Mqtt Pwn
MQTT-PWN intends to be a one-stop-shop for IoT Broker penetration-testing and security assessment operations.
Stars: ✭ 156 (+100%)
Mutual labels:  mqtt, mqtt-client
Mqttclient
A high-performance, high-stability, cross-platform MQTT client, developed based on the socket API, can be used on embedded devices (FreeRTOS / LiteOS / RT-Thread / TencentOS tiny), Linux, Windows, Mac, with a very concise The API interface realizes the quality of service of QOS2 with very few resources, and seamlessly connects the mbedtls encryption library.
Stars: ✭ 234 (+200%)
Mutual labels:  mqtt, mqtt-client
Mqttnet
MQTTnet is a high performance .NET library for MQTT based communication. It provides a MQTT client and a MQTT server (broker). The implementation is based on the documentation from http://mqtt.org/.
Stars: ✭ 2,486 (+3087.18%)
Mutual labels:  mqtt, mqtt-client
Mqttandroidclient
Android消息推送MQTT
Stars: ✭ 131 (+67.95%)
Mutual labels:  mqtt, mqtt-client
mqttools
MQTT version 5.0 client and broker using asyncio
Stars: ✭ 44 (-43.59%)
Mutual labels:  mqtt, mqtt-client
Mqtt Client Framework
iOS, macOS, tvOS native ObjectiveC MQTT Client Framework
Stars: ✭ 1,722 (+2107.69%)
Mutual labels:  mqtt, mqtt-client
Tsung
Tsung is a high-performance benchmark framework for various protocols including HTTP, XMPP, LDAP, etc.
Stars: ✭ 2,185 (+2701.28%)
Mutual labels:  mqtt, benchmark
Tuya Mqtt
Nodejs-Script to combine tuyaapi and openhab via mqtt
Stars: ✭ 105 (+34.62%)
Mutual labels:  mqtt, mqtt-client
Emqtt
Erlang MQTT v5.0 Client
Stars: ✭ 253 (+224.36%)
Mutual labels:  mqtt, mqtt-client
Android Mqtt Service
A simple MQTT Service that will keep running for the duration of your Android application using the Paho Java MQTT Client.
Stars: ✭ 238 (+205.13%)
Mutual labels:  mqtt, mqtt-client
Coogleiot
A ESP8266 Library for easy IOT device development
Stars: ✭ 118 (+51.28%)
Mutual labels:  mqtt, mqtt-client
mqtt-datasource
MQTT Datasource for Grafana allows streaming data from any MQTT broker running either locally or remotely.
Stars: ✭ 99 (+26.92%)
Mutual labels:  mqtt, mqtt-client
Paho.mqtt.java
Eclipse Paho Java MQTT client library. Paho is an Eclipse IoT project.
Stars: ✭ 1,620 (+1976.92%)
Mutual labels:  mqtt, mqtt-client
Mqtt
Asynchronous MQTT client for PHP based on workerman.
Stars: ✭ 142 (+82.05%)
Mutual labels:  mqtt, mqtt-client
Applozic Ios Sdk
iOS Real Time Chat & Messaging SDK
Stars: ✭ 104 (+33.33%)
Mutual labels:  mqtt, mqtt-client
Broadlink Mqtt
MQTT client to control BroadLink devices
Stars: ✭ 169 (+116.67%)
Mutual labels:  mqtt, mqtt-client
Psmqtt
Utility reporting system health and status via MQTT
Stars: ✭ 95 (+21.79%)
Mutual labels:  mqtt, mqtt-client
Ntex Mqtt
MQTT Client/Server framework for v5 and v3.1.1 protocols
Stars: ✭ 95 (+21.79%)
Mutual labels:  mqtt, mqtt-client
Iot Harbor
reactor3实现的mqtt库
Stars: ✭ 234 (+200%)
Mutual labels:  mqtt, mqtt-client
CODESYS-MQTT
MQTT client library for CODESYS, supporting all QoS
Stars: ✭ 63 (-19.23%)
Mutual labels:  mqtt, mqtt-client

MQTT-Mock: MQTT Benchmark Tool

这是一个使用golang实现的mqtt客户端压测工具. 目前可支持Publish、Subscribe以及模拟指定数量客户端连接。 用于压测socket单broker能支撑多少连接数、下行消息、上行消息推送能力。

开始准备

Use go get and go build

go get github.com/daoshenzzg/mqtt-mock
cd ../mqtt-mock/src; go build mqtt-mock.go

使用说明

Usage: ./mqtt-mock [-broker <broker>] [-action <action>] [-topic <topic>] [-c <client number, default 20>] [-n <message number, default 100>] [-size <message size, default 1024>] [-username <username>] [-password <password>] [-qos <qos, default 0>] [-debug <debug, default false>]
  -action string
    	Publish or Subscribe or Subscribe(with publishing) (required) (default "pub or sub")
  -broker string
    	URI(tcp://{ip}:{port}) of MQTT broker (required)
  -c int
    	Number of clients (default 20)
  -debug
    	Debug mode
  -n int
    	Number of message to Publish or receive (default 100)
  -password string
    	Password for connecting to the MQTT broker (default "123456")
  -qos int
    	MQTT QoS(0|1|2)
  -size int
    	Message size per publish (byte) (default 1024)
  -topic string
    	Base topic (default "mqtt-mock/benchmark/")
  -username string
    	Username for connecting to the MQTT broker (default "admin")

模拟 Subscribe

./mqtt-mock -broker "tcp://127.0.0.1:8000" -c 2000 -n 500000 -action sub
Mock Info:
	broker:       tcp://127.0.0.1:8000
	c:            2000
	n:            500000
	username:     admin
	password:     123456
	topic:        mqtt-mock/benchmark/
	qos:          0
	debug:        false
2019/01/30 16:46:42 Throughput=16357.00(messages/sec)
2019/01/30 16:46:43 Throughput=39642.00(messages/sec)
2019/01/30 16:46:44 Throughput=35999.00(messages/sec)
...
2019/01/30 16:46:52 Throughput=38009.00(messages/sec)
2019/01/30 16:46:53 Throughput=36383.00(messages/sec)
2019/01/30 16:46:54 Throughput=37597.00(messages/sec)
2019/01/30 16:46:54 Finish subscribe mock! total=500000 cost=13s Throughput=38461.54(messages/sec)

模拟 Publish

./mqtt-mock -broker "tcp://127.0.0.1:8000" -c 200 -n 500000 -size 64 -action pub
Mock Info:
	broker:       tcp://127.0.0.1:8000
	c:            200
	n:            500000
	size:         1
	username:     admin
	password:     123456
	topic:        mqtt-mock/benchmark/
	qos:          0
	debug:        false
2019/01/31 11:10:56 100000 messages has been published.
2019/01/31 11:10:59 200000 messages has been published.
2019/01/31 11:11:02 300000 messages has been published.
2019/01/31 11:11:04 400000 messages has been published.
2019/01/31 11:11:07 500000 messages has been published.
2019/01/31 11:11:07 Finish publish mock! total=500000 cost=14s Throughput=35714.29(messages/sec)

模拟 Connection clients

./mqtt-mock -broker "tcp://127.0.0.1:8000" -c 10000 -n 1 -action sub -debug true
Mock Info:
	broker:       tcp://127.0.0.1:8000
	c:            10000
	n:            1
	username:     admin
	password:     123456
	topic:        mqtt-mock/benchmark/
	qos:          0
	debug:        true
2019/01/28 15:33:06 Connected : clientId= mqttmock-15ea9-1
2019/01/28 15:33:06 Connected : clientId= mqttmock-15ea9-2
...
2019/01/28 15:33:06 Connected : clientId= mqttmock-15ea9-9999
2019/01/28 15:33:06 Connected : clientId= mqttmock-15ea9-10000

压测Server

参考项目

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].