The information and communication technology (ICT) industry has emerged as one of the major sources of world energy consumption due to its explosive growth. As a result, energy saving in ICT industry has attracted more attention. Meanwhile, cloud computing is becoming a disruptive technology with profound implications for ICT industry. Its emergence promises the on-demand provisioning of resources as a service. In this paper, we study the energy saving issue in cloud computing. In a scenario where a data center has multiple data servers to deal with jobs, the servers are switched into sleeping mode in periods of low traffic load to reduce energy consumption while guaranteeing the quality of service in terms of job blocking probability. The problem is formulated as a Markov decision process. It is proved that the optimal policy has a double threshold structure. Numerical and simulation results show that our proposed policy can significantly reduce the energy consumption.