Amazon EC2 T2 Micro Instance CPU credit and why your server run at 100 CPU percent VPS Free Tier

2019-12-04 107

https://marvel-it.icu/amazon-ec2-t2-micro-instance-cpu-credit-and-why-your-server-run-at-100-cpu-percent-vps-free-tier

[00:03] Free Tier plan of Amazon AWS is awesome.
However, the way they cost/restrict the bundled T2 Micro Instance may confuse someone.

Remember, this T2 instance is designed for small applications, which can accept idle state like blog, shop online, etc.
During instance/server runtime, they will be allocated 30 credits for small startups.
Each hour, 6 credits will be added.

1 credit is for 100% CPU usage/minute.
So 6 credits/hour equal to they allow you to run continuously 10%/hour.
If your app/server idle (~ 10%), this credit will remain, build up your balance for further usage in the next 24 hours.

[00:24] You can monitor Credit usage/balance as well as other factors in Monitoring console of the EC2 Dashboard.

This is my game server.
It constantly eats more than 10% CPU, so the Credit histogram will go down like the mountain flank, when it reaches the bottom, your 2.5 GHz Xeon will turn out into a Mobile chip, your app hangs, CPU became 100% without clear evidence.

In the first-time play with a game server on Amazon Free Tier, face 100% CPU cause my mind to begin to think about terrible service or something like that.
And because I never care about resource usage (my blog) before, on shared hosting/another T2 instance.
I'm sure that other people will think like that.

[1:29] A quick workaround is a shutdown then turn on your instance again (not reboot), and 30 startup credits will be rewarded.

[1:45] To have a clear view, look at these threads.

[4:25] "Traditional Amazon EC2 instance types provide fixed performance, while burstable performance instances provide a baseline level of CPU performance with the ability to burst above that baseline level. The baseline performance and ability to burst are governed by CPU credits. A CPU credit provides the performance of a full CPU core for one minute" - amazon.com
http://bit.ly/CPU-burst-concept

[5:49] "T2 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. T2 instances are well suited for a wide range of general-purpose applications like microservices, low-latency interactive applications, small and medium databases, virtual desktops, development, build, and stage environments, code repositories, and product prototypes" - invoke.cloud
http://bit.ly/ec2-instance-known-issues

[7:12] "What happens if one EC2 goes haywire and starts churning on the CPU? You might expect to see overall CPU utilization go up to 100% as measured by both AWS and Metricly. And in fact, you do – At first. Later, though, the AWS measurement of CPU drops to 10% while Metricly’s measurement stays at 100%. What’s up with that?" - metricly.com
http://bit.ly/ec2-cpu-util


http://marvel-it.icu
Do not forget to
LIKE, SHARE, SUBSCRIBE
and feel free to ask me questions or discuss with everyone :3