CPU and RAM Usage on EC2 K3S instance with Qovery

Thank you for sharing more context. Let me explain why there are not enough resources to deploy your app (I also have a quick workaround for you :smiling_face:).

Ok, so you are using a t3a.medium AWS instance to run your workload (excellent). Let me detail what you have inside.

As you can see in the diagram below, your t3a.medium instance already has 0.5 CPU, and 2.5GB of RAM is used by some internal services (as explained above). This is already optimized and can’t be lowered, unfortunately. So your allocable CPU is 1.5, and your allocable RAM is 1.5GB. So what does that mean for your application when you deploy it the first time? It means this :point_down:

Once your app is deployed, your app consumes 0.5 CPU and 1GB of RAM of this t3a.medium instance. So now the free resources are 1 CPU and 0.5GB of RAM. The problem is that when you deploy a new app version, we will use the Rolling Update strategy deployment method of Kubernetes. This means we will need 0.5 CPU more and 1GB of RAM during the update! But we only have 0.5 GB of RAM available :fearful:.

Solution

2 solutions here:

  1. You reduce the memory consumed by your application to ensure that 2 instances can run in parallel during the update. It can’t exceed 1.5 GB of RAM in total. So maybe 512MB of RAM would be great?
  2. To have more RAM, you need to upgrade your t3a.medium instance into a t3a.large instance.

Workaround

I have a small workaround for you to stick to a t3a.medium instance with 1GB of RAM allocated to your app. Stop your app before an update and start with the new version. It’s not ideal at all, but at least it works.

I hope it helps.

3 Likes