Skip to content

Instantly share code, notes, and snippets.

@stormy
Created January 21, 2015 18:19
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save stormy/b19c307093c4782ac10a to your computer and use it in GitHub Desktop.
Save stormy/b19c307093c4782ac10a to your computer and use it in GitHub Desktop.
maxCpuPerUnitPrice = 0
optimalInstanceType = null
For each instance_type in (Availability Zone, Region) {
cpuPerUnitPrice = instance.cpuCores/instance.spotPrice
if (maxCpuPerUnitPrice < cpuPerUnitPrice) {
optimalInstanceType = instance_type;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment