I am trying to run something every 10 mins, in Github actions, but it's getting quite unreliable.
I have the following settings:
name: Monitor every 10 minutes
on:
schedule:
- cron: "6 * * * *"
- cron: "16 * * * *"
- cron: "26 * * * *"
- cron: "36 * * * *"
- cron: "46 * * * *"
- cron: "56 * * * *"
workflow_dispatch:
Sometimes the script runs in 10 mins, somethings 20 mins and sometimes 30 mins. I am quite surprised. is there any way to ensure reliability for this? Any suggestions would be helpful. I have gone through almost all the documentation on Github actions.
PS: I am using a self-hosted runner, could that be a factor?
From the docs:
The schedule event can be delayed during periods of high loads of GitHub Actions workflow runs. High load times include the start of every hour. If the load is sufficiently high enough, some queued jobs may be dropped. To decrease the chance of delay, schedule your workflow to run at a different time of the hour.
Github doesn't guarantee scheduled events will run at all in some cases and will wait at least 5 minutes between workflow runs. With schedules close together this can cause the issues you've described.
There isn't really a way to combat this, except switching to self-hosted runners.