Explain App Sleeping
I'm super confused on how app sleeping works
from how I understand, your app will be put to sleep if inactive, but how does railway know when to restart it?
I'm assuming if a request is made to the URL then the app is woken up but what about apps that don't use URLs, like discord bots?
Solution:Jump to solution
thank you guys
for anyone else curious and doesn't RTFM
it knows to put the app to sleep based on traffic, no outbound traffic -> sleep if it gets inbound traffic then it wakes up...
19 Replies
Project ID:
N/A
have you read the docs?
https://docs.railway.app/reference/app-sleeping
I couldn't find it in the docs
reading the docs explains the docs
thanks brody, i'll give a quick read
slow read
read quick and you wont digest what is said
and by the looks of the docs, your discord bot probably can't sleep
as a websocket connection is maintained and discord do regularly pings
yea i was about to ask about that
dang that sucks
if you're just using slash commands, you can receive them over http tho
Solution
thank you guys
for anyone else curious and doesn't RTFM
it knows to put the app to sleep based on traffic, no outbound traffic -> sleep if it gets inbound traffic then it wakes up
thanks for the advice :D
thats a nice tldr
<:chad_gamer:1000044370411663370> thank you
lol
I just started using this feature. Is is expected that the resources tab show active memory usage for sleeping apps?
the above app is using more memory while sleeping than another app I have that's not sleeping. Both Node apps
yeah when the app goes to sleep the graph just keeps repeating the last value, idealy this should just show zero when sleeing, this is a beta feature after all
id like to note, this is purely just a display bug, if your app is actually sleeping you wont be charged for any vcpu or mem minutes while it sleeps
I'm mostly concerned about being charged for it, in case it's not just a visual error
one step ahead of you