  Transient cloud servers such as Amazon Spot instances, Google Preemptible
VMs, and Azure Low-priority batch VMs, can reduce cloud computing costs by as
much as $10\times$, but can be unilaterally preempted by the cloud provider.
Understanding preemption characteristics (such as frequency) is a key first
step in minimizing the effect of preemptions on application performance,
availability, and cost. However, little is understood about temporally
constrained preemptions---wherein preemptions must occur in a given time
window. We study temporally constrained preemptions by conducting a large scale
empirical study of Google's Preemptible VMs (that have a maximum lifetime of 24
hours), develop a new preemption probability model, new model-driven resource
management policies, and implement them in a batch computing service for
scientific computing workloads. Our statistical and experimental analysis
indicates that temporally constrained preemptions are not uniformly
distributed, but are time-dependent and have a bathtub shape. We find that
existing memoryless models and policies are not suitable for temporally
constrained preemptions. We develop a new probability model for bathtub
preemptions, and analyze it through the lens of reliability theory. To
highlight the effectiveness of our model, we develop optimized policies for job
scheduling and checkpointing. Compared to existing techniques, our model-based
policies can reduce the probability of job failure by more than $2\times$. We
also implement our policies as part of a batch computing service for scientific
computing applications, which reduces cost by $5\times$ compared to
conventional cloud deployments and keeps performance overheads under $3\%$.
