I used mosquitto as MQTT broker, and it seems if connection number is more than 1000, the below log printed. Anybody know something about this?
1470896904: Client connection from 111.7.170.177 denied access by tcpd.
I used mosquitto as MQTT broker, and it seems if connection number is more than 1000, the below log printed. Anybody know something about this?
1470896904: Client connection from 111.7.170.177 denied access by tcpd.
I feel your process(mosquitto) have hit the maximum number of open file descriptors limit. Check your max open files by ulimit -n
. Then increase the limit to max number of connections expected by you. E.g. For 10k connection it would be ulimit -n 10000
A note on ulimit(1). It is only set for the current terminal and for persistent changes you will need to edit config files as per your Linux flavor( /etc/security/limits.conf + /etc/pam.d/common-session* on Ubuntu ).
There might be another reason for this error message. The same message wil be displayed in the log if a client tries to connect and access is denied by TCPD. You need to adjust hosts.allow (in my case for localhost 127.0.0.1) to connect.
I had similar problem using Ubuntu 14 with mosquitto 1.6.3 and I solved my issue making these changes:
Open the: /etc/init/mosquitto.conf file
Add limit nofile 4096 4096
before exec
;
4096 indicate the number of clients
service mosquitto stop
service mosquitto start
I hope help another people that have the same issue.