New ec2 instance with GPU using custom AMI takes long time to start up for the first time

0

I set up a custom AMI for a EC2 G4dn instance which host a GPU web app. On a typical instance startup, it takes about 1 min for the web app to load data from disk and external websites into memory and be ready to serve. However, this startup process takes >10 mins on each new instance I created on this custom AMI, and then the next time the same instance would take the normal 1 min for startup.

So, what is happening differently on each new instance I started for the 1st time, compared to their following startups? How can I prevent this? I am worried that this may affect how autoscaling groups for this web app.

zhaof05
質問済み 1年前767ビュー
2回答
0

Without knowing more about the base AMI you're building from this is just part educated-guess / part stab-in-the-dark, but on the first boot could it be doing an SELinux relabel, and has to walk the whole of the directory tree (which takes time)?

Subsequent reboots won't need this, so they are quicker.

profile picture
エキスパート
Steve_M
回答済み 1年前
0

When you create an AMI, a snapshot is created and stored in S3. Start an instance from the AMI, it takes time to read from S3 when initialize EBS, and if there is a large amount of custom data in the custom AMI, it takes a certain amount of time to initialize.

To reduce this time, you can refer to the following solutions: https://docs.aws.amazon.com/ebs/latest/userguide/ebs-fast-snapshot-restore.html

But sorry, I don't know how to use this feature with ASG, please let me know if you know, thanks.

tong_K
回答済み 2ヶ月前

ログインしていません。 ログイン 回答を投稿する。

優れた回答とは、質問に明確に答え、建設的なフィードバックを提供し、質問者の専門分野におけるスキルの向上を促すものです。

質問に答えるためのガイドライン

関連するコンテンツ