In the single rent-to-buy decision problem, without a priori knowledge
of the amount of time a resource will be used we need to decide when
to buy the resource, given that we can rent the resource for $1 per un
it time or buy it once and for all for $c. In this paper we study algo
rithms that make a sequence of single rent-to-buy decisions, using the
assumption that the resource use times are independently drawn from a
n unknown probability distribution. Our study of this rent-to-buy prob
lem is motivated by important systems applications, specifically, prob
lems arising from deciding when to spindown disks to conserve energy i
n mobile computers [4], [13], [15], thread blocking decisions during l
ock acquisition in multiprocessor applications [7], and virtual circui
t holding times in IP-over-ATM networks [11], [19]. We develop a prova
bly optimal and computationally efficient algorithm for the rent-to-bu
y problem. Our algorithm uses O (root t) time and space, and its expec
ted cost for the tth resource use converges to optimal as O (root logt
/t), for any bounded probability distribution on the resource use time
s. Alternatively, using O(1) time and space, the algorithm almost conv
erges to optimal. We describe the experimental results for the applica
tion of our algorithm to one of the motivating systems problems: the q
uestion of when to spindown a disk to save power in a mobile computer.
Simulations using disk access traces obtained from an HP workstation
environment suggest that our algorithm yields significantly improved p
ower/response time performance over the nonadaptive 2-competitive algo
rithm which is optimal in the worst-case competitive analysis model.