0

I have may aws ec2 instances running in dev account and most of the instances i see cpu utlization doesn't go most of the time more than 5% . For example even in one of the kubernetes cluster where kafka is running it is not exceeding 5 or max 6% of cpu utlization when we used t3.xlarge (16gb ram and 4vcpu) machine for kafka cluster setup.

So my question is there an way to find out if i am really fully utlizing the instances for which we have opted for so that i can downgrade my instances type to low cost one if it is not fully utlized. I saw aws compute optimizer but that is saying most of the instances are optimized only 1 or 2 it shows as not optimized with under utlized.

Also most of the application like may be kafka are by default requesting 8gb ram and good cpu for better usage but the cloud watch chart doesn't actually show as if its fully utlized.

Hence is there any way to tacle this and reduce the ec2 costing in aws?

1 Answers1

2

You can try:

  • Computer optimizer
  • Trusted advisor
  • Install the Cloudwatch Agent to ensure you have RAM metrics - by default CW can't see internal metrics, just external like network / CPU. Watch the CPU / RAM metrics and decide for yourself if they're overprovisioned.
  • Reduce the instance size and see what happens

It sounds to me like they're overprovisioned for CPU, but you should check the RAM use. The OS is likely using all the RAM for cache, the key metric I use in the Linux "free" is memory "used". The "free" metric takes into account the memory used for buffer / cache.

You can also use reserved instances or savings plans to save money, but right size your instances first. You should consider auto-scaling so AWS adds instances as required.

My experience is most enterprise servers are overprovisioned. I can run a low load t3a.nano with 512MB RAM and 512MB swap serving six low volume websites running Nginx / PHP / MySQL / other utilities like an open source version of Dropbox and it works very well.

Tim
  • 30,383
  • 6
  • 47
  • 77
  • Hi @Tim thanks for the response i will check, Just one more dout on cloud watch lets say if i install agent and start monitoring just memory metric in 100 instances is this the cost caculation? $0.30 for each metric per instances , so $0.30 * 100 = $30 and on top of it if i send metric every 5 min it might use very less api. So just confused with metric cost is that $0.30 for each instances or for any number of instances ? – Naggappan Ramukannan Jan 21 '22 at 04:59
  • I think it's $0.30 per metric per instance. In your case you could do something like a time limited test, or install it on only one or two representative instances. btw I'm not sure about t series behind a load balancer, with their CPU credit system they don't always balance well and it can be cheaper to use M series than t3 unlimited. You should check your CPU credits don't run out - I tend to alert on that metric. – Tim Jan 21 '22 at 07:26