分类 MQTT 下的文章

“MQTT消息队列遥测传输(英语:Message Queuing Telemetry Transport)是ISO 标准(ISO/IEC PRF 20922)下基于发布 (Publish)/订阅 (Subscribe)范式的消息协议,可视为“资料传递的桥梁”它工作在 TCP/IP协议族上,是为硬件性能低下的远程设备以及网络状况糟糕的情况下而设计的发布/订阅型消息协议。”

sudo vim /etc/init.d/mosquitto

Change /bin/sh to /bin/bash for fixing "ulimit -u illegal option" error

set_ulimit () {

ulimit -f unlimited
ulimit -t unlimited
ulimit -v unlimited
ulimit -n 1048576
ulimit -m unlimited
ulimit -u 1048576

}

start)

...
# Update ulimit config in start command
set_ulimit
...
;;

stop)

After changed the config, reload systemctl config and restart mosquitto

sudo systemctl daemon-reload
sudo service mosquitto stop
sudo service mosquitto start

https://stackoverflow.com/questions/40199152/mosquitto-increase-max-connections