With ongoing energy shortages and rises in greenhouse emissions worldwide, increasing academic attention is being turned towards ways to improve the efficiency and sustainability of cloud computing. In this paper, we present a performance analysis and a system optimization of a cloud computing system with an energy efficient task scheduling strategy directed towards satisfying the service level agreement of cloud users while at the same time improving the energy efficiency in cloud computing system. In this paper, we propose a novel energy-aware task scheduling strategy based on a sleep-delay timer and a waking-up threshold. To capture the stochastic behavior of tasks with the proposed strategy, we establish a synchronous vacation queueing system combining vacation-delay and N-policy. Taking into account the total number of tasks and the state of the physical machine (PM), we construct a two-dimensional continuous-time Markov chain (CTMC), and produce an infinitesimal generator. Moreover, by using the geometric-matrix solution method, we analyze the queueing model in the steady state, and then, we derive the system performance measures in terms of the average sojourn time and the energy conservation level. Furthermore, we conduct system experiments to investigate the proposed strategy and validate the system model according to performance measures. Statistical results show that there is a compromise between the different performance measures when setting strategy parameters. By combining different performance measures, we develop a cost function for the system optimization. Finally, by dynamically adjusting the crossover probability and the mutation probability, and initializing the individuals with chaotic equations, we present an improved genetic algorithm to jointly optimize the sleep parameter, the sleep-delay parameter and the waking-up threshold.