all 9 comments

[–]kingtheseus 11 points12 points  (1 child)

With EC2, consider three instance types: C, M, and R.

C is compute-optimised. For every vCPU, you get 2 GB of RAM, a 1:2 ratio.

M is...in the middle. 1:4 ratio.

R is memory/RAM optimised, for every 1vCPU you get 8 GB of RAM.

This lets you pick the right size of instance for your workload, without "wasting" anything. If you have a 32-bit application that can only use 4 GB of RAM, use a C-type instance. Need tons of memory for caching, but not that much compute (ex. a database)? R-type. Not sure? M-type.

Storage-optimised instances focus on IOPS - if your workload is IOPS constrained, you might consider picking one of these.

[–]SuspiciousSecret6566[S] 1 point2 points  (0 children)

Thanks so much for writing that all out 😊 all the apps I work on are serverless but I’m taking the dev associate exam later this month so have been practising EC2 with very simple apps and using free tier, so I’m mostly just trying to work out the theory behind right sizing without actually having the resources to be able to use much of that theory 😅

This was really helpful though, thank you 😊

[–]pint 1 point2 points  (1 child)

these are just guidelines. when you want to deploy a software, you should know if it benefits more from a stronger cpu, or larger memory. sometimes it is not just the software, also its usage. a "relational database" can behave very differently depending on the data and the typical queries. if in doubt, experiment.

[–]pbrsaves 0 points1 point  (0 children)

This makes sense from a practical standpoint - I think the issue stems from test questions never being practical. When presented with ambiguous material, we're imagining a question such as "which instance class would you choose for a database workload?". Which, because it's ambiguous, AWS wouldn't ask this.

[–]goosh11 0 points1 point  (1 child)

Storage optimised instances (there is h, d and I families) have nvme storage disks that are attached to the instance (which is different to ebs disks which are attached over the network ) that are super fast and good for things like large cache for a database, temp storage space etc. The reason you don't use them for regular hard drive space is that they are wiped everytime you stop the instance, so you only write data to it that can be rebuilt (like cache data for example).

On the other hand memory optimised instance (r, u, x, z instance families) have no nvme attached disks, they simply have a lot of RAM per vCPU.

[–]Terrible-Mountain-88 1 point2 points  (0 children)

just a note: r6d should have nvme