emqx连接数受限

环境信息

  • EMQX 版本:开源版本5.0.3
  • 操作系统及版本:CentOS Linux release 7.5.1804 (Core)。24c48G
  • 其他
    k8s安装

问题描述

在进行tcp连接数的时候每次连接到16500左右,如果继续连接,报错,且已经连接的会全部断开(只连接)

配置文件及日志

node {
  name = "emqx@127.0.0.1"
  cookie = emqxsecretcookie
  data_dir = "data"
  etc_dir = "etc"
}

log {
  file_handlers.default {
    level = warning
    file = "log/emqx.log"
  }
}

cluster {
  name = emqxcl
  discovery_strategy = manual
}


listeners.tcp.default {
  bind = "0.0.0.0:1883"
  max_connections = 1024000
}

listeners.ssl.default {
  bind = "0.0.0.0:8883"
  max_connections = 512000
  ssl_options {
    keyfile = "etc/certs/key.pem"
    certfile = "etc/certs/cert.pem"
    cacertfile = "etc/certs/cacert.pem"
  }
}

listeners.ws.default {
  bind = "0.0.0.0:8083"
  max_connections = 1024000
  websocket.mqtt_path = "/mqtt"
}

listeners.wss.default {
  bind = "0.0.0.0:8084"
  max_connections = 512000
  websocket.mqtt_path = "/mqtt"
  ssl_options {
    keyfile = "etc/certs/key.pem"
    certfile = "etc/certs/cert.pem"
    cacertfile = "etc/certs/cacert.pem"
  }
}

# listeners.quic.default {
#  enabled = true
#  bind = "0.0.0.0:14567"
#  max_connections = 1024000
#  keyfile = "etc/certs/key.pem"
#  certfile = "etc/certs/cert.pem"
#}

dashboard {
    listeners.http {
        bind: 18083
    }
    default_username: "admin"
    default_password: "public"
}

authorization {
  deny_action = ignore
  no_match = allow
  sources =  [
    {
      type = file
      enable = true
      # This file is immutable to EMQX.
      # Once new rules are created from dashboard UI or HTTP API,
      # the file 'data/authz/acl.conf' is used instead of this one
      path = "etc/acl.conf"
    }
  ]
}

安装emq机器有按照系统调优配置

你的日志里面都是 TLS 错误,看起来是 Cipher Suite 没对上,如果你连接的都是 1883 端口的话,就跟这个没关系。

你是用什么工具连的,客户端错误是什么样子,服务器端还有没有其他错误?

可以抓包一些后续不成功的连接,看看是 TCP 握手失败 和 还是连接没有从客户端发送出来