Best way to handle KNX CPU/IO high load - Printable Version +- Logic Machine Forum (https://forum.logicmachine.net) +-- Forum: LogicMachine eco-system (https://forum.logicmachine.net/forumdisplay.php?fid=1) +--- Forum: Scripting (https://forum.logicmachine.net/forumdisplay.php?fid=8) +--- Thread: Best way to handle KNX CPU/IO high load (/showthread.php?tid=5830) |
Best way to handle KNX CPU/IO high load - Hadeel - 09.01.2025 Hi! In some big project we have a heavy trafic issue (CPU/IO high load). For example we have a function as below; We have a special KNX scene which turns lights with the brightness depends on the time. For example the light brightness changes between 9 am and 1pm. We use scheduler function to store the brightness value of each light and we fetch these data & execute grp.write() for each lights from the event script. (as we cannnot use scene function for it) The number of lights associated to this script is sometimes over 30. Ideally we want to limit the KNX telegrams up to 20 telegrams per second but I am not sure how to control that from event script. In such cases, which option is preferrable? ・Use os.sleep() function in the execution loop (As of LM manual of 2016 using sleep function was not recommended but can we do this as your 2022 manual does not mention about it anymore?) ・Use redis function to use queue system If there is any other way you recommend, we really appreciate it ! Thank you in advance. RE: Best way to handle KNX CPU/IO high load - Daniel - 09.01.2025 If you want to use delay in event script then you must be sure that only one instance runs at the time. In event script settings you can select mode. Select First instance or Last instance, depend of your needs. RE: Best way to handle KNX CPU/IO high load - Hadeel - 10.01.2025 Thank you Daniel ! Okay we will make sure to use First Instance or Last Instance when we use delay in event script. You don't recommend to use redis queue system in this case? RE: Best way to handle KNX CPU/IO high load - Daniel - 10.01.2025 Ideally you should group all lights in to single KNX group to send just one telegram but you can use TAG and a for loop with some delay in it to delay each write. |