Home > Software engineering >  Choosing the right EC2 instance for three NodeJS Applications
Choosing the right EC2 instance for three NodeJS Applications

Time:01-22

I'm running three MEAN stack programmes. Each application receives over 10,000 monthly users. Could you please assist me in finding an EC2 instance for my apps?

I've been using a "t3.large" instance with two vCPUs and eight gigabytes of RAM, but it costs $62 to $64 per month.

I need help deciding which EC2 instance to use for three Nodejs applications.

CodePudding user response:

First check CloudWatch metrics for the current instances. Is CPU and memory usage consistent over time? Analysing the metrics could help you to decide whether you should select a smaller/bigger instance or not.

One way to avoid too unnecessary costs is to use auto scaling groups and load balancers. By using them and finding and applying proper settings, you could have always right amount of computing power for your applications.

https://docs.aws.amazon.com/AmazonCloudWatch/latest/monitoring/working_with_metrics.html

https://docs.aws.amazon.com/autoscaling/ec2/userguide/auto-scaling-groups.html

CodePudding user response:

Depends on your applications. If your apps need more compute power or more memory or more storage? Deciding a server is similar to installing an app on system. Check what are basic requirements for it & then proceed to choose server.

If you have 10k monthly customers, think about using ALB so that traffic gets distributed evenly. Try caching to server some content if possible. Use unlimited burst mode of t3 servers if CPU keeps hitting 100%. Also, try to optimize code so that fewer resources are consumed. Once you are comfortable with ec2 choice, try to purchase saving plans or RIs for less cost.

Also, do monitor the servers & traffic using Cloudwatch agent, internet monitor etc features.

  • Related