I have an AWS Elastic Beanstalk worker environment which processes some data in Node.js based on SQS messages or Cron-Jobs.
One of the Cron-Jobs is running a main process (currently taking 20~ minutes) which launches 0-N async "child-processes". The child processes have a worst case runtime of one hour with regularly sleeps of 1 minute in it.
In the logs I found some those child processes never finishing, in a FIFO manner, so it seems like this is caused by the Load Balancer shutting down instances where those processes are still running. Those processes are also not taking up a lot of CPU because of the sleeps, which may contribute to the issue, since the load balance measurement works with the CPU metric.
Is there a simple, if possible "on-instance" way to prevent the Load Balancer shutting the instance down during the process runtime?