Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Many small instances or fewer larger instances on EC2

I have a computation/IO heavy backend service (image processing) that I run on EC2 instance (c3.large). As I need to scale this service I consider allocating tens of c3.large instances or fewer of the larger c3 instances. The pricing seems to be linear per computation power.

Why would I prefer fewer strong instances over more weaker instances? (and the other way around)

Some other requirement and info:

  • Scale to meet peak requirements
  • Tasks are single threaded. Multiple tasks can run per instance.
  • Low memory signature
  • Very low disk usage
  • Potentially high network usage to get the images (very fast computation)
like image 755
Xyand Avatar asked Nov 11 '22 14:11

Xyand


1 Answers

The on-demand prices are indeed quite linear within each instance family, so if your workload works equally well on multiple classes (i.e., no single task requires a particularly large amount of memory) then there may not be a significant difference... the network I/O capacity also scales up, along with memory and ECU... and the under-appreciated ephemeral storage space, which incurs no I/O-based charges.

However, prices on the spot market are not quite so linear.

My internal systems collect spot market pricing history (available in the console and via the API) that identifies the minimum bid that would have historically been necessary to keep a given instance running at a given percentage of uptime in a given availability zone. Historical data, of course, does not predict future performance, and the c3 family is still very new... but in the spot market, there are cases where the demand for smaller instances pushes the operational costs higher -- at least based on equivalent computing power, though sometimes even on the raw price -- than larger instances... so this is a likely an option worth considering.

The spot market has a minimum baseline price for each instance class + availability zone (presumably it's actually region, though the prices are tracked separately), and those baselines seem linear within instance families, as you would expect... but the market prices shift with demand, leading to the inversions I'm alluding to. Note also that the EC2 Classic and VPC prices for a given instance class also track separately, since, presumably the spare capacity within each platform is a separate collection of physical hosts.

Note also that if you pursue this route, you should investigate all instance classes, not just the ones that are an obvious fit for your workload. There are some extremely favorable pricing conditions waiting to be found, particularly on larger, and older, instance classes... and these pricing conditions also seem to be generally more stable over time, though, again, these are observations based on past performance.

like image 193
Michael - sqlbot Avatar answered Nov 14 '22 21:11

Michael - sqlbot