环境
- EMQX 版本:5.0.26
- 操作系统版本:
CentOS7
重现此问题的步骤
EMQX可以正常启动且正常运行,但每次启动3-5个小时,就会停止运行,DashBoard面板也看不到那种,重新启动又能好3-5小时,发送信息一直是一样的,我看日志中提到了内存占用高,是因为服务器内存过小吗?下面是完整日志:
2023-06-06T10:17:51.510855+08:00 [warning] msg: alarm_is_activated, mfa: emqx_alarm:do_actions/3, line: 418, message: <<“75.10% mem usage”>>, name: high_system_memory_usage
2023-06-06T10:20:51.519933+08:00 [warning] msg: alarm_is_deactivated, mfa: emqx_alarm:do_actions/3, line: 424, name: high_system_memory_usage
2023-06-06T10:22:51.524427+08:00 [warning] msg: alarm_is_activated, mfa: emqx_alarm:do_actions/3, line: 418, message: <<“78.14% mem usage”>>, name: high_system_memory_usage
2023-06-06T16:57:00.553616+08:00 [warning] msg: alarm_is_activated, mfa: emqx_alarm:do_actions/3, line: 418, message: <<“73.30% mem usage”>>, name: high_system_memory_usage
2023-06-06T19:30:01.016113+08:00 [warning] msg: alarm_is_deactivated, mfa: emqx_alarm:do_actions/3, line: 424, name: high_system_memory_usage
2023-06-06T19:32:01.039578+08:00 [warning] msg: alarm_is_activated, mfa: emqx_alarm:do_actions/3, line: 418, message: <<“77.43% mem usage”>>, name: high_system_memory_usage
2023-06-06T21:18:26.391738+08:00 [warning] msg: authorization_permission_denied, mfa: emqx_authz:authorize_non_superuser/5, line: 362, peername: 167.94.138.127:60868, clientid: CENSYS, topic: #, ipaddr: {167,94,138,127}, source: file, username: undefined
2023-06-07T09:35:33.091123+08:00 [warning] msg: alarm_is_activated, mfa: emqx_alarm:do_actions/3, line: 418, message: <<“70.63% mem usage”>>, name: high_system_memory_usage
2023-06-07T14:08:34.659511+08:00 [warning] msg: alarm_is_deactivated, mfa: emqx_alarm:do_actions/3, line: 424, name: high_system_memory_usage
2023-06-07T14:09:34.661941+08:00 [warning] msg: alarm_is_activated, mfa: emqx_alarm:do_actions/3, line: 418, message: <<“71.03% mem usage”>>, name: high_system_memory_usage
2023-06-07T19:58:35.879509+08:00 [error] supervisor: ‘esockd_connection_sup - <0.2291.0>’, errorContext: connection_shutdown, reason: #{header_type => 8,hint => zero_remaining_len}, offender: [{pid,<0.14865.0>},{name,connection},{mfargs,{emqx_connection,start_link,[#{enable_authn => true,limiter => undefined,listener => {tcp,default},zone => default}]}}]
2023-06-07T19:59:17.300200+08:00 [error] supervisor: ‘esockd_connection_sup - <0.2291.0>’, errorContext: connection_shutdown, reason: #{expected => <<“‘MQTT’ or ‘MQIsdp’”>>,hint => invalid_proto_name,received => <<>>}, offender: [{pid,<0.14878.0>},{name,connection},{mfargs,{emqx_connection,start_link,[#{enable_authn => true,limiter => undefined,listener => {tcp,default},zone => default}]}}]
2023-06-07T19:59:23.103517+08:00 [error] supervisor: ‘esockd_connection_sup - <0.2291.0>’, errorContext: connection_shutdown, reason: #{header_type => 0,hint => zero_remaining_len}, offender: [{pid,<0.14880.0>},{name,connection},{mfargs,{emqx_connection,start_link,[#{enable_authn => true,limiter => undefined,listener => {tcp,default},zone => default}]}}]
2023-06-07T19:59:28.705914+08:00 [error] supervisor: ‘esockd_connection_sup - <0.2291.0>’, errorContext: connection_shutdown, reason: #{expected => <<“‘MQTT’ or ‘MQIsdp’”>>,hint => invalid_proto_name,received => <<>>}, offender: [{pid,<0.14882.0>},{name,connection},{mfargs,{emqx_connection,start_link,[#{enable_authn => true,limiter => undefined,listener => {tcp,default},zone => default}]}}]
2023-06-07T19:59:43.715330+08:00 [error] supervisor: ‘esockd_connection_sup - <0.2291.0>’, errorContext: connection_shutdown, reason: #{header_type => 0,hint => zero_remaining_len}, offender: [{pid,<0.14896.0>},{name,connection},{mfargs,{emqx_connection,start_link,[#{enable_authn => true,limiter => undefined,listener => {tcp,default},zone => default}]}}]
2023-06-07T19:59:49.318330+08:00 [error] supervisor: ‘esockd_connection_sup - <0.2291.0>’, errorContext: connection_shutdown, reason: #{header_type => 0,hint => zero_remaining_len}, offender: [{pid,<0.14898.0>},{name,connection},{mfargs,{emqx_connection,start_link,[#{enable_authn => true,limiter => undefined,listener => {tcp,default},zone => default}]}}]
2023-06-07T19:59:55.121180+08:00 [error] supervisor: ‘esockd_connection_sup - <0.2291.0>’, errorContext: connection_shutdown, reason: #{header_type => 6,hint => zero_remaining_len}, offender: [{pid,<0.14900.0>},{name,connection},{mfargs,{emqx_connection,start_link,[#{enable_authn => true,limiter => undefined,listener => {tcp,default},zone => default}]}}]
2023-06-07T20:00:24.138953+08:00 [error] supervisor: ‘esockd_connection_sup - <0.2291.0>’, errorContext: connection_shutdown, reason: #{hint => invalid_topic,parsed_length => 513,remaining_bytes_length => 10}, offender: [{pid,<0.14910.0>},{name,connection},{mfargs,{emqx_connection,start_link,[#{enable_authn => true,limiter => undefined,listener => {tcp,default},zone => default}]}}]
2023-06-07T20:00:45.349930+08:00 [error] supervisor: ‘esockd_connection_sup - <0.2291.0>’, errorContext: connection_shutdown, reason: #{header_type => 0,hint => zero_remaining_len}, offender: [{pid,<0.14924.0>},{name,connection},{mfargs,{emqx_connection,start_link,[#{enable_authn => true,limiter => undefined,listener => {tcp,default},zone => default}]}}]
2023-06-07T20:00:58.957805+08:00 [error] supervisor: ‘esockd_connection_sup - <0.2291.0>’, errorContext: connection_shutdown, reason: #{header_type => 3,hint => zero_remaining_len}, offender: [{pid,<0.14929.0>},{name,connection},{mfargs,{emqx_connection,start_link,[#{enable_authn => true,limiter => undefined,listener => {tcp,default},zone => default}]}}]
2023-06-07T20:01:20.369979+08:00 [error] supervisor: ‘esockd_connection_sup - <0.2291.0>’, errorContext: connection_shutdown, reason: #{header_type => 0,hint => zero_remaining_len}, offender: [{pid,<0.14935.0>},{name,connection},{mfargs,{emqx_connection,start_link,[#{enable_authn => true,limiter => undefined,listener => {tcp,default},zone => default}]}}]
2023-06-07T20:01:33.177398+08:00 [error] supervisor: ‘esockd_connection_sup - <0.2291.0>’, errorContext: connection_shutdown, reason: #{header_type => 0,hint => zero_remaining_len}, offender: [{pid,<0.14940.0>},{name,connection},{mfargs,{emqx_connection,start_link,[#{enable_authn => true,limiter => undefined,listener => {tcp,default},zone => default}]}}]
2023-06-07T20:02:23.404070+08:00 [error] supervisor: ‘esockd_connection_sup - <0.2291.0>’, errorContext: connection_shutdown, reason: #{hint => invalid_proto_name,reason => malformed_utf8_string_length}, offender: [{pid,<0.14964.0>},{name,connection},{mfargs,{emqx_connection,start_link,[#{enable_authn => true,limiter => undefined,listener => {tcp,default},zone => default}]}}]
2023-06-07T20:02:40.302860+08:00 [error] supervisor: ‘esockd_connection_sup - <0.2291.0>’, errorContext: connection_shutdown, reason: #{hint => invalid_proto_name,reason => malformed_utf8_string_length}, offender: [{pid,<0.14978.0>},{name,connection},{mfargs,{emqx_connection,start_link,[#{enable_authn => true,limiter => undefined,listener => {tcp,default},zone => default}]}}]
2023-06-07T20:02:44.416703+08:00 [error] supervisor: ‘esockd_connection_sup - <0.2291.0>’, errorContext: connection_shutdown, reason: #{header_type => 0,hint => zero_remaining_len}, offender: [{pid,<0.14979.0>},{name,connection},{mfargs,{emqx_connection,start_link,[#{enable_authn => true,limiter => undefined,listener => {tcp,default},zone => default}]}}]
2023-06-07T20:02:50.219568+08:00 [error] supervisor: ‘esockd_connection_sup - <0.2291.0>’, errorContext: connection_shutdown, reason: #{header_type => 0,hint => zero_remaining_len}, offender: [{pid,<0.14982.0>},{name,connection},{mfargs,{emqx_connection,start_link,[#{enable_authn => true,limiter => undefined,listener => {tcp,default},zone => default}]}}]
2023-06-07T20:03:07.629937+08:00 [error] supervisor: ‘esockd_connection_sup - <0.2291.0>’, errorContext: connection_shutdown, reason: #{header_type => 3,hint => zero_remaining_len}, offender: [{pid,<0.14988.0>},{name,connection},{mfargs,{emqx_connection,start_link,[#{enable_authn => true,limiter => undefined,listener => {tcp,default},zone => default}]}}]
2023-06-07T20:04:19.668058+08:00 [error] supervisor: ‘esockd_connection_sup - <0.2291.0>’, errorContext: connection_shutdown, reason: #{header_type => 4,hint => zero_remaining_len}, offender: [{pid,<0.15021.0>},{name,connection},{mfargs,{emqx_connection,start_link,[#{enable_authn => true,limiter => undefined,listener => {tcp,default},zone => default}]}}]
2023-06-07T20:04:32.275351+08:00 [error] supervisor: ‘esockd_connection_sup - <0.2291.0>’, errorContext: connection_shutdown, reason: #{header_type => 0,hint => zero_remaining_len}, offender: [{pid,<0.15025.0>},{name,connection},{mfargs,{emqx_connection,start_link,[#{enable_authn => true,limiter => undefined,listener => {tcp,default},zone => default}]}}]
2023-06-07T20:04:45.282744+08:00 [error] supervisor: ‘esockd_connection_sup - <0.2291.0>’, errorContext: connection_shutdown, reason: #{header_type => 0,hint => zero_remaining_len}, offender: [{pid,<0.15037.0>},{name,connection},{mfargs,{emqx_connection,start_link,[#{enable_authn => true,limiter => undefined,listener => {tcp,default},zone => default}]}}]
2023-06-07T20:04:54.984770+08:00 [error] supervisor: ‘esockd_connection_sup - <0.2291.0>’, errorContext: connection_shutdown, reason: #{header_type => 9,hint => zero_remaining_len}, offender: [{pid,<0.15042.0>},{name,connection},{mfargs,{emqx_connection,start_link,[#{enable_authn => true,limiter => undefined,listener => {tcp,default},zone => default}]}}]
2023-06-07T20:05:05.415240+08:00 [error] supervisor: ‘esockd_connection_sup - <0.2291.0>’, errorContext: connection_shutdown, reason: #{header_type => 0,hint => zero_remaining_len}, offender: [{pid,<0.15047.0>},{name,connection},{mfargs,{emqx_connection,start_link,[#{enable_authn => true,limiter => undefined,listener => {tcp,default},zone => default}]}}]
2023-06-07T20:05:25.906867+08:00 [error] supervisor: ‘esockd_connection_sup - <0.2291.0>’, errorContext: connection_shutdown, reason: #{header_type => 0,hint => zero_remaining_len}, offender: [{pid,<0.15056.0>},{name,connection},{mfargs,{emqx_connection,start_link,[#{enable_authn => true,limiter => undefined,listener => {tcp,default},zone => default}]}}]
2023-06-07T20:05:26.113789+08:00 [error] supervisor: ‘esockd_connection_sup - <0.2291.0>’, errorContext: connection_shutdown, reason: #{header_type => 0,hint => zero_remaining_len}, offender: [{pid,<0.15057.0>},{name,connection},{mfargs,{emqx_connection,start_link,[#{enable_authn => true,limiter => undefined,listener => {tcp,default},zone => default}]}}]
2023-06-07T20:06:20.730867+08:00 [error] supervisor: ‘esockd_connection_sup - <0.2291.0>’, errorContext: connection_shutdown, reason: #{hint => invalid_proto_name,parsed_length => 258,remaining_bytes_length => 1}, offender: [{pid,<0.15079.0>},{name,connection},{mfargs,{emqx_connection,start_link,[#{enable_authn => true,limiter => undefined,listener => {tcp,default},zone => default}]}}]
2023-06-07T20:06:31.539389+08:00 [warning] msg: authorization_permission_denied, mfa: emqx_authz:authorize_non_superuser/5, line: 362, peername: 47.103.37.203:49066, clientid: nmappfxtboibymptexzr, topic: $SYS/#, ipaddr: {47,103,37,203}, source: file, username: undefined
2023-06-07T20:06:31.540191+08:00 [warning] msg: authorization_permission_denied, mfa: emqx_authz:authorize_non_superuser/5, line: 362, peername: 47.103.37.203:49066, clientid: nmappfxtboibymptexzr, topic: #, ipaddr: {47,103,37,203}, source: file, username: undefined
2023-06-07T20:06:45.124596+08:00 [error] supervisor: ‘esockd_connection_sup - <0.2291.0>’, errorContext: connection_shutdown, reason: #{header_type => 8,hint => zero_remaining_len}, offender: [{pid,<0.15095.0>},{name,connection},{mfargs,{emqx_connection,start_link,[#{enable_authn => true,limiter => undefined,listener => {tcp,default},zone => default}]}}]
2023-06-07T21:31:09.666905+08:00 [error] supervisor: ‘esockd_connection_sup - <0.2291.0>’, errorContext: connection_shutdown, reason: #{header_type => 0,hint => zero_remaining_len}, offender: [{pid,<0.16746.0>},{name,connection},{mfargs,{emqx_connection,start_link,[#{enable_authn => true,limiter => undefined,listener => {tcp,default},zone => default}]}}]
2023-06-07T21:31:25.117879+08:00 [error] supervisor: ‘esockd_connection_sup - <0.2291.0>’, errorContext: connection_shutdown, reason: #{hint => invalid_proto_name,reason => malformed_utf8_string_length}, offender: [{pid,<0.16750.0>},{name,connection},{mfargs,{emqx_connection,start_link,[#{enable_authn => true,limiter => undefined,listener => {tcp,default},zone => default}]}}]
2023-06-07T21:31:40.628955+08:00 [error] supervisor: ‘esockd_connection_sup - <0.2291.0>’, errorContext: connection_shutdown, reason: #{header_type => 8,hint => zero_remaining_len}, offender: [{pid,<0.16762.0>},{name,connection},{mfargs,{emqx_connection,start_link,[#{enable_authn => true,limiter => undefined,listener => {tcp,default},zone => default}]}}]
2023-06-07T21:31:56.122443+08:00 [error] supervisor: ‘esockd_connection_sup - <0.2291.0>’, errorContext: connection_shutdown, reason: #{header_type => 0,hint => zero_remaining_len}, offender: [{pid,<0.16767.0>},{name,connection},{mfargs,{emqx_connection,start_link,[#{enable_authn => true,limiter => undefined,listener => {tcp,default},zone => default}]}}]
2023-06-07T21:32:11.641373+08:00 [error] supervisor: ‘esockd_connection_sup - <0.2291.0>’, errorContext: connection_shutdown, reason: #{header_type => 0,hint => zero_remaining_len}, offender: [{pid,<0.16771.0>},{name,connection},{mfargs,{emqx_connection,start_link,[#{enable_authn => true,limiter => undefined,listener => {tcp,default},zone => default}]}}]
2023-06-07T21:32:45.404641+08:00 [error] supervisor: ‘esockd_connection_sup - <0.2291.0>’, errorContext: connection_shutdown, reason: #{header_type => 0,hint => zero_remaining_len}, offender: [{pid,<0.16786.0>},{name,connection},{mfargs,{emqx_connection,start_link,[#{enable_authn => true,limiter => undefined,listener => {tcp,default},zone => default}]}}]
2023-06-07T21:32:45.852510+08:00 [error] supervisor: ‘esockd_connection_sup - <0.2291.0>’, errorContext: connection_shutdown, reason: #{header_type => 0,hint => zero_remaining_len}, offender: [{pid,<0.16788.0>},{name,connection},{mfargs,{emqx_connection,start_link,[#{enable_authn => true,limiter => undefined,listener => {tcp,default},zone => default}]}}]
2023-06-07T21:33:01.314549+08:00 [error] supervisor: ‘esockd_connection_sup - <0.2291.0>’, errorContext: connection_shutdown, reason: #{hint => invalid_proto_name,parsed_length => 256,remaining_bytes_length => 1}, offender: [{pid,<0.16792.0>},{name,connection},{mfargs,{emqx_connection,start_link,[#{enable_authn => true,limiter => undefined,listener => {tcp,default},zone => default}]}}]
2023-06-07T22:16:34.908144+08:00 [warning] msg: alarm_is_activated, mfa: emqx_alarm:do_actions/3, line: 418, message: <<“72.94% mem usage”>>, name: high_system_memory_usage
2023-06-08T00:38:41.562306+08:00 [warning] msg: authorization_permission_denied, mfa: emqx_authz:authorize_non_superuser/5, line: 362, peername: 183.136.225.32:46789, clientid: nmapNSJKJLFQRGOLJUAE, topic: $SYS/#, ipaddr: {183,136,225,32}, source: file, username: undefined
2023-06-08T00:38:41.563075+08:00 [warning] msg: authorization_permission_denied, mfa: emqx_authz:authorize_non_superuser/5, line: 362, peername: 183.136.225.32:46789, clientid: nmapNSJKJLFQRGOLJUAE, topic: #, ipaddr: {183,136,225,32}, source: file, username: undefined