Best EC2 Instance for Running Three Docker Apps Simultaneously?

0
12
Asked By TechyExplorer42 On

Hey everyone! I'm diving into AWS EC2 and I've dockerized three applications. Here's a quick breakdown:
1. A MySQL DB container (needs about 400MB of memory)
2. A SpringBoot app container (around 500MB)
3. An Angular app container (also about 400MB)

In total, I need roughly 1.25GB of memory for all three containers.

Currently, I'm using a t2.micro instance on the free tier with Amazon Linux 2023 AMI. The problem I'm encountering is that I can't run all three containers at once; the instance slows down significantly and eventually freezes, leading to disconnection until I reboot.

So, I'm wondering what EC2 instance type would be suitable for running all three containers at the same time without issues?

4 Answers

Answered By NetNinja85 On

Consider moving the Angular container to a static host like S3; that should free up valuable resources on your EC2 instance.

Answered By SimpleDev98 On

Honestly, for this setup, do you really need to dockerize all three applications on EC2? If they're lightweight, running them as native applications could simplify things.

Answered By DataDynamo23 On

You're right, the t2.micro lacks the RAM for your containers. A slightly larger instance type would definitely help, and I'd suggest keeping some memory free to handle bursts in usage. Another option you might think about is hosting the SpringBoot app on t2.micro, the Angular app on S3 for static hosting, and moving MySQL to RDS or Aurora—just check if those options have free tier support.

Answered By CloudGuru99 On

The t2.micro instance only has 1GiB of RAM, which is not enough for your three containers that require around 1.5GiB in total. Plus, t2 instances are burstable, meaning you lose performance once your CPU credits run out. You should consider an instance with at least 2GiB of RAM, but ideally 4GiB for your setup with MySQL and SpringBoot. Also, 2 vCPUs would be beneficial since t2.micro has just one.

Related Questions

LEAVE A REPLY

Please enter your comment!
Please enter your name here

This site uses Akismet to reduce spam. Learn how your comment data is processed.