Issue
Say I have three options:
Instance type | vCPU | Memory (GiB) | Bandwidth (Gbps) | Price |
---|---|---|---|---|
Small | A | B | C | D |
Medium | 2A | 2B | 2C | 2D |
Large | 4A | 4B | 4C | 4D |
What are the implications of running 4 small instances vs 2 medium vs 1 large? Is one better or are they the same?
I am very new to all of this, thanks in advance.
Solution
Your table is accurate within an Instance Type family. For example, m5.large
, m5.xlarge
and m5.2xlarge
.
Some benefits of using multiple (smaller) instances are:
- Distribute instances across multiple Availability Zones (different data centers) to avoid potential outage time (it is rare, but can happen)
- If something goes wrong on a single instance, only a portion of your capacity is lost rather than losing all capacity
- If your application is not capable of using multiple CPUs, then running threads on separate instances will perform better than running a single thread on a larger instance
- Instances can be updated (eg installing a new version of software) individually, so only a portion of your total capacity is unavailable during the upgrade process, rather than it all being unavailable
- You can test a newer version of your software on a single instance and monitor it closely to confirm that it is behaving as expected, rather than needing to roll-out changes all at once
The down-sides of using multiple instances are:
- More overhead having to run operating systems on each instance (so less RAM and CPU is available to the application)
- The application needs to be designed to run across multiple instances (typically in a stateless manner)
- A Load Balancer is required to distribute the load (assuming you are running a web app)
Answered By - John Rotenstein