conn_congestion频繁告警,订阅端连接后立即断开

环境

  • EMQX 版本:5.0.21
  • 操作系统版本:centos

(1)conn_congestion频繁告警
2024-12-16T19:29:17.338399+08:00 [warning] msg: alarm_is_activated, mfa: emqx_alarm:do_actions/3, line: 416, message: <<"connection congested: #{buffer => 4096,clientid => <<"172.20.0.36_7116182459584348773">>,conn_state => connected,connected_at => 1734348547840,high_msgq_watermark => 8192,high_watermark => 1048576,memory => 29720,message_queue_len => 0,peername => <<"172.20.0.1:58162">>,pid => <<"<0.10188.0>">>,proto_name => <<"MQTT">>,proto_ver => 5,recbuf => 374400,recv_cnt => 2,recv_oct "…>>, name: <<“conn_congestion/172.20.0.36_7116182459584348773/admin”>>

(2)日志追踪:MQTT_CLIENT_ASYNC_172.20.0.36_7116182459584348773,连接上后立即断开
2024-12-16T19:31:02+08:00 [MQTT] MQTT_CLIENT_ASYNC_172.20.0.36_7116182459584348773@172.20.0.1:59790 msg: mqtt_packet_received, packet: CONNECT(Q0, R0, D0, ClientId=MQTT_CLIENT_ASYNC_172.20.0.36_7116182459584348773, ProtoName=MQTT, ProtoVsn=5, CleanStart=true, KeepAlive=60, Username=admin, Password=******)
2024-12-16T19:31:02+08:00 [MQTT] MQTT_CLIENT_ASYNC_172.20.0.36_7116182459584348773@172.20.0.1:59790 msg: mqtt_packet_sent, packet: CONNACK(Q0, R0, D0, AckFlags=0, ReasonCode=0)
2024-12-16T19:31:58+08:00 [MQTT] MQTT_CLIENT_ASYNC_172.20.0.36_7116182459584348773@172.20.0.1:59790 msg: mqtt_packet_received, packet: DISCONNECT(Q0, R0, D0, ReasonCode=0)
2024-12-16T19:31:58+08:00 [SOCKET] MQTT_CLIENT_ASYNC_172.20.0.36_7116182459584348773@172.20.0.1:59790 msg: socket_force_closed, reason: normal
2024-12-16T19:31:58+08:00 [SOCKET] MQTT_CLIENT_ASYNC_172.20.0.36_7116182459584348773@172.20.0.1:59790 msg: emqx_connection_terminated, reason: {shutdown,normal}

  1. conn_congestion 这个是因为下面连上来就断开引起的,重连太频繁了。
  2. msg: busy_port, 说明这个连接肯定在传输很多消息。
  3. 日志追踪:里面只是连上来后,没看到消息就断开了。综合 2 可以看出,他肯定是有很多的消息在消息队列和飞行窗口的会话里面,一上线就会把没有发送的这些消息发给他,然后他消化不了,就断开了 tcp 连接。

可以查看一下客户端的日志,看是不是收到很多消息然后处理不过来后断开了。

您好,请问下面的message_queue_len的值是不是就是积压的未处理的消息数量:


是的。

请问对于这种情况,配置里可以增加或设置哪些参数

已经 5W 条消息没有处理了,改配置还不影响功能已经不可能了。
你可以适当减少一下

好的,感谢

你好,咨询下,这里的clean Start已经设置为true,理论上重连后,会建立新的会话,为啥旧会话的飞行窗口和消息队列的数据还会给重连后的客户端?

你好,我没有研究过这个,可以问一下官方大佬

环境

  • EMQX 版本:5.0.21
  • 操作系统版本:centos

客户端连接异常

2025-01-04T11:46:51.953611+08:00 [warning] msg: alarm_is_activated, mfa: emqx_alarm:do_actions/3, line: 416, message: <<"connection congested: #{buffer => 4096,clientid => <<\"99d89b7a-3a10-4380-a774-b978cef5152e\">>,conn_state => connected,connected_at => 1735962409822,high_msgq_watermark => 8192,high_watermark => 1048576,memory => 26864,message_queue_len => 0,peername => <<\"172.20.0.1:44464\">>,pid => <<\"<0.32146.7>\">>,proto_name => <<\"MQTT\">>,proto_ver => 4,recbuf => 374400,recv_cnt"...>>, name: <<"conn_congestion/99d89b7a-3a10-4380-a774-b978cef5152e/admin">>

论坛里找找这个关键字