哪个 MQTT 服务器用于 > 1M 连接

Which MQTT server for > 1M connections

如果预算可能只有几百万来设置 MQTT 服务器场,您会怎么做?

它必须具有以下属性:

可以在此处找到 MQTT 服务器代理: https://github.com/mqtt/mqtt.github.io/wiki/server-support#capabilities

但是通常不会发布功能。

IBM Messagesight 设备。专为联网汽车等大规模物联网部署而设计: http://www-03.ibm.com/software/products/en/messagesight

集群 IBM IoT MessageSight 服务器可以通过 v2.0 实现,它允许您将单个 MessageHub 扩展到多个服务器,从而实现甚至超过 1M 的连接。

尽管由 Erlang 提供支持的 VerneMQ MQTT 代理仍然很新,但没有什么(RAM/CPU/IPs/Bandwidth 除外)可以阻止您打开那么多连接。

http://verne.mq

确保设置类似于:

listener.max_connections = infinity
listener.nr_of_acceptors = 1000
erlang.max_ports = 10000000
erlang.process_limit = 10000000

在你的vernemq.conf

免责声明:我是 VerneMQ 的开发者之一,很乐意帮助您达到 1M connections/server。

你不需要几百万美元就可以做到这一点。实际上你甚至不需要数万 - flespi broker 在它的商业版本中实现了你(曾经)需要的所有数字,除了当时的 地理冗余 。不仅实现了 - 它每天与多个类似负载一起使用,24/7 全天候运行时间为 99.98%。

它是具有私有名称空间的基于云的代理,因此即使它是免费版本也可供所有人使用,能够为最多 200 个流量提供服务MB/minute。

HiveMQ 是一个自托管的、基于 java 的企业 MQTT 代理,专门设计用于支持数百万个并发连接。

HiveMQ 团队做了一个基准测试,将超过 10.000.000 个并发 MQTT 客户端连接到一个 HiveMQ 代理集群。为了达到这个数字,同时获得不错的性能,需要对所用机器的操作系统进行一些配置。

打开 /etc/security/limits.conf 中的文件:

hivemq  hard    nofile  1000000
hivemq  soft    nofile  1000000
root    hard    nofile  1000000
root    soft    nofile  1000000

/etc/sysctl.conf

中的 TCP 调整
# This causes the kernel to actively send RST packets when a service is overloaded.
net.ipv4.tcp_fin_timeout = 30

# The maximum file handles that can be allocated.
fs.file-max = 5097152

# Enable fast recycling of waiting sockets.
net.ipv4.tcp_tw_recycle = 1

# Allow to reuse waiting sockets for new connections when it is safe from protocol viewpoint.
net.ipv4.tcp_tw_reuse = 1

# The default size of receive buffers used by sockets.
net.core.rmem_default = 524288

# The default size of send buffers used by sockets.
net.core.wmem_default = 524288

# The maximum size of received buffers used by sockets.
net.core.rmem_max = 67108864

# The maximum size of sent buffers used by sockets.
net.core.wmem_max = 67108864

# The size of the receive buffer for each TCP connection. (min, default, max)
net.ipv4.tcp_rmem = 4096 87380 16777216

# The size of the sent buffer for each TCP connection. (min, default, max)
net.ipv4.tcp_wmem = 4096 65536 16777216

有关所用虚拟机的详细信息、OS 端所需的具体配置以及详细的性能结果都可以在 10 Million Benchmark Paper

中找到

免责声明:我是 HiveMQ 团队的一员。

Akiro MQTT Broker 处理这种规模并且是一个非常可靠和低延迟的代理,它可用,由异步 IO 提供支持。

Akiro 可以处理与 12 个具有商品硬件的代理的 1000 万个连接,这是当今 MQTT 代理的最佳基准之一。它也被主要电信公司使用。试一试。谢谢

P.S 我是 Akiro 团队的一员:)