otis95 / supermq

High-Performance MQTT Server and MQTT cluster
23 stars 10 forks source link

最多能连接多少客户端 #1

Open waytai opened 6 years ago

waytai commented 6 years ago

hello,这个最多能连接多少客户端?

otis95 commented 6 years ago

你好,很抱歉!这个集群mqtt的测试我还没做过。测试完毕 我第一时间告诉你。

waytai commented 6 years ago

我用mqttbox测试是连不上的,用mqttfx测试能连上

otis95 commented 6 years ago

是支持mqtt3.1的。mqttbox我没有使用过。我客户端连接都是使用paho的。

waytai commented 6 years ago

对mqttbox支持需要修改那些么?

otis95 commented 6 years ago

mqttbox我没使用过,我看一下吧,到时候有什么修改@你。

waytai commented 6 years ago

好的,谢谢

waytai commented 6 years ago

测试了一下,用mqttbox,client设置成短的字符串是可以的,但是如果是bdd13592-03d9-41ca-9f3c-ec3cb95090c2这样的话,就出问题了

waytai commented 6 years ago

建议去掉message/connect.go下面的针对客户端的正则表达式,去掉了就支持mqttbox了

otis95 commented 6 years ago

你好,mqtt v3.1.1版本是有要求对clientid做限制的。若client的版本是v3.1.1的话,其connnect报文的version会为0x4,程序这边就会对clientid做限制的。若version为0x3,程序就不会限制clientid了。

otis95 commented 6 years ago

这个应该是tcp长时间连接没有发心跳,出现超时吧。

waytai commented 6 years ago

会自动断掉不?

otis95 commented 6 years ago

不会的。你这边是集群之间出现这个问题 还是 普通client连接?

waytai commented 6 years ago

没用集群,普通的。另外你这个mqtt会转16进制的message?

otis95 commented 6 years ago

不会,就是二进制传的

waytai commented 6 years ago

在离线或者last will 怎么订阅?

yinjiaoyuan commented 5 years ago

请问这个单机情况下最大客户端连接数有结果了吗?另外问一下用什么工具做这个压力测试?谢谢

otis95 commented 5 years ago

抱歉! 因为工作比较忙 我也没时间测试,周末有空我把这个测试补上!

bcw104 commented 5 years ago

@578157900 单节点我测点了一下可以支持 500 个客户端连接,600 个就有数据丢失了,用这个工具做的测试: https://github.com/inovex/mqtt-stresser

Configuration

Concurrent Clients: 500 Messages / Client: 75000

Results

Published Messages: 75000 (100%) Received Messages: 75000 (100%) Completed: 500 (100%) Errors: 0 (0%)

Publishing Throughput

Fastest: 15001 msg/sec Slowest: 355 msg/sec Median: 2222 msg/sec

< 1819 msg/sec 45% < 3284 msg/sec 64% < 4749 msg/sec 80% < 6213 msg/sec 90% < 7678 msg/sec 93% < 9143 msg/sec 98% < 10607 msg/sec 99% < 12072 msg/sec 100% < 13537 msg/sec 100% < 16466 msg/sec 100%

Receiving Througput

Fastest: 2679 msg/sec Slowest: 39 msg/sec Median: 70 msg/sec

< 303 msg/sec 94% < 567 msg/sec 99% < 1095 msg/sec 99% < 1359 msg/sec 100% < 1623 msg/sec 100% < 2943 msg/sec 100%

otis95 commented 5 years ago

请问下,您的机器是什么配置的?

bcw104 commented 5 years ago

@578157900 7 代 i7 的 thinkpad , 修正一下,这个测试跟一些参数有关系,我还没有完全搞清楚, -rampup-delay 500ms 是可以达到 500 的,但每秒处理的消息数量大概在 15000 左右,客户端连接数应该不是瓶颈所在,主要看每秒能处理的消息数量

bcw104 commented 5 years ago

linux 下面的性能貌似比 windows 要高不少,我在一台 i5 的设备上测试,性能要比 i7 windows 要高一些

otis95 commented 5 years ago

每个msg的字节大小 也会影响每秒处理消息数的。

bcw104 commented 5 years ago

是的,这个包还是比较小的,如果改大一些每秒处理能力还会下降,一般的消息包,每秒可以处理 1 万个,不太清楚为什么就卡在这个上面了, CPU 占用也不高,内存也才几百 M ,但性能已经上不去了

bcw104 commented 5 years ago

@578157900 方便加一下 QQ 或微信吗,可以进一步交流下

otis95 commented 5 years ago

微信直接搜我的这个账户 578157900