My enquiry is that while my cloud system uses autoscaling to handle traffic, I want to trigger a cronjob that runs every 30 minutes that handles the integration with a 3rd party API. Now, my question is, does that cronjob abide by the autoscaling rules or does it run on its own instance.
As an example, let's say I have 4 instances open due to high traffic and the cronjob triggers. Would the cronjob run in all 4 instances of my application ?
Basically what I want to avoid is having 4x the API calls for an integration that does not allow a large number of API calls.
Hi @grigorisar,
Welcome to Google Cloud Community!
Your concern stems from the possibility of duplicate API calls when multiple instances execute the same cronjob. Here's an analysis and solution:
Possible Cause:
When autoscaling creates multiple instances of your application, each instance operates independently. If your cronjob logic is embedded within your application, it may execute on all active instances simultaneously, leading to duplicate API calls.
Recommendations:
These steps may ensure your system remains efficient while avoiding redundant API calls.
I hope the above information is helpful.