Function erroneously wakes up every 5 minutes
exoup
HOBBYOP

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?

Solved

10 Replies

exoup
HOBBYOP

a year ago

a0ca84bb-92ac-4c69-9b2e-5828d332d558


jaredlunde
EMPLOYEE

a year ago

Thanks for raising this! Can you try to disable app sleeping in your service settings? You won’t need it for a cron job.


exoup
HOBBYOP

a year ago

That is what I decided to do because it seemed unnecessary.
Is it a normal occurrence for sleeping functions?


jaredlunde
EMPLOYEE

a year ago

Does your function connect to anything over the private network or is it completely isolated?


exoup
HOBBYOP

a year ago

It connects to my database via private network. My database was also sleeping though, and does not have these wakeup logs


jaredlunde
EMPLOYEE

a year ago

Connection pools can wake up apps so that could be a reason: https://docs.railway.com/reference/app-sleeping#inactive-service-detection


exoup
HOBBYOP

a year ago

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?


jaredlunde
EMPLOYEE

a year ago

I think it depends. Any packets sent out at all will keep it from being inactive.


exoup
HOBBYOP

a year ago

Thanks for the help


jaredlunde
EMPLOYEE

a year ago

!s


Status changed to Solved jaredlunde about 1 year ago


Loading...