mosquitto: increase connection limits
I am trying to increase my mosquitto connection limits. when my mosquitto broker reaches above 1010 clients connection it's cannot publish a message and got connection failed error. $SYS/broker/
My server specification:
Server: ubuntu 18.04 LTS Mosquitto version:1.6.12 Ram:4GB
My configurations:
Our system wide open connections is configured on /etc/sysctl.conf:
fs.file-max =200000
In /etc/security/
* hard nofile 200000
* soft nofile 200000
root hard nofile 200000
root soft nofile 200000
Mosquitto is installed under the user 'Ubuntu'.
We also added below line of code on /etc/pam.
session required pam_limits.so
Running ulimit -a is giving the below result:
core file size (blocks, -c) 0
data seg size (kbytes, -d) unlimited
scheduling priority (-e) 0
file size (blocks, -f) unlimited
pending signals (-i) 15623
max locked memory (kbytes, -l) 16384
max memory size (kbytes, -m) unlimited
open files (-n) 200000
pipe size (512 bytes, -p) 8
POSIX message queues (bytes, -q) 819200
real-time priority (-r) 0
stack size (kbytes, -s) 8192
cpu time (seconds, -t) unlimited
max user processes (-u) 200000
virtual memory (kbytes, -v) unlimited
file locks (-x) unlimited
Below is the configuration in /etc/mosquitto/
persistence true
persistence_
log_dest file /var/log/
include_dir /etc/mosquitto/
max_connections -1
log_type error
log_type warning
log_type notice
connection_messages true```
How to increase my mosquitto broker connection limits?
Please support us..
Question information
- Language:
- English Edit question
- Status:
- Answered
- For:
- Ubuntu mosquitto Edit question
- Assignee:
- No assignee Edit question
- Last query:
- Last reply:
Can you help with this problem?
Provide an answer of your own, or ask mukilan for more information if necessary.