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