1

I have an app that is deployed on AWS using ECS and recently facing some issues with memory utilization.

To give you a little background:

  1. Our app is Node.js (specifically Sails.js) backend with React used for front-end
  2. In the ECS task definition, we've set the memory to 900 and cpu to 600 units respectively
  3. Instance type is t2.micro
  4. The AMI we use is Amazon ECS optimized (appears to use Docker Docker version 18.06.1-ce)
  5. We have one service (not separated for frontend/backend) running per container (per EC2 instance)
  6. Typically have at least 2 instances running with ALB in between
  7. We use DynamoDB and ElastiCache (Redis)

Accordingly to Cloudwatch logs, memory utilization hovers around ~50-60% utilization.

Running process.memoryUsage() on one of the instances produces the following:

{ rss: 28999680,
  heapTotal: 7684096,
  heapUsed: 4982976,
  external: 16837 }

Is this normal for a production Node/React app?

Must we modify instance type and increase resources?

Does Docker also use additional resources that we must account for?

Any insight or recommendations would be greatly appreciated.

Aaron
  • 183
  • 3
  • 11

1 Answers1

0

Is this normal for a production Node/React app?

It really depends on the app. A hello world app will be drastically different from a deep learning training app.

Must we modify instance type and increase resources?

Are you facing problems with the performance from a user perspective? eg does the app hang while you're using it?

Does Docker also use additional resources that we must account for?

I would think so

Any insight or recommendations would be greatly appreciated.

Did you check fargate? Here's an excerpt

Amazon ECS features AWS Fargate, so you can deploy and manage containers without having to provision or manage servers. With Fargate, you no longer have to select Amazon EC2 instance types, provision, and scale clusters of virtual machines to run containers or schedule containers to run on clusters and maintain their availability. Fargate enables you to focus on building and running applications, not the underlying infrastructure.

Shadi
  • 121
  • 5