R
Railway14mo ago
Fragly

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:
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...
Jump to solution
19 Replies
Percy
Percy14mo ago
Project ID: N/A
Brody
Brody14mo ago
Fragly
FraglyOP14mo ago
I couldn't find it in the docs
Adam
Adam14mo ago
reading the docs explains the docs
Fragly
FraglyOP14mo ago
thanks brody, i'll give a quick read
Brody
Brody14mo ago
slow read read quick and you wont digest what is said
ThallesComH
ThallesComH14mo ago
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
Fragly
FraglyOP14mo ago
yea i was about to ask about that dang that sucks whyy
ThallesComH
ThallesComH14mo ago
if you're just using slash commands, you can receive them over http tho
Solution
Fragly
Fragly14mo ago
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
Fragly
FraglyOP14mo ago
thanks for the advice :D
Brody
Brody14mo ago
thats a nice tldr
Fragly
FraglyOP14mo ago
<:chad_gamer:1000044370411663370> thank you
Brody
Brody14mo ago
lol
pauldps
pauldps14mo ago
I just started using this feature. Is is expected that the resources tab show active memory usage for sleeping apps?
No description
pauldps
pauldps14mo ago
the above app is using more memory while sleeping than another app I have that's not sleeping. Both Node apps
Brody
Brody14mo ago
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
pauldps
pauldps14mo ago
I'm mostly concerned about being charged for it, in case it's not just a visual error
Brody
Brody14mo ago
one step ahead of you
Want results from more Discord servers?
Add your server