AnsweredAssumed Answered

Moving Average Performance

Question asked by Steve Boyko Champion on Feb 22, 2019
Latest reply on Feb 25, 2019 by rdavin

One of our clients has a number of performance equations that run frequently and calculate moving averages, like this:

TagAvg('tag', '*-3h','*')


By "frequently" I mean every 10 or 30 seconds. Often they are averaging very "chatty" tags that have archive values every few seconds.


As you can imagine, this causes a lot of read events to the archive, several million every 5 seconds. I believe it is causing some "ptwait" issues with the archive and has prevented some backups from starting. We have changed some equations to run less frequently but a large load remains.


I am looking for ways to improve the efficiency of this. My first thought was to move them from performance equations to AF analyses, with the hope that AF caching will alleviate a lot of the read hits to the archive. My second thought was to average the source tags over a short period (every minute, say) and then calculate the rolling average based on those tags rather than the originals, but that consumes tag licenses and also could lead to a loss in accuracy.


My questions are:

  1. Will these run more efficiently as analyses instead of performance equations?
  2. Is there a better way to calculate these rolling averages?