mqtt mosquitto linux connection limit

﹥>﹥吖頭↗ 提交于 2019-12-02 19:42:40

In theory you could up the Linux setting for max number of sockets for mosquitto to what you need. The question then is around performance. The key metric is number of messages per second total. If you have 20k clients connected, how many will be active and how many messages will each be sending?

As an example, if half of your clients are active and sending 1 message per second, there are 10k msps - incoming only of course. If each of those messages is 10 bytes, you're at a sustained 100kB/s or 800kbps.

Another aspect is how your topic hierarchy is arranged. I can't tell you what is best, but it will certainly have an effect.

My best suggestion would be to write a client that simulates a real person, then use it to so real testing of your scenario.

I have seen examples of extreme client count: http://bit.ly/HytRpK but have no more details.

One final point: IBM are currently producing a redbook on MQTT. It should be available 'in spring', i.e. soon. I think it will cover scaling issues.

For a customer we tested IBM WebSphere MQ's MQTT, increasing the # of concurrent client connections up to 240,000 per queue manager (MQ runtime, you can have many in an MQ cluster). I was told that is something like 10x more than is reasonably handled by an Apache web server. Server CPU during testing was low at <5%. Would have kept increasing the # of concurrent MQTT clients well beyond 240,000 but the lab ran out of load testing client machines. IBM MQ is the pub/sub provider embedded in WebSphere Message Broker ESB so I expect that'd have the same result.

I don't know of anyone who has done volume testing of mosquitto to that number of connections. I suppose one thing you could do would be to test an instance of mosquitto on your chosen runtime and connect lots of client threads to it during your system testing.

IBM's implementation using WebSphere MQ as the MQTT broker has been shown to support up to 100,000 concurrent connections. I believe IBM's free broker RSMB is limited to 1024 connections.

You might want to consider how to scale out your broker using bridges and a provisioning service to work out which broker to connect new users to.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!