a year ago
I recently deployed a function to Railway that seems to wake up every 5 minutes and go back to sleep.
It has no external access and is set to run once every 24 hours via cron job.
Is there some way I can get insight into why this is happening?
10 Replies
Thanks for raising this! Can you try to disable app sleeping in your service settings? You won’t need it for a cron job.
That is what I decided to do because it seemed unnecessary.
Is it a normal occurrence for sleeping functions?
Does your function connect to anything over the private network or is it completely isolated?
It connects to my database via private network. My database was also sleeping though, and does not have these wakeup logs
Connection pools can wake up apps so that could be a reason: https://docs.railway.com/reference/app-sleeping#inactive-service-detection
I did have the function set to close the database connection but that is probably it. Although I would expect the database to wake up from the connection as well, right?
I think it depends. Any packets sent out at all will keep it from being inactive.
Status changed to Solved jaredlunde • about 1 year ago