#Explain App Sleeping

25 messages · Page 1 of 1 (latest)

meager blaze
#

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?

wet groveBOT
#

Project ID: N/A

plucky vesselBOT
#

To help others find answers, you can mark your question as solved via Right click solution message -> Apps -> ✅ Mark Solution

proven path
meager blaze
#

I couldn't find it in the docs

open hound
#

reading the docs explains the docs

meager blaze
#

thanks brody, i'll give a quick read

proven path
#

slow read

#

read quick and you wont digest what is said

dreamy pecan
#

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

meager blaze
#

yea i was about to ask about that

#

dang that sucks whyy

dreamy pecan
#

if you're just using slash commands, you can receive them over http tho

meager blaze
#

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

meager blaze
plucky vesselBOT
proven path
#

thats a nice tldr

meager blaze
#

chad_gamer thank you

proven path
#

lol

rain saddle
#

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

proven path
#

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

rain saddle
#

I'm mostly concerned about being charged for it, in case it's not just a visual error