When your baby products website started, it was running at low volume so your instances of type T2.micro were doing a fine job. After a while, your website exploded in popularity and now your ELB is seeing greater traffic. You had planned for the scaling events and your T2.micro instances are running in an auto scaling group. You also noticed that the EC2 instances are experiencing high CPU utilization because the CPU is being throttled and has very poor performance and your users are complaining. Hence the ASG is not scaling.
What can you do to improve the performance of your application?
Ref:
Ans:
Traditional Amazon EC2 instance types provide fixed CPU utilization, while burstable performance instances provide a baseline level of CPU utilization with the ability to burst CPU utilization above the baseline level. The baseline utilization and ability to burst are governed by CPU credits.
The CPU credits used depends on CPU utilization. The following scenarios all use one CPU credit:
One vCPU at 100% utilization for one minute
One vCPU at 50% utilization for two minutes
Two vCPUs at 25% utilization for two minutes
Burstable performance instances are designed to provide a baseline level of CPU performance with the ability to burst to a higher level when required by your workload. Burstable performance instances are well suited for a wide range of general-purpose applications. Examples include microservices, low-latency interactive applications, small and medium databases, virtual desktops, development, build, and stage environments, code repositories, and product prototypes.
The given use-case highlights the fact that the instances are being throttled for CPU usage. To resolve CPU throttling, you can either enable T2/T3 Unlimited, or change the instance type.
Your T2.micro instances have run out of burst credit. Switch to a T2.large or m4.large instance type for greater stability
You can change to one of the following instance types:
A T2 or T3 instance type with a higher CPU credit limit.
An instance type that doesn't use a CPU credit bucket model.
You should enable T2 unlimited
T2 Unlimited instances can sustain high CPU performance for as long as a workload needs it. For most general-purpose workloads, T2 Unlimited instances will provide ample performance without any additional charges. If the instance needs to run at higher CPU utilization for a prolonged period, it can also do so at a flat additional rate of 5 cents per vCPU-hour.