EMQ 问答社区

在EMQ X broker中模拟pub与sub客户端并建立连接

环境信息

  • EMQ X 版本:4.3.1
  • 操作系统及版本:CentOS Linux release 7.9.2009 (Core)
  • 其他

问题描述

模拟了500个pub客户端以及500个sub客户端,每秒5条发送报文为256大小的QoS0的消息,并启用了websocket作为连接协议,但在启动sub时出现了 EXIT for {shutdown,tcp_closed} 报错

配置文件及日志

pub设置及输出:

[root@host20 emqtt-bench]# ./emqtt_bench pub -t Topic -h 192.168.30.20 -s 256 -q 0 -c 500 -I 200 -true
connected: 91
sent(1000): total=184, rate=184(msg/sec)
pub(1001): total=184, rate=184(msg/sec)
connected: 182
sent(2000): total=822, rate=638(msg/sec)
pub(2000): total=823, rate=639(msg/sec)
connected: 273
sent(3001): total=1916, rate=1094(msg/sec)
pub(3001): total=1917, rate=1094(msg/sec)
connected: 364
sent(4001): total=3464, rate=1548(msg/sec)
pub(4001): total=3465, rate=1548(msg/sec)
connected: 455
sent(5001): total=5466, rate=2002(msg/sec)
pub(5001): total=5466, rate=2001(msg/sec)
connected: 500
sent(6001): total=7885, rate=2419(msg/sec)
pub(6001): total=7889, rate=2423(msg/sec)
sent(7001): total=10385, rate=2500(msg/sec)
pub(7001): total=10389, rate=2500(msg/sec)
sent(8001): total=12885, rate=2500(msg/sec)
pub(8001): total=12889, rate=2500(msg/sec)
sent(9001): total=15385, rate=2500(msg/sec)
pub(9001): total=15387, rate=2498(msg/sec)
sent(10001): total=17885, rate=2500(msg/sec)
pub(10001): total=17886, rate=2499(msg/sec)
sent(11001): total=20385, rate=2500(msg/sec)
pub(11001): total=20388, rate=2502(msg/sec)
sent(12001): total=22885, rate=2500(msg/sec)
pub(12001): total=22888, rate=2500(msg/sec)
sent(13001): total=25386, rate=2501(msg/sec)
pub(13001): total=25389, rate=2501(msg/sec)
sent(14001): total=27885, rate=2499(msg/sec)
pub(14001): total=27889, rate=2500(msg/sec)

sub设置及输出:

[root@host20 emqtt-bench]# ./emqtt_bench sub -t Topic -h 192.168.30.20 -c 500
connected: 91
recv(1000): total=114612, rate=114612(msg/sec)
sub(1000): total=91, rate=91(msg/sec)
connected: 182
recv(2001): total=457171, rate=342559(msg/sec)
sub(2001): total=182, rate=91(msg/sec)
connected: 273
recv(3001): total=1026011, rate=568840(msg/sec)
sub(3001): total=273, rate=91(msg/sec)
connected: 363
recv(4001): total=1820848, rate=794837(msg/sec)
sub(4001): total=363, rate=90(msg/sec)
connected: 452
recv(5001): total=2833680, rate=1012832(msg/sec)
sub(5001): total=451, rate=88(msg/sec)
connected: 500
recv(6001): total=4046494, rate=1212814(msg/sec)
sub(6001): total=500, rate=49(msg/sec)
recv(7001): total=4806798, rate=760304(msg/sec)
recv(8001): total=5481081, rate=674283(msg/sec)
recv(9001): total=6282115, rate=801034(msg/sec)
recv(10001): total=7057470, rate=775355(msg/sec)
recv(11001): total=7809948, rate=752478(msg/sec)
client(926): EXIT for {shutdown,tcp_closed}
client(950): EXIT for {shutdown,tcp_closed}
client(974): EXIT for {shutdown,tcp_closed}
client(808): EXIT for {shutdown,tcp_closed}
client(894): EXIT for {shutdown,tcp_closed}
recv(12001): total=8625526, rate=815578(msg/sec)
client(876): EXIT for {shutdown,tcp_closed}
client(875): EXIT for {shutdown,tcp_closed}
client(681): EXIT for {shutdown,tcp_closed}
client(907): EXIT for {shutdown,tcp_closed}
client(870): EXIT for {shutdown,tcp_closed}
client(919): EXIT for {shutdown,tcp_closed}
client(877): EXIT for {shutdown,tcp_closed}
client(843): EXIT for {shutdown,tcp_closed}
client(917): EXIT for {shutdown,tcp_closed}
client(954): EXIT for {shutdown,tcp_closed}
client(935): EXIT for {shutdown,tcp_closed}

看下 EMQ X 这边有没有什么错误日志?

搞定了,加个port号就好了 :sweat: