I have a containerized spring boot application. Currently there are 10+ instances of same spring boot application. Application is deployed in Azure and based on load pods may come up and go down.
Within that application i have scheduled a task to perform an activity. This activity is a high memory intensive task.
Since I have 10+ instances of same application running, when schedule get triggered say Example 09:00 AM, all my pods are performing scheduled activity at same time.
Because of this memory is not sufficient and pods are going down.
Is there a way to handle this in spring boot? Say for example since I have schedule at 09:00 AM, instead of all 10 instances starting at 09:00 AM I have to start three instances schedule @09:00 other three @09:01 and remaining @09:02
Can i schedule like this in spring boot? Or Is there any better way to handle this?