• Keine Ergebnisse gefunden

6.3 Modeling the Resource Demand

6.3.3 Modeling Approach

The modeling approach for dynamic resource management is mainly an extension of the one developed for static resource management (cf. Section 5.3). It is also based on the stochastic process Yi(t) =Yi(t)·LTi(t) that has been introduced before. A possible long term trend is separately modeled by a linear function LTi(t), while a stochastic process Yi(t) models the seasonal trend and the random noise. The process and the function are characterized using demand behavior observed during the trainings phase the same way like for static resource management as well (cf. Section 5.3.3).

Only the maximal resource demand in the time interval [tp3, tp3+∆tp3] needs to be determined for static resource management. It does not matter when this maximum will be actually required. Dynamic resource management in contrast needs to know the required resources at any time tin this interval. The idea is to use periodic behavior of the seasonal trend and the noise to support this requirement comparable to known approaches. The demand behavior (w.r.t. the seasonal trend and the noise) is assumed to repeat over and over again after a certain period. Hence, a model can be extracted from the resource demand observed during the trainings phase that appropriately describes all instances of the period. This model can

6 Dynamic Resource Management

be used to extrapolate future resource demand as well under the assumption that upcoming instances will behave like the ones observed.

Initially, the seasonal trend and the noise of the resource demand is described by the stochas-tic processYi(t). But dynamic resource management does not need to know the resource de-mandRi(t) (described byYi(t)) but the resource capacity Ai(t) required to fulfill the SLOs.

Hence, resources capacity Ai(t) required by a VM is derived from Yi(t) first. For this, the same method like presented in Section 5.4.2 is applied for both resource types: memory and CPU time. Each of the resulting functions Ai(t) describes now the resource capacity that would have been required in the time interval [tp2, tp2+∆tp2]. A model must be extracted in a next step to extrapolate this function into the future. This model must represent all instance of a period according to the idea presented just before.

In a first step, a predominant period ∆tAˆi must be found in each time series Ai(t). Once this period is found, Ai(t) is cut into pieces of this period. In a final step a representative Aˆi(t) of all pieces is extracted as model. This model describes all instances of the period during the characterization phase as well as all upcoming ones in the future. An overview of this procedure is presented in Figure 6.3. All single steps contained will be detailed some more

time t

resource

lags 0

time t 0

resource

smallest predominant period smallest predominant period

autocov.

)

*( t

Ri Ai*(t)

2

2 p

p t

t +∆

p2

t

p2

t

ˆ*

Ai

t

forecasting modelAˆ*i(t)

autocorrelation

ˆ*

Ai

t

max

step onestep twostep three

Figure 6.3: Overview of the method performed to derive a forecasting model from the resource demand behavior of a VM observed during the trainings phase. First, the time seriesAi(t) that describes the required resource capacity for a VM is derived from the demand seriesRi(t) the same way like for static resource management. Next, an autocorrelation analysis is performed onAi(t) to find a predominant. Once this period is found,Ai(t) is cut into single pieces of the length of this period. Finally, the forecasting model is derived from all of these pieces.

92

6.3 Modeling the Resource Demand

in the following. Finally, the way how this model can be used for future extrapolation will be presented in this section as well.

Finding a Predominant Period

A good way to find appropriate periods is performing an autocorrelation analysis the way described in Section 6.1.1. The resulting correlogram of an exemplary time series and the time series itself are presented in Figure 6.4 a). One can clearly see peaks repeating with a fixed distance. This means that the time series shifted by each multiple of a certain lag strongly correlates with itself. As a consequence, the time series must contain periodic behavior with a dominating period that equals to the distance between two peaks or simply to the lag of the first peak4.

0 13

resource

time [days]

autocov.

0 6

resource

time [days]

0 lag [days] 6

a) 0 13

autocov.

lag [days]

b)

0 time [weeks] 5

resource

0 5

autocov.

c)

one day one day one week

lag [weeks]

)

*( t

Ai Ai*(t) Ai*(t)

Figure 6.4: Exemplary time seriesAi(t) and respective correlograms. The lag with the highest local maximum (despite the first one) is selected as predominant period. In case of a weekly period overlaid by an intermittent daily period (like in b) and c)), the length of the time series decides about whether the daily or the weekly period is selected as the predominant one.

