Help Choosing an EC2 Instance for Running 3 Docker Apps

0
4
Asked By CuriousCoder99 On

Hey everyone! I'm new to AWS EC2 and I've got three Dockerized applications ready to go: a MySQL database container that's using about 400 MB of memory, a Spring Boot app container using 500 MB, and an Angular app container using another 400 MB. In total, these containers are approximately using 1.25 GB of memory.

When I try to start all three containers at the same time, my EC2 instance drastically slows down, freezes, and even disconnects me. I currently have a t2.micro instance on the free tier, running Amazon Linux 2023 AMI. It works perfectly fine with just the DB and Spring Boot containers running simultaneously, so I'm wondering if there's a better instance type I should consider to run all three without issues. Any suggestions?

1 Answer

Answered By TechieSam23 On

The t2.micro instance comes with only 1 GiB of RAM, which is definitely not enough to run all three of your containers that require around 1.5 GiB at least. Plus, t2 instances have limited CPU credits, meaning performance can drop significantly once those credits run out. I’d recommend moving to an instance type with at least 2 GiB of RAM, but 4 GiB would be even better, especially since you’re running MySQL along with your Java app. Consider looking at t3 instances for better performance as well!

DockerNinja100 -

Thanks for the tips! I guess I should definitely explore some bigger instance types. Do you think it's better to run each container on separate instances instead?

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.