0

Let's say I want to place my tasks on EC2 instances of type m6i.large, which has 2 vCPU and 8GB of memory.

I have 10 ECS tasks, each requiring 512 mCPU and 512MB of memory. How many EC2 instances do I need to run them?

Total CPU    = 10 x 512 / 1024 = 5 vCPU
Total Memory = 10 x 512 / 1024 = 5 GB

Do they require 3 instances of m6i.large to meet the CPU demands? Or can they share the same instance (and hopefully not burst at the same time to overload the machine)?

2
  • can you use auto-scaling groups - to handle the potential bursts?
    – Peter Turner
    Commented May 31, 2023 at 15:48
  • Yes, I can use Auto Scaling Groups to handle the bursts. However this question is not about ASG. If the ASG decides that 10 is the appropriate number of tasks, then how many EC2 instances do I need to host those 10 instances? Commented May 31, 2023 at 18:04

1 Answer 1

0

You're not asking about auto scaling groups, but I think you probably should be in that paradigm. If you're using an EC2 instance for doing two tasks where you could use the EC2 instance for one task - or even an EKS workload, you can save dough.

If you're just talking about operations on a single instance, nothing really changes in the cloud. You need to keep your load (see top commensurate to your number of cores. I have a hard time trusting the mCPU number you gave - I don't really know what that means (this is probably just me not knowing a thing).

I think you will get the most bang for your buck running t2a.smalls (1 CPU, 2GB's of RAM) with one process on them each. Reserve ten of them and let ASG pick up the bursty work.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.