lwc:mqtt:loadtesting

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:loadtesting [2021/10/04 08:31] John Harrisonlwc:mqtt:loadtesting [2021/10/06 13:18] (current) – [Filimin Swarms] John Harrison
Line 19: Line 19:
 ./bin/mzbench run examples.bdl/ramp.bdl ./bin/mzbench run examples.bdl/ramp.bdl
 </code> </code>
 +===== Filimin Swarms =====
 +I wrote ''filiminSwarm2.py'' which emulates groups of lamps. Because of a limitation in python and/or the mqtt implementation of python ([[https://github.com/eclipse/paho.mqtt.python/issues/183|183]], [[https://github.com/eclipse/paho.mqtt.python/issues/238|
 +238]], [[https://github.com/eclipse/paho.mqtt.python/issues/499|499]]) the script can only connect 340 lamps in a single Python instance. In theory a recompile of Python2 should fix this but I tried and with the ''FD_SETSIZE'' changed from 1024 to 65536 I got buffer overflow errors in Python after 340 connections. So to work around this I also wrote a Bash script that spawns multiple instances of the Python script (''filiminSwarms2.sh'').
 +  * ''filiminSwarms2.sh'' was able to create 58 swarms of 340 lamps each, grouped in 3s with each lamp in group touched every 120 to 150 seconds (''filiminSwarms2.sh 58 3 120 150 0'') on an 8GB 4CPU Linode VM. That's a total of 19,720 lamps. At 67 swarms the ephemeral port range appears to become an issue
 +  * The current Linode haproxy load balancer (haproxyMaster) is 8GB/4 dedicated CPUs. It successfully handled the load of 11 load testers (11 * 19720 = 216920 lamps). There were 12 mosquitto nodes connected to it at less than 10% CPU. Sync service was around 50-60% CPU.
 +
 +===== Ephemeral port range =====
 +The default ''ip_local_port_range'' severely limits the number of connections between 2 machines.
 +  * current range: ''sysctl -A | grep ip_local_port_range''
 +  * to extend without rebooting edit ''/etc/sysctl.conf'' (good values are 15000 64000) then ''sysctl -p /etc/sysctl.conf .''
 +  * effective range: ''sysctl net.ipv4.ip_local_port_range'' 
 +
  • lwc/mqtt/loadtesting.1633354308.txt.gz
  • Last modified: 2021/10/04 08:31
  • by John Harrison