lwc:mqtt

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
Next revision
Previous revision
lwc:mqtt [2021/09/21 15:23] – [Configuring for high # of connections (tested on 16.04)] John Harrisonlwc:mqtt [2021/10/20 09:31] (current) John Harrison
Line 31: Line 31:
 erase all retained messages: mosquitto_sub -i <client_id> -p <port> -h <host> --retained-only -t "#" -v | while read line; do let "x=x+1"; echo $x; mosquitto_pub -i <client_id> -p <port> -h <host> -t "${line% *}" -r -n; done' erase all retained messages: mosquitto_sub -i <client_id> -p <port> -h <host> --retained-only -t "#" -v | while read line; do let "x=x+1"; echo $x; mosquitto_pub -i <client_id> -p <port> -h <host> -t "${line% *}" -r -n; done'
 \\ \\
- 
  
 ===== HA Proxy: ===== ===== HA Proxy: =====
Line 37: Line 36:
 ==== Configuring for high # of connections (tested on 16.04) ==== ==== Configuring for high # of connections (tested on 16.04) ====
  
-edit /etc/sysctl.conf and add the following lines (increase open file limit and decrease memory use of TCP buffers:+edit ''/etc/sysctl.conf'' and add the following lines (increase open file limit and decrease memory use of TCP buffers:
 <code> <code>
 fs.file-max = 10000000 fs.file-max = 10000000
Line 44: Line 43:
 net.ipv4.tcp_rmem = 4096 4096 16777216 net.ipv4.tcp_rmem = 4096 4096 16777216
 net.ipv4.tcp_wmem = 4096 4096 16777216 net.ipv4.tcp_wmem = 4096 4096 16777216
-net.ipv4.ip_local_port_range = 1000 65535+net.ipv4.ip_local_port_range = 15000 65535
 </code> </code>
  
Line 55: Line 54:
 </code> </code>
  
-add to ''/etc/haproxy/haproxy.conf:'' +add to ''/etc/haproxy/haproxy.conf:'' in ''defaults:''
-   * In ''Global:''+
 <code> <code>
 maxconn 2000000 maxconn 2000000
Line 63: Line 61:
 timeout server 66000000 # necessary? timeout server 66000000 # necessary?
 </code>  </code> 
 +
 +check:
 +<code>
 +pidof haproxy
 +cat /proc/630/limits | grep 'open files'
 +</code>
 +
 +[[https://ma.ttias.be/linux-increase-ip_local_port_range-tcp-port-range/|increase ip_local_port_range]]
  
 === References === === References ===
  • lwc/mqtt.1632255820.txt.gz
  • Last modified: 2021/09/21 15:23
  • by John Harrison