performance_optimization
Differences
This shows you the differences between two versions of the page.
Next revision | Previous revisionNext revisionBoth sides next revision | ||
performance_optimization [2018/12/10 12:00] – created emozolyak | performance_optimization [2023/05/03 08:51] – [General rules for optimizing your projects] emozolyak | ||
---|---|---|---|
Line 5: | Line 5: | ||
Schematically, | Schematically, | ||
- | {{ :: | + | {{ network: |
The kernel works cyclically. This means that all actions are performed sequentially. If delays occur at some stage, this affects the execution time of the entire cycle. | The kernel works cyclically. This means that all actions are performed sequentially. If delays occur at some stage, this affects the execution time of the entire cycle. | ||
Line 106: | Line 106: | ||
This means that if the actual cycle time is greater than the Communication interval, the system will not pause and will not be able to poll the devices with the specified periodicity. | This means that if the actual cycle time is greater than the Communication interval, the system will not pause and will not be able to poll the devices with the specified periodicity. | ||
- | If it is necessary to " | + | If it is necessary to " |
- | 2. If there are a lot of registers and not all need to be polled in each cycle, then you can specify a larger poll interval for less important registers. This will offload the system and data buses. | + | -Increase the speed of exchange on the RS-485, RS-232 buses. The speed of 9600 is too slow for a lot of data. We recommend selecting a speed of 115200 and higher. |
+ | -If there are a lot of registers and not all need to be polled in each cycle, then you can specify a larger poll interval for less important registers. This will offload the system and data buses. | ||
+ | |||
+ | ===== General rules for optimizing your projects ===== | ||
+ | |||
+ | At the time when the WebHMI was invented, it supposed to be used in relatively small projects. But with time, more and more customers installed them for quite big projects. Also, the functionality of the front-end part has been increasing constantly, so that when you're going to use it in the project with thousands of tags with the device fw above 3.5, you should remember about finite platform resources you have. | ||
+ | Below there are several considerations you may follow to keep you project fast and responsive: | ||
+ | |||
+ | |||
+ | === Keep the number of registers in the project below 2-3K === | ||
+ | Each register in the project has a lot of configuration data associsted with it, the bigger the register tree, the more load will lay upon the system. That may slow down the response when you work with the register tree. Organize your register tree in categorites. | ||
+ | |||
+ | === Vizialization === | ||
+ | |||
+ | -Use screens wherever is possible for visualisation, | ||
+ | -Avoid using bulky dashboards (too rich in elements, having heavy-weight pictures etc. ), " | ||
+ | -Set appropriate screen refresh time. | ||
+ | -use templates for dashboards, alerts and others | ||
+ | -for Gantt diagrams, don't set too big time range | ||
+ | |||
+ | === Scripting === | ||
+ | -Avoid using many scripts. The better way is using a few big scripts or scripts with libraries | ||
+ | -Run scripts upon changing value, minimize the number of scripts, running in each scan. | ||
+ | -Minimize " | ||
+ | |||
+ | <code lua> | ||
+ | function UpdReg(reg, new_value) | ||
+ | local cur_value = R(reg) | ||
+ | |||
+ | if (not cur_value) or (not new_value) or (cur_value == new_value) then | ||
+ | return false | ||
+ | else | ||
+ | WriteReg(reg, | ||
+ | end | ||
+ | end | ||
+ | </ | ||
+ | |||
+ | === Connections === | ||
+ | -Use group registers feature | ||
+ | -Set appropriate timeout and tries in external connections | ||
+ | -Organize and set different reading intervals for variables. E.g. for device settings (like PID coeficitens, | ||
+ | -For mulitple external devices, you can use " | ||
+ | |||
+ | === Project editing === | ||
+ | |||
+ | -Keep the number of open tabs in browser minimal for the current session. If you need multiple tabs, use auto-close session checkbox to prevent unattended access. | ||
+ | -Avoid making multiple changes in series, like turning OFF-ON many regs, connection, scripts etc. Use save & apply feature of the latest fw. (apply all changes at once, instead of creating a queue for changes) | ||
+ | |||
+ | === Track Load Average parameter === | ||
+ | There is a metric register in the internal register showing mean number of the processes in the queue relative to the running process. There are 1, 5, 15 minutes mean paratemer. In a steady state, you 15 minutes metric should be below 1. | ||
+ | |||
+ | === Optimize log=== | ||
+ | -Minimize logging many registers to DB, set appropriate log speed for them. When setting 'use data from log' for the graphs, make sure you limit the log amount with the setting. | ||
+ | |||
+ | === Don't forget to remove debug log === | ||
+ | |||
+ | Printing to communication log, especially TRACE function, may load up your system significantly. Don't forget to switch off unnecessary logging and to disable debug printing after finishig debug process. | ||
+ | |||
+ | === Keep some free space on the data storage === | ||
+ | |||
+ | When you have big database files and other log files, leaving small room for temporary files may affect your system performance too. Depending on storage size, leave some free space on it. E.g. for 1GB SD card 20% of free space is recommended. | ||
performance_optimization.txt · Last modified: 2023/05/03 08:54 by emozolyak