DEV Community

Jon Bonso for AWS Community Builders

Posted on

2 1

How to Speed-Up the AMI Creation of your EC2 instances

SCENARIO:

You have a legacy application hosted in a single Amazon EC2 instance running in the Production environment. You need to upgrade your systems and the existing instance must be vertically scaled (use a larger instance type). Before proceeding, you must create an AMI of the EC2 instance first before implementing the change.

ISSUE:

Upon testing, you found out that it takes hours for the AMI creation process to complete. This delay will increase the possible downtime of your application and might cause the migration activity to exceed the scheduled change window, affecting the end-users.

POSSIBLE SOLUTIONS:

Solution #1. Take an EBS snapshot of your EC2 instance before doing the actual migration. Create another snapshot or AMI again right after the first snapshot/AMI has been created.

Solutions #2. Increase the snapshot frequency of your EC2 instance in your Amazon Data Lifecycle Manager

KEY POINT:

  • The snapshot process is incremental. This means that only the blocks on the EBS device that have changed after your most recent snapshot are saved. Thus, future snapshots will take less time

References:
https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/EBSSnapshots.html
https://forums.aws.amazon.com/thread.jspa?threadID=91650

Sentry image

See why 4M developers consider Sentry, “not bad.”

Fixing code doesn’t have to be the worst part of your day. Learn how Sentry can help.

Learn more

Top comments (0)

Best Practices for Running  Container WordPress on AWS (ECS, EFS, RDS, ELB) using CDK cover image

Best Practices for Running Container WordPress on AWS (ECS, EFS, RDS, ELB) using CDK

This post discusses the process of migrating a growing WordPress eShop business to AWS using AWS CDK for an easily scalable, high availability architecture. The detailed structure encompasses several pillars: Compute, Storage, Database, Cache, CDN, DNS, Security, and Backup.

Read full post