User Tools

Site Tools


performance_optimization

Differences

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

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
performance_optimization [2021/01/19 13:50] – [General rules for optimizing your projects] emozolyakperformance_optimization [2023/05/03 08:54] (current) – [General rules for optimizing your projects] emozolyak
Line 5: Line 5:
 Schematically, the structure of the core of the system can be represented as follows: Schematically, the structure of the core of the system can be represented as follows:
  
-{{ ::optimizin_perfomance_eng.png?direct&200 |}}+{{ network:optimizin_perfomance_eng.png?direct&200 |}}
  
 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 125: Line 125:
   -Set appropriate screen refresh time.   -Set appropriate screen refresh time.
   -use templates for dashboards, alerts and others   -use templates for dashboards, alerts and others
 +  -for Gantt diagrams, don't set too big time range
  
 === Scripting === === Scripting ===
Line 135: Line 136:
     local cur_value = R(reg)     local cur_value = R(reg)
          
-    if (not cur_value) or (cur_value == new_value) then  +    if (not cur_value) or (not new_value) or (cur_value == new_value) then  
-        return +        return false 
     else     else
         WriteReg(reg, new_value)         WriteReg(reg, new_value)
     end      end 
 end  end 
-</code> 
- 
-Use commenting you will understand next time you or someone will see you code. 
-<code lua> 
-----------------------------------------CALC. DAY ECONOMY -------------------------------------------------- 
-    LimitMonthDayYesterday = GetReg("LimitMonthDayYesterday1"             -- Yesterday's limit 
-    HeatEnergyDay= GetReg("HeatEnergyDay"                                 -- Heat qty. for yesterday 
-    WriteReg("SavingDay1", (LimitMonthDayYesterday - HeatEnergyDay))        -- Economy for the day                           
-------------------------------------------------------------------------------------------------------------  
 </code> </code>
  
Line 156: Line 148:
   -Set appropriate timeout and tries in external connections  E.g. if the device has common timeout of 30 ms, set it about 40 ms. If the device gets lost, with bigger timeout set to 100 ms, each scan it will take extra 60 ms on read tries. Use "skip", "auto-drop & probe" options for not stable connections.   -Set appropriate timeout and tries in external connections  E.g. if the device has common timeout of 30 ms, set it about 40 ms. If the device gets lost, with bigger timeout set to 100 ms, each scan it will take extra 60 ms on read tries. Use "skip", "auto-drop & probe" options for not stable connections.
   -Organize and set different reading intervals for variables. E.g. for device settings (like PID coeficitens, tolerances and other setup data) you set "Read-On-Demand" property, for slow parameters, like temperature you set 1 minute and so on.    -Organize and set different reading intervals for variables. E.g. for device settings (like PID coeficitens, tolerances and other setup data) you set "Read-On-Demand" property, for slow parameters, like temperature you set 1 minute and so on. 
 +  -For mulitple external devices, you can use "sliding" [[multiplexing_connections_technique| connection window trick]] to temprorarily access a device.
  
 === Project editing === === Project editing ===
Line 166: Line 159:
  
 === Optimize log=== === 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.+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. Use this [[system_settings#storage_settings|settings page]].
  
  
performance_optimization.1611064242.txt.gz · Last modified: 2021/01/19 13:50 by emozolyak

Donate Powered by PHP Valid HTML5 Valid CSS Driven by DokuWiki