如何选择合适的 AWS Elastic Beanstalk 实例类型和数量?

How do I choose the right AWS Elastic Beanstalk instance types and quantity?

在负载均衡环境类型中,他们写道“我们建议至少使用两种实例类型。”

  1. 如果可以设置最大实例数,为什么要选择不同的实例类型?
  2. 假设我选择了3种不同的实例类型,最大实例数为4;如果是这样,12 个不同的实例是否会在高峰流量时间同时 运行?
  3. 选择 4 个 1GB/1vCPU 实例或 2 个 2GB/2vCPU 实例有显着差异吗? (就目前而言,选择弱和便宜的实例并保持最大实例数高似乎是合乎逻辑的)

If I can set the maximum instance number, why should I choose different instance types?

这是你的选择。

某些实例类型有时可能无法在您指定的区域启动 - 这是我能想到的一个原因,这将使拥有超过 1 种实例类型变得有用。

Suppose I chose 3 different instance types and the maximum number of instances of 4; If so, will 12 different instances run simultaneously at peak traffic time?

没有

The EC2 Fleet attempts to launch the number of instances that are required to meet the target capacity specified in your request 即您在给定时间最多只能有 4 个实例 运行。

这 4 个实例可能具有您在 3 个列表中指定的任何实例类型,但最多为 4 个。

您永远不会有 12 个实例。

Is there a significant difference between choosing 4 instances with 1GB/1vCPU or 2 instances with 2GB/2vCPUs? (For now, it seems logical to choose weak and cheap instances and keep the maximum number of instances high)

这取决于您的应用需求。

如果您的应用程序在 1GB/1vCPU 上运行良好,那么使用该配置是合乎逻辑的。所需的实例数量再次取决于您的应用程序。

最终,您要在性能和成本之间进行权衡 - 这个问题只有您才能回答。