Why max connection is 250

Asked by liao

Hi,

I install mosquitto on my mac air, I start mosquitto.

and bellow is my step:;

1. run on shell : mosquitto_sub -t "\$SYS/broker/clients/active"
    I got 1 active client.
2. then run bash on shell:(try to simulate 249 clients' connections)

#!/bin/bash
c=1
while [ $c -le 248 ]
do
mosquitto_sub -d -t t -k 9000 &
 (( c++ ))
done

3. so far, everything works ok. and I can publish message to all these clients.
4. then I try to simulate one more client.
          mosquitto_sub -t t
    And I can see there is 250 active clients from the log.
5.then I try to publish message to all these 250 clients,
         mosquitto_pub -t t -m 12
   I got "Error: The connection was lost."

I have tried many times, got the same result, can anybody help me? actually I want to do a pressure test to know how many connections mosquitto can host. any suggestions?

Thanks.

Question information

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

Does your computer set a maximum number of open sockets per process? There is no intrinsic limit in mosquitto.

Can you help with this problem?

Provide an answer of your own, or ask liao for more information if necessary.

To post a message you must log in.