Docsity

Homework 2: Disk Spin Down Problem - Fall 2002 | CMPS 242, Assignments of Computer Science

Toggle sidebar
bg1
CMPS242 HW 2: Disk Spin-down Problem
Scott Banachowski
October 21, 2002
Abstract
This paper describes experiments that model the per-
formance of an on-line learning algorithm at predicting
when to spin-down a disk in order to save energy. The
learning algorithm uses the weighted opinion of a set of
experts to decide how long to wait before spinning-down
an idle disk. We examined different share and loss func-
tions, and tuned the algorithm using a trace of hard-disk
idle times. We found that our final algorithm performed
as well the best fixed-timeout extracted from the traces.
1 Introduction
The experiments in this paper emulate the study on adap-
tive spin-down for mobile computers [1]. Please refer to
this study for more background; in this report we include
minimal background and instead focus on the findings of
our experiments.
The goal of our learning algorithm is to save energy
consumed by a hard disk. The disk is either active, idle,
or spun-down. We do not consider periods when the disk
is active because the disk must expend this energy to do
its job; we are interested in saving energy when the disk
is idle. Energy is measured in units of seconds: when
idle, the energy spent equals the duration of the idle pe-
riod. When spun-down no energy is expended, however
there is a cost for spinning down (and the subsequent spin-
up) called spin-down cost, and measured in seconds. For
example, if the spin-down cost is 10 seconds, then dur-
ing a spin-down/spin-up cyclethe disk consumes the same
amount of energy as if it remained idle for 10 seconds.
An optimal spin-down algorithm knows all future idle
periods, and instantly spins-down during each idle period
that exceeds the spin-down cost. Obviously, the future is
unknown to on-line algorithms,so we would like to come
as close to optimal as possible. The optimal algorithm is
the basis for our comparisons. A commonly used practice
is to spin-down after the disk remains idle for a fixed time-
out length. Figure 1 shows the energy spent in seconds for
the whole trace using the optimal algorithm, compared to
some fixed timeout periods.
2 The Trace Data
The hard-drive trace data used in our experiments was
gathered from a system at HP Labs. The data contains the
duration of 199724 periods in which the disk was inactive.
The total idle time of the trace sums to approximately 5.4
days. During this period, 20 idle periods lasted more than
an hour (with the longest timeout lasting 13 hours).
From the trace data we determined the best fixed time-
out as a function of spin-down cost. The best fixed time-
out with a spin-down cost of 10 seconds is approximately
6 seconds. Interestingly, only 303 idle periods last longer
than 6 seconds (

0.2% of the samples), however these
periods account for more than 99% of the cumulative idle
time. Even a naive strategy of spinning down the disk
with a fixed timeout of an hour saves over 70% energy
(compared to never spinning down), and a timeout of 10
minutes saves 90%.
This is a tricky data set to work with. With a spin-
down cost of 10, the optimal algorithm saves 98.7% en-
ergy (compared to never spinning down). A fixed-timeout
of 1 minute saves 97.4%, and a fixed-timeout of 10 sec-
onds saves 98.2%. Using this data set, there isn’t a large
margin of improvement for smarter algorithms to make.
Figure 1 shows the energy used by the optimal algo-
rithm and a couple of fixed-timeouts, as a function of
spin-down cost. The energy, in seconds, is the total en-
ergy consumed over the entire trace. Figure 2 shows a
few more representative fixed-timeouts. In this plot, the
energy consumed by the fixed-timeout is divided by the
optimal energy consumption. We see that different time-
outs have minimums at different spin-down cost, however
none of the fixed timeouts do much better than about 1.4
times optimal for any spin-down cost.
3 Best-fixed Timeout
The best-fixed timeout is the timeout that provides the
most energy conservation when applied to the trace, and
can be computed from the trace data. In the original re-
port, the length of traces (63 days) made it impractical to
compute the best-fixed timeout, so it was approximated.
With the shorter trace used in this study, the best-fixed
1
pf3
pf4
pf5

Partial preview of the text

Download Homework 2: Disk Spin Down Problem - Fall 2002 | CMPS 242 and more Assignments Computer Science in PDF only on Docsity!

CMPS242 HW 2: Disk Spin-down Problem

Scott Banachowski

October 21, 2002

Abstract

This paper describes experiments that model the per- formance of an on-line learning algorithm at predicting when to spin-down a disk in order to save energy. The learning algorithm uses the weighted opinion of a set of experts to decide how long to wait before spinning-down an idle disk. We examined different share and loss func- tions, and tuned the algorithm using a trace of hard-disk idle times. We found that our final algorithm performed as well the best fixed-timeout extracted from the traces.

1 Introduction

The experiments in this paper emulate the study on adap- tive spin-down for mobile computers [1]. Please refer to this study for more background; in this report we include minimal background and instead focus on the findings of our experiments.

