The most common problem testing teams face is the unpredictability of the capacities’ demand needed for a certain project, which results in ever-growing costs for capacities that may not be used to the full scale or not used at all. Depending on the size of the project, these overpayments for downtime vary from hundreds to thousands of dollars.

How to Solve the Problem

Amazon Spot instances are significantly cheaper compared to on-demand instances (up to 90%). The only limitation users may face is Amazon guarantees 6-hour usage period after which instance may be interrupted. It depends on the demand for spot instances.

The first step is choosing the type of spot instance suitable for the project needs (note that on-demand instances are also available in conjunction with spot instances).

Spot Pricing

For one of our projects, we use m3.medium instances with a single executor. They have 1 vCPU and approx. 4Gb of RAM. They are suitable for the majority of the QA/dev jobs. Moreover, it has the biggest — 90% — discount on the spot market.

Solution Examples

Scalable pipeline approach integrated into AWS Spot market (no jobs = no costs) and scaling to thousands of instances when needed.

Customized Amazon EC2 Fleet Plugin

AWS Spot Fleet Requests

Jenkins pipeline

QPS-infra is an integral part of the solution with predefined Jenkins master instance. The solution unites the above-mentioned tools in one infrastructure.

How Does It Help to Cut Costs?

Scalable Jenkins on Demand

Jenkins is scalable on demand using Amazon Spot Fleet instances. The Spot Fleet attempts to launch the number of Spot Instances that are required to meet the target capacity that you specified in the Spot Fleet request.

Actual Numbers of Savings

You can save up to 85% — it depends on the type of instance you are using.

Is there a significant difference in cutting costs when using other types of spot instances? It highly depends on the tasks and the size of the project.

Note: we do not recommend using T2 instances for Jenkins slaves since they have limitations in performance.

Below is a diagram showing the difference in costs:

Find other AWS Tools for reporting and cost optimization at the link.