Graphical Views getting slower with "server-side script" components
-
Hi everyone,
We have a project running on MangoES and I noticed that the Graphical Views are getting slow when the page is using a lot of server-side scripts on one page and I was wondering what is the optimal number of components used on one page of the Graphical View module.
We have around 100-120 small server side script components on the page which are mostly the same changing divs / .png pictures according to point values while some of them have also on-click functions to change point value. Its mostly for visualizing small pictures or buttons for the system. The good thing is that on.click functions work on time and start right after the commands have been issued but the visualisation behind them is slow because the point values are not updated as fast as they should.
1. Is there's an option to issue on-load a script where the page loads the function and then uses its components to change variables in this function while activating a script on-click? i.e meaning they change point values etc.
This way the browser wouldn't have to load the same scripts over and over again because right now each component having its own js code which makes the page large and slow.
The update period on these components are 0 meaning that they update themselves according to the datasource update interval.
I am using scripting data sources and modbus data source with an update interval 1 second and I noticed that Mango does update the point value on-time but the graphical view module is getting slow and noticeably updates its components with around 20-30 second intervals.
2. Could someone give me an overview what depends on the speed?
When i look for the mangoES memory usage then I have around 300-400 mb free memory. Currently around 2-3 devices are using the graphical views simultaneously.
3. How to achieve the same speeds on graphical views like we have through out the system. i.e watch list.
Thanks,
Thomas -
Hi Thomas,
Have you looked into our Custom Dashboards module? It uses Angular, which is a more efficient distribution of the workload than the Graphical Views, which re-renders the elements as JSPs. It can be a little tricky to get started, but there are lots of examples in the Custom Modules page if you're interested.
There are a few settings you could check and play with. There is an update interval on components. If it is set to 0, it will attempt to get all updates. If it is set to a higher number, it will only update at that interval. If the issue is that a new value is arriving by the time the previous view is available to be rendered, you could consider increasing this update interval to 5 or 6 seconds. It would still introduce that delay, but it may alleviate the longer delay. If too much rendering is what was occurring, your CPU usage would be very high.
-
Here is a video about using the AngularJS code inside a graphic view. You might be able to replace some of your server side scripts with this code. If you want to send us your graphic view JSON export we can take a look and make more recommendations.
http://infiniteautomation.com/forum/topic/2157/mango-angularjs-beta/2