EMQ 问答社区

4.3版本1300速率连接,emqx 报了Socket error: einval

问题描述

20w初始连接数
在1300/s 每秒连接速率时,后台日志会出现Socket error: einval错误。
在1200/s 每秒连接速率时,后台日志没有错误。
在1300/s 每秒连接速率时,错误率93.72%

机器配置是8cpu 32G,2台
阿里云SLB做负载均衡,mqtt走ssl认证
emqx两个broker,都开启了exhook。每一个连接请求会有一个onClientAuthenticate和两次onClientCheckAcl认证。

环境信息

  • EMQ X 版本:4.3.0
  • 操作系统及版本:Ubuntu20.04
  • 其他

相应的配置文件内容


详细日志


2021-05-11T17:16:19.995360+08:00 [error] device_282897949@10.2.5.2:40238 [MQTT] Socket error: einval
2021-05-11T17:16:20.046178+08:00 [error] device_282915383@10.2.5.2:10604 [MQTT] Socket error: einval
2021-05-11T17:16:19.826449+08:00 [error] device_282915277@10.2.5.2:10392 [MQTT] Socket error: einval
2021-05-11T17:16:19.341304+08:00 [error] device_282901607@10.2.5.2:47556 [MQTT] Socket error: einval
2021-05-11T17:16:19.969807+08:00 [error] device_282921002@10.2.5.2:21842 [MQTT] Socket error: einval
2021-05-11T17:16:19.959781+08:00 [error] device_282897925@10.2.5.2:40190 [MQTT] Socket error: einval
2021-05-11T17:16:20.051237+08:00 [error] device_282898193@10.2.5.2:40726 [MQTT] Socket error: einval
2021-05-11T17:16:19.997208+08:00 [error] device_391889064@10.2.5.252:16824 [MQTT] Socket error: einval
2021-05-11T17:16:19.999536+08:00 [error] device_391889065@10.2.5.252:16826 [MQTT] Socket error: einval
2021-05-11T17:16:19.970667+08:00 [error] device_391939090@10.2.5.1:57144 [MQTT] Socket error: einval
2021-05-11T17:16:20.052452+08:00 [error] device_391889289@10.2.5.252:17276 [MQTT] Socket error: einval
2021-05-11T17:16:20.052978+08:00 [error] device_391889024@10.2.5.252:16744 [MQTT] Socket error: einval
2021-05-11T17:16:19.997164+08:00 [error] device_391968224@10.2.5.1:50920 [MQTT] Socket error: einval
2021-05-11T17:16:20.053207+08:00 [error] device_391939163@10.2.5.1:57290 [MQTT] Socket error: einval
2021-05-11T17:16:20.053941+08:00 [error] device_391939162@10.2.5.1:57288 [MQTT] Socket error: einval
2021-05-11T17:16:18.327891+08:00 [error] device_391863187@10.2.5.2:26021 [MQTT] Socket error: einval
2021-05-11T17:16:20.054771+08:00 [error] device_391889107@10.2.5.252:16910 [MQTT] Socket error: einval
2021-05-11T17:16:20.054892+08:00 [error] device_391889198@10.2.5.252:17092 [MQTT] Socket error: einval
2021-05-11T17:16:20.055191+08:00 [error] device_282898040@10.2.5.2:40420 [MQTT] Socket error: einval
2021-05-11T17:16:20.057120+08:00 [error] device_282898052@10.2.5.2:40444 [MQTT] Socket error: einval
2021-05-11T17:16:20.048377+08:00 [error] device_282915432@10.2.5.2:10702 [MQTT] Socket error: einval
2021-05-11T17:16:20.058196+08:00 [error] device_282897978@10.2.5.2:40296 [MQTT] Socket error: einval
2021-05-11T17:16:20.005144+08:00 [error] device_391889189@10.2.5.252:17074 [MQTT] Socket error: einval
2021-05-11T17:16:20.006773+08:00 [error] device_282898000@10.2.5.2:40340 [MQTT] Socket error: einval
2021-05-11T17:16:20.006082+08:00 [error] device_282898017@10.2.5.2:40374 [MQTT] Socket error: einval
2021-05-11T17:16:20.008203+08:00 [error] device_282897946@10.2.5.2:40232 [MQTT] Socket error: einval
2021-05-11T17:16:20.008300+08:00 [error] device_282897961@10.2.5.2:40262 [MQTT] Socket error: einval
2021-05-11T17:16:20.008620+08:00 [error] device_391889143@10.2.5.252:16982 [MQTT] Socket error: einval

相关截图

如果这些链接只是简单 connect 不是每个连上来都做一个订阅的话,怕是因为 exhook。可以先把 exhook 插件关了试试定位问题。