The goal of our learning algorithm is to save energy consumed by a hard disk. The disk is either active, idle, or spun-down. We do not consider periods when the disk is active because the disk must expend this energy to do its job; we are interested in saving energy when the disk is idle. Energy is measured in units of seconds: when idle, the energy spent equals the duration of the idle pe- riod. When spun-down no energy is expended, however there is a cost for spinning down (and the subsequent spin- up) called spin-down cost , and measured in seconds. For example, if the spin-down cost is 10 seconds, then dur- ing a spin-down/spin-up cycle the disk consumes the same amount of energy as if it remained idle for 10 seconds. An optimal spin-down algorithm knows all future idle periods, and instantly spins-down during each idle period that exceeds the spin-down cost. Obviously, the future is unknown to on-line algorithms, so we would like to come as close to optimal as possible. The optimal algorithm is the basis for our comparisons. A commonly used practice is to spin-down after the disk remains idle for a fixed time- out length. Figure 1 shows the energy spent in seconds for the whole trace using the optimal algorithm, compared to some fixed timeout periods.

2 The Trace Data

The hard-drive trace data used in our experiments was gathered from a system at HP Labs. The data contains the duration of 199724 periods in which the disk was inactive. The total idle time of the trace sums to approximately 5. days. During this period, 20 idle periods lasted more than an hour (with the longest timeout lasting 13 hours). From the trace data we determined the best fixed time- out as a function of spin-down cost. The best fixed time- out with a spin-down cost of 10 seconds is approximately 6 seconds. Interestingly, only 303 idle periods last longer than 6 seconds (

0.2% of the samples), however these periods account for more than 99% of the cumulative idle time. Even a naive strategy of spinning down the disk with a fixed timeout of an hour saves over 70% energy (compared to never spinning down), and a timeout of 10 minutes saves 90%. This is a tricky data set to work with. With a spin- down cost of 10, the optimal algorithm saves 98.7% en- ergy (compared to never spinning down). A fixed-timeout of 1 minute saves 97.4%, and a fixed-timeout of 10 sec- onds saves 98.2%. Using this data set, there isn’t a large margin of improvement for smarter algorithms to make. Figure 1 shows the energy used by the optimal algo- rithm and a couple of fixed-timeouts, as a function of spin-down cost. The energy, in seconds, is the total en- ergy consumed over the entire trace. Figure 2 shows a few more representative fixed-timeouts. In this plot, the energy consumed by the fixed-timeout is divided by the optimal energy consumption. We see that different time- outs have minimums at different spin-down cost, however none of the fixed timeouts do much better than about 1. times optimal for any spin-down cost.

3 Best-fixed Timeout

The best-fixed timeout is the timeout that provides the most energy conservation when applied to the trace, and can be computed from the trace data. In the original re- port, the length of traces (63 days) made it impractical to compute the best-fixed timeout, so it was approximated. With the shorter trace used in this study, the best-fixed

(^20000 2 4 6 8 10 12 14 16 18 )

4000

6000

8000

10000

12000

14000 Energy Consumed, cello

Spin−down cost (seconds)

Energy (seconds)

optimum algorithm 60 sec tmo30 sec tmo

Figure 1: The energy consumed by the optimal algorithm compared to several fixed timeouts, as a function of spin- down cost.

(^10 2 4 6 8 10 12 14 16 18 )

2

3

4 Normalized Energy Consumed of Some Fixed−Timeouts

Spin−down cost (seconds)

Ratio of Energy Consumed / Optimum

30 sec tmo10 sec tmo 5 sec tmo1 sec tmo

Figure 2: A normalized energy use of several values of fixed timeouts as a function of spin-down cost.

(^20000 2 4 6 8 10 12 14 16 18 )

3000

4000

5000

6000

7000

8000

9000

10000

11000 Energy Consumed of best−fixed algorithms

Spin−down cost (seconds)

Energy (seconds)

optimum best fixedsliding best−fixed

Figure 3: The energy used by the best-fixed algorithm, and a best-fixed algorithm that periodically changes time- outs (in this figure, it changes timeout 4 times).

timeout is computable. We found the best-fixed timeout by finding the minimum in a range of timeout values, and iteratively reducing the size of the range until the mini- mum was contained within a 0.001 second range. We also determined what we call the sliding best-fixed , by break- ing the trace into four sets and computing the energy per set with each set’s respective best-fixed timeout. As ex- pected, it performs better than a single best-fixed timeout. By increasing the number of sets in the sliding best-fixed algorithm, it approaches optimum (if each set contains 1 sample, it is the optimum algorithm). Figure 3 shows the energy used by these algorithms. The best-fixed algorithm so makes a good target to beat using an on-line learning algorithm.

4 The On-line Learning Algorithm

The on-line algorithm uses the weighted opinion of sev- eral “experts” to decide when to shut-down. Each ex- pert is a fixed-timeout, and so the overall opinion is the weighted average of timeouts. The algorithm is based on the share algorithms that track the best expert, described by Herbster and Warmuth [2]. We used all three variations of the algorithm described in that paper: static-expert, fixed-share, and variable-share. This section discusses our observations.

4.1 Choosing experts

In order to choose the set of experts for our algorithm, we tried several combinations of linearly and exponentially

0 0.2 0.4 0.6 0.8 1 1.2 1.4 1.6 1.8 2 x 10^5

0

5

10

15

20

25

30

