I have a NodeJS program that has 50 workers ready to process requests. The script maintains connections to the service that distributes requests.
I want to autoscale this script so that when 45 workers are busy (I can determine this programmatically), CPU is at 70%, or some networking metric is reached, a new instance of the script is launched on a new EC2 instance so there will now be 100 workers.
What is the best way to do this on AWS? I just need a shove in the right direction. Should I use elastic beanstalk?
I don't need a load balancer because the workers maintain connections. Connections are never initiated by a request.