With the amount of data rapidly increasing, many applications need higher-performance hardware to support their running. However, for most individuals and organizations, these hardware are too expensive, and their budgets are limited. Consequently, the cloud computing price scheme based on pay-as-you-go is a very suitable choice for users to migrate their applications to the cloud, and using cloud can reduce the cost of purchasing and maintaining hardware. There are three major service models for cloud computing: Software as a Service (SaaS), Platform as a Service (PaaS) and Infrastructure as a Service (IaaS) [1]. Amazon Elastic Compute Cloud (EC2) [2] is one of the representatives of IaaS, which can provide users with basic hardware resources, such as CPU, network, memory and storage. Amazon EC2 provides users with many purchase options. They can be divided into three categories: reserved instances, on-demand instances and spot instances [2]. Reserved instances allow users to purchase a long-term right to use instances at a lower price, which are cost-effective for long-term applications. On-demand instances cost more than reserved instances, however users can purchase it according to the actual