首页 \ 问答 \ AWS预留实例限制(AWS Reserved Instances Limits)

AWS预留实例限制(AWS Reserved Instances Limits)

我们目前在我们的AWS账户中运行少量m4.large和少量t2.medium&t2.small实例(EC2)。 我们计划在帐户中购买少量预留实例(RI)。 我参加了AWS博客 - 新增 - EC2预留实例的实例大小灵活性,并尝试启动了RI,但却遇到了一些问题。

请帮我澄清一下:

  1. 如果我购买1 t2.large的保留实例,我们可以运行它的等效t2。 相同成本的小或8 t2.micro实例(参考上面链接中的归一化因子)?

  2. 为了实现这种规范化实例大小的灵活性,选择哪种提供类 - “标准”或“可转换”或“要么应该没问题”?

  3. 实例规范化是否可以跨越不同的实例族? 即m4.large与t2.medium?

  4. 实例规范化是否会在之前和当前一代系列中发挥作用? 即m4.large与m3.medium?

  5. 我们有3个不同的AWS账户和一个合并账单,这个RI账单是否会在所有3个账户中正常化?

  6. 如果我购买任何级别的RI一年,如果我发现6个月后我的账户中没有这样的实例要求,那么我仍需要按月模式支付全部1年费用(如果我选择“No Upfront” “。获得一些钱(如果可能的话)的唯一方法是在”预留市场“中出售?

  7. 我们是否具有实例类型灵活性,仅适用于EC2或其他资源类型(RDS / Elasticache等)?


We're currently running few m4.large & few t2.medium & t2.small instances (EC2) in our AWS account. We're planning to buy few reserved instances (RI) in our accounts. I went to AWS Blog - New – Instance Size Flexibility for EC2 Reserved Instances and tried launching the RI but got stuck with a couple of things.

Please help me in clarifying:

  1. If I buy a reserved instance of 1 t2.large, can we run its equivalent t2. small or 8 t2.micro instance at the same cost (referring to its normalization factor in link above)?

  2. For this normalization on instance size flexibility to work, what offering class to be selected - "Standard" or "Convertible" or "Either should be fine"?

  3. Will the instance normalization work across different families of instances? i.e. m4.large with t2.medium?

  4. Will the instance normalization work across previous & current generation families? i.e. m4.large with m3.medium?

  5. We have 3 different AWS accounts with a consolidated billing, will this RI billings will be normalized across all 3 accounts?

  6. If I buy a RI of any class for 1 year and if I find that there is no such instance requirement in my account after 6 months, then still I need to pay the entire 1 year fees in monthly model (If I chose "No Upfront". The only way to get some money (if possible) would be to sell that in "Reserved Marketplace"?

  7. Do we have instance type flexibility only work with EC2 or for other resource types (RDS/Elasticache etc.)?


原文:https://stackoverflow.com/questions/44177938
更新时间:2022-02-08 08:02

最满意答案

如上所述,您需要传递自定义比较功能进行排序。 像这样的东西

function s(a,b){
  function normalize(str){
    return str.concat(new Array(4-str.length).join(';')).replace(/[A-Z+-]/g, function($1){
      return replacer[$1] ? replacer[$1] : $1;
    });
  }

  var replacer = {
    'A' : '1',
    'B' : '2',
    'C' : '3',
    '+' : ':',
    '-' : '<'
  },

  ar = normalize(a),
  br = normalize(b);

  return ar > br ? 1
       : ar < br ? -1
       : 0;
}

var array1 = ["AAA","BB","B+","AA+","CC","AA-","B","A","AA"];

function s(a,b){
  function normalize(str){
    return str.concat(new Array(4-str.length).join(';')).replace(/[A-Z+-]/g, function($1){
      return replacer[$1] ? replacer[$1] : $1;
    });
  }
  
  var replacer = {
    'A' : '1',
    'B' : '2',
    'C' : '3',
    '+' : ':',
    '-' : '<'
  },
  
  ar = normalize(a),
  br = normalize(b);
  
  return ar > br ? 1
       : ar < br ? -1
       : 0;
}

document.getElementById('before').innerHTML = 'unsorted: ' + array1.join();

array1.sort(s);

document.getElementById('result').innerHTML = 'sorted: ' + array1.join();
<span id="before"></span><br>
<span id="result"></span>

更新:更通用一点

function sorting(maxLen) {
  return function s(a, b) {
    function checkLength(str, maxlen) {
      if (str.length > maxlen) {
        throw new Error('string: "' + str + '" (' + str.length + ') too long, max len: ' + maxlen);
      }
    }

    function normalize(str, maxlen) {
      return str.concat(new Array(maxlen + 1 - str.length).join(';')).replace(/[A-Z+-]/g, function($1) {
        return replacer[$1] ? replacer[$1] : $1;
      });
    }

    checkLength(a, maxLen);
    checkLength(b, maxLen);

    var replacer = {
        'A': '1',
        'B': '2',
        'C': '3',
        '+': ':',
        '-': '<'
      },
      ar = normalize(a, maxLen),
      br = normalize(b, maxLen);

    return ar > br ? 1 : ar < br ? -1 : 0;
  }
}

并使用它的功能

array1.sort(sorting(array1.reduce(function(a,b){return Math.max(a, b.length);},0))) 

var array1 = ["AAAA", "BB", "BBBB+", "AAA+", "CC", "AA-", "BBBB", "A", "AA"];
var array2 = ["AAAA", "BB", "BBBBB+", "AAA+", "CC", "AA-", "BBBB", "A", "AA"];

function sorting(maxLen) {
  return function s(a, b) {
    function checkLength(str, maxlen) {
      if (str.length > maxlen) {
        throw new Error('string: "' + str + '" (' + str.length + ') too long, max len: ' + maxlen);
      }
    }

    function normalize(str, maxlen) {
      return str.concat(new Array(maxlen + 1 - str.length).join(';')).replace(/[A-Z+-]/g, function($1) {
        return replacer[$1] ? replacer[$1] : $1;
      });
    }

    checkLength(a, maxLen);
    checkLength(b, maxLen);

    var replacer = {
        'A': '1',
        'B': '2',
        'C': '3',
        '+': ':',
        '-': '<'
      },
      ar = normalize(a, maxLen),
      br = normalize(b, maxLen);

    return ar > br ? 1 : ar < br ? -1 : 0;
  }
}

function test(witherror, arr, maxlen) {
  document.getElementById(witherror + 'before').innerHTML = 'unsorted: ' + arr.join();

  try {

    arr.sort(sorting(maxlen||arr.reduce(function(a,b){return Math.max(a, b.length);},0)));

    document.getElementById(witherror + 'result').innerHTML = 'sorted: ' + arr.join();

  } catch (e) {

    document.getElementById(witherror + 'result').innerHTML = e;

  }
}

test('', array1,5);
test('e', array2,5);
test('a', array2);
<span>sample with error, string is too long</span>
<br>
<span id="ebefore"></span>
<br>
<span id="eresult"></span>
<hr>
<span>sample without error, maxlen = 5</span>
<br>
<span id="before"></span>
<br>
<span id="result"></span>
<hr>
<span>sample without error</span>
<br>
<span id="abefore"></span>
<br>
<span id="aresult"></span>


As say above you need pass custom compare function to sort. Something like this

function s(a,b){
  function normalize(str){
    return str.concat(new Array(4-str.length).join(';')).replace(/[A-Z+-]/g, function($1){
      return replacer[$1] ? replacer[$1] : $1;
    });
  }

  var replacer = {
    'A' : '1',
    'B' : '2',
    'C' : '3',
    '+' : ':',
    '-' : '<'
  },

  ar = normalize(a),
  br = normalize(b);

  return ar > br ? 1
       : ar < br ? -1
       : 0;
}

var array1 = ["AAA","BB","B+","AA+","CC","AA-","B","A","AA"];

function s(a,b){
  function normalize(str){
    return str.concat(new Array(4-str.length).join(';')).replace(/[A-Z+-]/g, function($1){
      return replacer[$1] ? replacer[$1] : $1;
    });
  }
  
  var replacer = {
    'A' : '1',
    'B' : '2',
    'C' : '3',
    '+' : ':',
    '-' : '<'
  },
  
  ar = normalize(a),
  br = normalize(b);
  
  return ar > br ? 1
       : ar < br ? -1
       : 0;
}

document.getElementById('before').innerHTML = 'unsorted: ' + array1.join();

array1.sort(s);

document.getElementById('result').innerHTML = 'sorted: ' + array1.join();
<span id="before"></span><br>
<span id="result"></span>

UPDATE: a bit more generic

function sorting(maxLen) {
  return function s(a, b) {
    function checkLength(str, maxlen) {
      if (str.length > maxlen) {
        throw new Error('string: "' + str + '" (' + str.length + ') too long, max len: ' + maxlen);
      }
    }

    function normalize(str, maxlen) {
      return str.concat(new Array(maxlen + 1 - str.length).join(';')).replace(/[A-Z+-]/g, function($1) {
        return replacer[$1] ? replacer[$1] : $1;
      });
    }

    checkLength(a, maxLen);
    checkLength(b, maxLen);

    var replacer = {
        'A': '1',
        'B': '2',
        'C': '3',
        '+': ':',
        '-': '<'
      },
      ar = normalize(a, maxLen),
      br = normalize(b, maxLen);

    return ar > br ? 1 : ar < br ? -1 : 0;
  }
}

and use it function like

array1.sort(sorting(array1.reduce(function(a,b){return Math.max(a, b.length);},0))) 

var array1 = ["AAAA", "BB", "BBBB+", "AAA+", "CC", "AA-", "BBBB", "A", "AA"];
var array2 = ["AAAA", "BB", "BBBBB+", "AAA+", "CC", "AA-", "BBBB", "A", "AA"];

function sorting(maxLen) {
  return function s(a, b) {
    function checkLength(str, maxlen) {
      if (str.length > maxlen) {
        throw new Error('string: "' + str + '" (' + str.length + ') too long, max len: ' + maxlen);
      }
    }

    function normalize(str, maxlen) {
      return str.concat(new Array(maxlen + 1 - str.length).join(';')).replace(/[A-Z+-]/g, function($1) {
        return replacer[$1] ? replacer[$1] : $1;
      });
    }

    checkLength(a, maxLen);
    checkLength(b, maxLen);

    var replacer = {
        'A': '1',
        'B': '2',
        'C': '3',
        '+': ':',
        '-': '<'
      },
      ar = normalize(a, maxLen),
      br = normalize(b, maxLen);

    return ar > br ? 1 : ar < br ? -1 : 0;
  }
}

function test(witherror, arr, maxlen) {
  document.getElementById(witherror + 'before').innerHTML = 'unsorted: ' + arr.join();

  try {

    arr.sort(sorting(maxlen||arr.reduce(function(a,b){return Math.max(a, b.length);},0)));

    document.getElementById(witherror + 'result').innerHTML = 'sorted: ' + arr.join();

  } catch (e) {

    document.getElementById(witherror + 'result').innerHTML = e;

  }
}

test('', array1,5);
test('e', array2,5);
test('a', array2);
<span>sample with error, string is too long</span>
<br>
<span id="ebefore"></span>
<br>
<span id="eresult"></span>
<hr>
<span>sample without error, maxlen = 5</span>
<br>
<span id="before"></span>
<br>
<span id="result"></span>
<hr>
<span>sample without error</span>
<br>
<span id="abefore"></span>
<br>
<span id="aresult"></span>

相关问答

更多

相关文章

更多

最新问答

更多
  • 您如何使用git diff文件,并将其应用于同一存储库的副本的本地分支?(How do you take a git diff file, and apply it to a local branch that is a copy of the same repository?)
  • 将长浮点值剪切为2个小数点并复制到字符数组(Cut Long Float Value to 2 decimal points and copy to Character Array)
  • OctoberCMS侧边栏不呈现(OctoberCMS Sidebar not rendering)
  • 页面加载后对象是否有资格进行垃圾回收?(Are objects eligible for garbage collection after the page loads?)
  • codeigniter中的语言不能按预期工作(language in codeigniter doesn' t work as expected)
  • 在计算机拍照在哪里进入
  • 使用cin.get()从c ++中的输入流中丢弃不需要的字符(Using cin.get() to discard unwanted characters from the input stream in c++)
  • No for循环将在for循环中运行。(No for loop will run inside for loop. Testing for primes)
  • 单页应用程序:页面重新加载(Single Page Application: page reload)
  • 在循环中选择具有相似模式的列名称(Selecting Column Name With Similar Pattern in a Loop)
  • System.StackOverflow错误(System.StackOverflow error)
  • KnockoutJS未在嵌套模板上应用beforeRemove和afterAdd(KnockoutJS not applying beforeRemove and afterAdd on nested templates)
  • 散列包括方法和/或嵌套属性(Hash include methods and/or nested attributes)
  • android - 如何避免使用Samsung RFS文件系统延迟/冻结?(android - how to avoid lag/freezes with Samsung RFS filesystem?)
  • TensorFlow:基于索引列表创建新张量(TensorFlow: Create a new tensor based on list of indices)
  • 企业安全培训的各项内容
  • 错误:RPC失败;(error: RPC failed; curl transfer closed with outstanding read data remaining)
  • C#类名中允许哪些字符?(What characters are allowed in C# class name?)
  • NumPy:将int64值存储在np.array中并使用dtype float64并将其转换回整数是否安全?(NumPy: Is it safe to store an int64 value in an np.array with dtype float64 and later convert it back to integer?)
  • 注销后如何隐藏导航portlet?(How to hide navigation portlet after logout?)
  • 将多个行和可变行移动到列(moving multiple and variable rows to columns)
  • 提交表单时忽略基础href,而不使用Javascript(ignore base href when submitting form, without using Javascript)
  • 对setOnInfoWindowClickListener的意图(Intent on setOnInfoWindowClickListener)
  • Angular $资源不会改变方法(Angular $resource doesn't change method)
  • 在Angular 5中不是一个函数(is not a function in Angular 5)
  • 如何配置Composite C1以将.m和桌面作为同一站点提供服务(How to configure Composite C1 to serve .m and desktop as the same site)
  • 不适用:悬停在悬停时:在元素之前[复制](Don't apply :hover when hovering on :before element [duplicate])
  • 常见的python rpc和cli接口(Common python rpc and cli interface)
  • Mysql DB单个字段匹配多个其他字段(Mysql DB single field matching to multiple other fields)
  • 产品页面上的Magento Up出售对齐问题(Magento Up sell alignment issue on the products page)