One can further see that the height of the peaks is continuously decreasing with increasing lag. Increasing the lag decreases the overlapping region of the original time series and the time series shifted by the lag. As a result, differences of the instances of the period are more and more dominating the analysis. The autocovariance is decreasing.

It is a bit more complicated to determine an appropriate period for time series with different overlaid periods. The selected one strongly decides about the quality of the model. One can take an exemplary service that has very similar demand behavior every day for five days of a week for instance. Both days of the weekend show strongly different demand behavior. One could now decide to take one day as a period. Five of seven days would be described very well.

But the forecasts of the model might be very bad for the remaining two days. A better choice would be a period of one week. The model would describes the sequence of five similar days followed by the two days of the weekend this way.

4that has of course a lag different from zero

6 Dynamic Resource Management

An autocorrelation analysis was applied to such a case once with a 14 days time series and once with a time series of 6 weeks. The time series and the respective correlograms are presented in Figure 6.4 b) and c) respectively. Again, peaks (or local maxima) with a fixed distance (one day in this case) could be observed. But the height is not continuously decreasing with increasing lag in contrast to a). A lag of 1 still led to the strongest autocovariance, when the 14 days time series was used. But the time series obviously autocorrelates stronger with a lag of 7 days than with a lag of 5. This behavior is caused by the weekly period that overlays the daily one. The peak at 7 days even exceeds the one at 1 day in case of the 6 weeks time series.

As a result, not the lag of the first but of the highest local maximum (despite the one with lag 0) should be used as predominant period. This approach deals very well with overlaid periods, when the trainings phase is sufficiently long.

Extracting the Forecasting Model

Once a suitable period is found, the time series Ai(t) is cut into subsequent parts each with the length ∆tAˆi of this period. Each part represents one instance of this period (e.g. one day).

A representative ˆAi(t) must then be extracted in a final step that appropriately describes all of them and the ones expected in the future as well.

Different known approaches simply derive the model as an average of all instances [44, 17].

This implicates that variations around this mean are random noise that must be overestimated.

The problem of this approach is that naturally time intervals of this noise are strongly corre-lated. A bank holiday in a normal working week for instance would lead to strong forecasting errors. Whole intervals of the day would differ from the model, which could lead to bursts of performance losses. Such correlations likely lead to SLO violations in many cases regarding SLO specifications that define a minimal required percentage of satisfied performance goals in a time interval.

Hence, the model must pessimistically describe the maximum of all instances taking care of even the worst instance ever observed. An upper envelope of all instances is derived as a model for this the following way:

∀t∈[0,∆tAˆi[: ˆAi(t) = max

l=[0,...,j

∆tp2/∆tAˆ i

k−1]

(Ai(l·∆tAˆi +t+ ∆tp2)) (6.2)

This approach was applied to an exemplary time series, which is presented at the lower side in Figure 6.3. One can see that the model captures the worst case of all instances at any relative timet.

The time series that represents the model can contain many samples depending on the period and on the sampling rate of the resource demand. Slices of samples of Ai(t) have nearly or

94

6.3 Modeling the Resource Demand

even exactly the same value. Discretization of the values of the time series in conjunction with run length decoding can help to strongly reduce the memory complexity of the model.

The computational effort required to use the model to forecast the demand behavior can be reduced this way as well.

Extrapolating into the Future

To extrapolate resource capacity required at a certain time t∈[tp3, tp3+∆tp3] into the future, the relative time in the period that belongs to the absolute time tmust be found. Therefore, a reference point is required that defines the start time of one of the instances of the period.

According to the characterization process of the model ˆAi(t), the first observed instance of the period starts at the beginning of phase two. Hence, timetp2 can be used as a reference. A fixed number of complete instances of the period fits in the time interval between any time t and the reference pointtp2. The remaining part (an incomplete instance of the period) defines the relative time in the period that belongs to the absolute timet.

Once this relative time is found, resource capacity required by a VM with respect to the seasonal trend and the noise can be derived from ˆAi(t). The result can be finally scaled by the influence of the long term trend to get the resource capacity required for the VM at t. This method can be expressed more formally by following equation:

Ai(t) =Ai((t−tp2) mod ∆tAˆi)·LTi(t). (6.3)