# Trending algorithm for performance monitoring

## Situation description

I'm trying to implement a prediction (or trending) algorithm for my performance gathering system in order to see when a Linux server's resources will end (for example, free space on a storage or free memory).

The result of the performance gathering process is a graph. So, I need to get on my graph something like this:

This is an example of RRDtool graph (data collected from Cacti monitoring tool). Here are 3 dashed lines that are trend lines for the disk utilization history graph. That is similar to what I need.

## What I would like to get

The prediction of when the performance will reach some value (e.g. 90%). Which one of the plenty of prediction (trending) algorithms should I use in my case?

## What I've researched

Holt-Winters algorithm, time series prediction. But I do not know how to use them in this particular case. May be there is other solution?

[30,45,50,10,20,30]-> this is example of disk utilization array (in %).

--------------------> Time, minutes

Critical threshold boundary is 90%.

I need to know when the disk utilization will reach 90% threshold (based on the already collected history of data).

Any examples in Matlab or in R are welcome.

-
if your predictions are plain straight lines, you're probably looking for linear regression: en.wikipedia.org/wiki/Linear_regression (perhaps with additional increasing weights for later events) –  Karoly Horvath Jul 22 '12 at 10:04
Implementations details are more important for me than general choosing of method. Thanks for Karoly for the first comment, I got the direction of further research and will answer on my own question soon with real implementation example. –  crible Jul 23 '12 at 2:55
crible, I think you have your priorities sadly reversed. A superb implementation of a poor method will do you far more harm than a crummy implementation of a good prediction method--unless you don't care at all about the predictions, in which case please just ignore this comment altogether :-). –  whuber Jul 23 '12 at 22:24
@whuber: thanks for your opinion! What do you mean talking "crummy implementation of a good prediction"? Does that mean it will be better to implement something like Holt-Winters algorithm instead of linear regression in this particular case? –  crible Jul 24 '12 at 6:32
A good example is afforded by the graph you posted to IrishStat's answer: fitting a linear trend to data like that will give exceptionally poor predictions. But please understand I'm not advocating adopting complex, sophisticated models: you have made it clear that simplicity and ease of implementation are virtues for your application. Nevertheless, there is an enormous middle ground of approaches to this problem. Sharing some sample data and improving our understanding of what use you will make of these predictions will help us identify good solutions for you. –  whuber Jul 24 '12 at 12:27
show 1 more comment

## migrated from stackoverflow.comJul 23 '12 at 21:31

This question came from our site for professional and enthusiast programmers.

-
It would be good to summarize some of the key points from these pointers. This would make this comment more like a sustainable answer to the question at hand. –  chl Oct 23 '12 at 11:12