1

I've got a NodeJS application that does some moderately intense logic work when a user requests it. For example, a user on the frontend can click Analyze and the server will perform the work, which could take 30 seconds to 1 minute (non-blocking)

My app is not aimed at the wide public but at an audience of a few thousand. So there is a chance that several people might analyze at the same time.

I'm currently planning to deploy the app via Elastic Beanstalk, but I am not sure exactly how it will deal with a server when it is busy and if I have to implement some kind of custom signal to tell the load balancer to send requests to another instance, if the current one is busy performing analysis.

I understand that Lambdas are often held up as an option in this case, but I would much prefer to keep it simple and keep the code in my Node app.

How should I design this to ensure the app could handle doing analysis and still handling other requests normally?

shad-chan
  • 43
  • 3

1 Answers1

2

Elastic Beanstalk uses Autoscaling Group to launch and maintain the EC2 instances required to run the Application. With Autoscaling Groups you can increase/decrease the EC2 instance count dynamically with Autoscaling Scaling policies. By default, Autoscaling Group provides scaling based on CPU, Network IN, Network Out, Request Count, Latency etc.. You can use any of these metrics and Scale-up your infrastructure dynamically.

You can refer to AWS Documentation here for more information.

sudheerchamarthi
  • 1,081
  • 8
  • 13