Skip to content

Latest commit

 

History

History
29 lines (16 loc) · 2.27 KB

COST_OPTIMIZATION.md

File metadata and controls

29 lines (16 loc) · 2.27 KB

Cost optimization

CloneSquad CPU Crediting

CloneSquad implements a dedicated strategy to manage burstable instances and avoid unexpected costs linked to the unlimited bursting.

Tip: The 'CPU Crediting' feature can be disabled with ec2.schedule.burstable_instance.max_cpu_crediting_instances configuration key set to 0.

The CPUCreditBalance metric of each burstable instances under management is monitored and they are marked 'unhealthy' when they exhaust their CPUCreditBalance. (This behavior can be modified with ec2.schedule.burstable_instance.max_cpu_credit_instance_issues)

When marked 'unhealthy', a new instance will be automatically started to allow its replacement (The started instance will be selected by the autoscaler algorithm without taking into account that a burstable is replaced). After a period of time, burstable instances with exhausted 'CPUCreditBalance` will be marked as 'draining', will be unsubscribed from all targetgroups and so, have their CPU going down to zero. They will remain in this state for a long time: This is the 'CPU Crediting' mode.

While in 'CPU Crediting' mode, the CPUCreditBalance is monitored until it reachs 30% of daily accruable credits and then the instance is stopped.

By default, no more than 50% of a CloneSquad fleet can be, at the same time, in CPU Crediting mode.

If you see lots of instances in 'CPU Crediting`mode, it is recommended to increase the instance type of your instances.

CPU Credit preservation

Another cost optimization strategy is implemented that starts burstable instances stopped for more than 6 days and 12 hours to avoid losing accrued credits.

Tip: The 'CPU Credit preservation' feature can be disabled with ec2.schedule.burstable_instance.preserve_accrued_cpu_creditconfiguration key set0`.