ウォームプール内のインスタンスは、どの状態がお勧めか教えてください

2023.11.05

困っていること

起動に⻑い時間のかかるインスタンスを事前起動できる仕組みとして、Amazon EC2 Auto Scaling のウォームプール機能を検討しています。
(スケールアウトが発⽣するとウォームプールから 開始/Start されるため、ゼロから 起動/Launch するよりも格段に速いことが期待されます)
ウォームプール内のインスタンスは、以下 3 つの状態のいずれかで保持可能ですが、どの状態がお勧めか教えてください。

  • Stopped
  • Running
  • Hibernated

どう対応すればいいの?

Running 以外の状態をお勧めします。
ウォームプール内のインスタンスを Running 状態にしておくことも可能ですが、不必要な料金の発生避けるためにも Running 以外の状態を強くお勧めします。

Stopped 状態では、使用したボリュームとインスタンスにアタッチされた Elastic IP アドレスに対してのみ料金が発生します。
Hibernated 状態は、メモリ内容 (RAM) を削除せずに、インスタンスを停止する状態に保つことが可能です。この場合は、RAM コンテンツのストレージとインスタンスにアタッチされた Elastic IP アドレスを含む EBS ボリュームの料金のみ発生します。

Warm pool instance state
You can keep instances in the warm pool in one of three states: Stopped, Running, or Hibernated. Keeping instances in a Stopped state is an effective way to minimize costs. With stopped instances, you pay only for the volumes that you use and the Elastic IP addresses attached to the instances.

Alternatively, you can keep instances in a Hibernated state to stop instances without deleting their memory contents (RAM). When an instance is hibernated, this signals the operating system to save the contents of your RAM to your Amazon EBS root volume. When the instance is started again, the root volume is restored to its previous state and the RAM contents are reloaded. While the instances are in hibernation, you pay only for the EBS volumes, including storage for the RAM contents, and the Elastic IP addresses attached to the instances.

Keeping instances in a Running state inside the warm pool is also possible, but is highly discouraged to avoid incurring unnecessary charges. When instances are stopped or hibernated, you are saving the cost of the instances themselves. You pay for the instances only when they are running.

参考資料