http认证有时候会断开

环境

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

日志:
2023-07-06T07:48:20.052670+00:00 [error] msg: http_connector_get_status_failed, mfa: emqx_connector_http:do_get_status/2, line: 422, reason: closed, worker: <0.3533.0>
2023-07-06T07:48:20.053131+00:00 [warning] msg: alarm_is_activated, mfa: emqx_alarm:do_actions/3, line: 416, message: <<“resource down: emqx_authn_http:14”>>, name: <<“emqx_authn_http:14”>>
2023-07-06T07:48:20.053361+00:00 [warning] msg: health_check_failed, mfa: emqx_resource_manager:handle_connected_health_check/1, line: 555, id: <<“emqx_authn_http:14”>>, status: disconnected
2023-07-06T07:49:20.055402+00:00 [warning] msg: alarm_is_deactivated, mfa: emqx_alarm:do_actions/3, line: 422, name: <<“emqx_authn_http:14”>>

请问这个断开除了是http server的原因,和http认证的设置有关系嘛,我们目前的设置如下:
Pool size : 8
连接超时: 5
HTTP 管道:100
请求超时: 5

如果同时有大量设备进行连接的话,这个设置是不是太小了

超时时间设置的太短了,可以设置的稍微长点

超时时间5s会太短吗,我们的http server的响应应该不会这么慢的

这段错误之前还有其他 http 相关的错误么,这里看起来就是 HTTP 请求失败导致的

这个时间点其他http相关的日志没有了,而且这个07:48:20时间点我们的http server没有收到任何认证或者授权的http请求,然后07:49:20又开始收到认证的请求,但是http server在这段时间应该是正常的,还有其他日志打印,请问这是什么原因呢

这个时间点左右全部的错误日志
2023-07-06T07:42:13.758317+00:00 [error] msg: unexpected_sock_close, mfa: emqx_channel:handle_info/2, line: 1266, peername: 115.236.50.8:60516, clientid: 60a6f0246cff4d8599222a4e83185704, reason: tcp_closed
2023-07-06T07:42:13.758480+00:00 [error] msg: unexpected_sock_close, mfa: emqx_channel:handle_info/2, line: 1266, peername: 115.236.50.8:60516, clientid: 60a6f0246cff4d8599222a4e83185704, reason: einval
2023-07-06T07:42:13.758598+00:00 [error] msg: unexpected_sock_close, mfa: emqx_channel:handle_info/2, line: 1266, peername: 115.236.50.8:60516, clientid: 60a6f0246cff4d8599222a4e83185704, reason: einval
2023-07-06T07:48:20.052670+00:00 [error] msg: http_connector_get_status_failed, mfa: emqx_connector_http:do_get_status/2, line: 422, reason: closed, worker: <0.3533.0>
2023-07-06T07:48:20.053131+00:00 [warning] msg: alarm_is_activated, mfa: emqx_alarm:do_actions/3, line: 416, message: <<“resource down: emqx_authn_http:14”>>, name: <<“emqx_authn_http:14”>>
2023-07-06T07:48:20.053361+00:00 [warning] msg: health_check_failed, mfa: emqx_resource_manager:handle_connected_health_check/1, line: 555, id: <<“emqx_authn_http:14”>>, status: disconnected
2023-07-06T07:49:20.055402+00:00 [warning] msg: alarm_is_deactivated, mfa: emqx_alarm:do_actions/3, line: 422, name: <<“emqx_authn_http:14”>>
2023-07-06T07:49:36.024672+00:00 [error] msg: unexpected_sock_close, mfa: emqx_channel:handle_info/2, line: 1266, peername: 115.236.50.8:46298, clientid: 60a6f0246cff4d8599222a4e83185704, reason: tcp_closed
2023-07-06T07:49:36.024838+00:00 [error] msg: unexpected_sock_close, mfa: emqx_channel:handle_info/2, line: 1266, peername: 115.236.50.8:46298, clientid: 60a6f0246cff4d8599222a4e83185704, reason: einval

从这里的日志来看,应该是你的 web server 关闭了 HTTP 请求。
另外可能的原因是最大打开文件数可能是 1024 等较小的值,导致端口打开失败

检查过发现最大文件打开数设置的65535,请问还会有别的原因吗,emqx请求http server是通过本地127.0.0.1的方式,应该也不会存在网络波动的情况