sample number

Highest Weighted Expert vs. Time

Time−out of expert with highest weight (sec)

Figure 7: The time-out of the leading expert over time. The leading expert is the one with greatest weight using the variable-share algorithm.

4.3 Variable-share updates

Helmbold reports using the variable-share algorithm with

parameters α  0 08 and η  4 0. Using these parameters

in our model, we did not experience the same improve- ment over best-fixed timeouts that they observed, so we

set η  10 (see section 4.2) and tried to find a better α.

Figure 6 shows the results of this experiment, with the en-

ergy normalized by the static-expert (α  0) algorithm.

We find that any α  0 increases the performance over

static experts when the spin-down cost exceeds 12 sec- onds, but performs worse otherwise. To show that different experts gain more influence dur- ing the trace playback, Figure 7 shows the fixed-timeout of the expert with the highest weight as a function of trace

sample (for spin-down cost 15 α  0  5 η  10). There

are two periods in which the 30 second timeout domi- nates, but much of time the best expert hovers just below 5 seconds, with many short periods between 15 and 20 seconds.

4.4 Fixed-share updates

The Herbster paper describes a fixed-share update for the learning algorithm. We implemented the fixed-share up- date to see how it performed. Figure 8 shows the re- sults of this experiment, with the energy normalized by

the static-expert (α  0 0) case. We find similar results

as variable-share, however for spin-down costs above 12, the fixed-share algorithm is more sensitive to choice of α, with lower α values performing better. Figure 9 shows the performance of the static-expert,

0.9 2 4 6 8 10 12 14 16 18 20

1

1.5^ Normalized Energy as Function of Alpha (Fixed−Share)

Spin−down cost (seconds)

Energy / Energy of alpha=

alpha=0alpha=0. alpha=0.4alpha=0. alpha=0.

Figure 8: The effect of altering α when using fixed-share.

(^40002 4 6 8 10 12 14 16 18 )

5000

6000

7000

8000

9000

10000

11000 Energy of Several Algorithms

Spin−down cost (seconds)

Energy (seconds)

best−fixedstatic−expert, eta= fixed−share, eta=10 alpha=.1,variable−share, eta−10 alpha=0.

Figure 9: Several of the algorithms described Section 4 compared to optimum and best-fixed.

(^20000 2 4 6 8 10 12 14 16 18 )

3000

4000

5000

6000

7000

8000

9000

10000

11000 Linear Loss Function with Fixed−Share

Spin−down cost (seconds)

Energy/Energy of alpha=

best−fixed alpha=0alpha=0.

Figure 10: Performance of using a linear-loss function compared to the best-fixed timeout.

variable-share, and fixed-share algorithms using the best tuning parameters. The static-expert performs similar to best-fixed, but slightly worse. However, the share algo- rithms outperform best-fixed when the spin-down cost is greater than 11 seconds.

5 Other Pursuits

We looked at two other variations on the algorithms dis- cussed above: different sets of experts, and a different loss function. This section briefly discusses these experiments.

5.1 Other experts

Often in systems problems, past behavior is a good indi- cator of future behavior. We tried using a set of experts that predict the next idle period using the previous idle, or averages of several previous idles. This avenue proved un- fruitful, performing orders of magnitude worse than a sin- gle fixed-timeout (the plots are omitted from this report). Future work may determine if these experts are really that bad, or if there was a bug in the implementation.

5.2 Changing the loss function

Out of curiosity, we changed the loss function to use a linear loss function. Using the notation of the Helmbold

report, the loss calculation is replaced with Loss  xi  

Energy  xi  optimal

spin  down idle (to bound it between 0 and 1), and^ w

with the function wi  wi  1 Loss  xi . Figure 10 shows

the performance of this algorithm with no share, fixed-

share (α  0  5), and best-fixed. For all values of alpha

(^20000 2 4 6 8 10 12 14 16 18 )

3000

4000

5000

6000

7000

8000

9000

10000

11000 Energy of Final Algorithm

Spin−down cost (seconds)

Energy Consumed

final algorithm best−fixed

Figure 11: The final performance of the final algorithm chosen from our experiments compared the best-fixed timeout.

it does not perform better than best-fixed except at high spin-down cost, therefore we did not pursue using this loss function any further.

6 Conclusion

Unlike the Helmbold study, we did not find parameters for a weighted-expert algorithm that outperformed a best- fixed timeout for all spin-down costs. By choosing a fixed-share algorithm for spin-down costs less than 12

seconds, and a variable share algorithm (α  0  5 η  10)

for spin-down costs 12 and greater, we closely track the performance of the best-fix algorithm (Figure 11). We believe that we can improve performance by using a dif- ferent sets of experts for each spin-down cost instead of using the same set for all trials.

References

[1] David P. Helmbold, Darrell D. E. Long, Tracey L. Sconyers, and Bruce Sherrod. Adaptive disk spin- down for mobile computers. Mobile Networks and Applications (MONET) Journal , To appear.

[2] Mark Herbster and Manfred K. Warmuth. Tracking the best expert. In Proceedings of the Twelfth Inter- national Conference on Machine Learning , 1995.