How to prevent the app enter the "sleep mode"?

Hi everyone, I created a webapp to share my research, but I found the app enters “sleep mode” pretty frequently. I found that the app enters “sleep mode” when there are no activities during a week, but I found it actually enters “sleep mode” more frequently (every ~3 days). I really want to prevent it before I formally publish it to the research community, and I wonder if there is any way to prevent it.

Also, I wonder whether “inactivity” refers to traffics (someone connected to the app) or action (such as clicking a button), so that I can prepare to prevent it.

Thanks a lot!

All apps without traffic for one weekday will go to sleep. The system checks apps for inactivity throughout each day as follows:

  • Tuesday through Friday: All apps without traffic for 24 hours (one day) will go to sleep.
  • Saturday through Monday: All apps without traffic for 72 hours (three days) will go to sleep.

Community Cloud hibernates apps to conserve resources and allow the best communal use of the platform. To keep your app awake, simply visit the app or commit to your app’s repository, even if it’s an empty commit!

2 Likes

Thank you! I’ll try to do that.

My Streamlit app is deployed from connecting to a GitHub repo. If I make a change to the underlying code and then add, commit, push to the repo, will this “trigger” a refresh on the app, similar to a user visiting the app? I will likely have regular updates to the code, but I’m not sure how often a user will visit the app. I’m wondering if this process will also keep my app from entering “sleep mode.”

Yes, pushing a commit, even an empty one, will prevent your app from going to sleep: Manage your app - Streamlit Docs

1 Like

I have an app that had a commit an hour ago but was still asleep, is there something else that could be causing this?

was the commit to the branch the app is deployed from?

yes, I’ve only got the main branch for this one

@SiddhantSadangi What is wrong with Streamlit Community Cloud? Apps are entering sleep-mode in less than 12 hours after last usage and less than 18 hours after last commit! I can provide the app link to a developer, if they wish to take a look.

Apps are entering sleep-mode in less than 12 hours after last usage

I noticed the same issue for one of my apps. Lemme raise it with the devs.

Thanks @SiddhantSadangi , I appreciate it.

UPDATE:
The sleep threshold has been reduced from 24h to 12h to keep the free platform accessible to all.
The docs will soon be updated to reflect these changes.

1 Like

Thanks for this. I kept checking through the forum for some information on this.

Thanks for the early information @SiddhantSadangi,

I’ve been worried that my probe Github action that I used to keep my apps that need 24/7 running was not properly working anymore.

Glad to hear that it’s the inactivity threshold which have been reduced, thanks for the update