How many clients can be supported?

Asked by Derek Lee-Wo

I was wondering if you or anyone has done any tests or have this in production and know how many clients can be supported with a single server?

I know under Linux that there is a 1024 socket limit that needs to be adjusted, but assuming that is done, can I support 50,000 clients? 100,000 clients?

I see that the IBM broker has a limit of just 2,000 clients, so I didn't know if that was just a limitation imposed by their server, or perhaps a limitation with the protocol.

Question information

Language:
English Edit question
Status:
Solved
For:
mosquitto Edit question
Assignee:
No assignee Edit question
Solved by:
Roger Light
Solved:
Last query:
Last reply:
Revision history for this message
Roger Light (roger.light) said :
#1

I haven't done any testing that could be considered useful in this regard. I've verified that mosquitto can have >1024 clients connected and all publish, but it's difficult to test this in a realistic manner.

The maximum number of clients on a server will ultimately be limited by the fact that there are at most 65535 ports available to each network interface - and I believe this is also the hard upper limit on open connections under Linux, meaning that using multiple network interfaces wouldn't work.

You could get round this by using multiple brokers on separate machines and bridging them together if necessary.

I've got no idea whether you'd get any useful performance with this kind of user count of course!

Revision history for this message
Derek Lee-Wo (derek-leewo) said :
#2

Ok, so 64K would be the theoretical max.

With regards to the performance, for *my* scenario, even if I have 50,000 clients connected, most would actually be idle. I don't expect any single client to get more than 4-5 msgs per day and at most, we'd have 2 clients subscribing to any given topic.

So over the course of a day, mosquitto would only have to deliver 5-10 msgs/sec.

Have you by chance done any tests to at least see how many msgs you can deliver each sec?

Revision history for this message
Best Roger Light (roger.light) said :
#3

Right, that sounds like a scenario that has got a good chance of success.

I did some tests recently with a single client sending 100 byte messages and got around 1300 messages/s. This was with the code in the repository, which has had some bottlenecks removed. The currently released code gets <1000 messages/s; I can't remember exactly what it was.

Revision history for this message
Derek Lee-Wo (derek-leewo) said :
#4

Great, thanks!

Revision history for this message
andypiper (andypiperuk) said :
#5

"I see that the IBM broker has a limit of just 2,000 clients" - which Broker is that? you mean RSMB? just curious.

Regardless, it's likely to be a balance between performance and the number of connections.