Web-apps keeps on sleeping after 30 minutes or a day of inactivity

I searched that it mostly sleeps on 2-3 days of inactivity also a week too before but why I have to rerun or reactivate it after 30 minutes or a day etc.?

Please take a moment to search the forum and documentation before posting a new topic.
If you’re creating a debugging post, please include the following info:

  1. Are you running your app locally or is it deployed? Deployed
  2. If your app is deployed:
    a. Is it deployed on Community Cloud or another hosting platform? Community cloud
    b. Share the link to the public deployed app. meldrx.streamlit.app, docunexus.streamlit.app, azure-microsoft-docunexus.streamlit.app
  3. Share the link to your app’s public GitHub repository (including a requirements file). Private repository with +300 packages
  4. Share the full text of the error message (not a screenshot). Zzzz

This app has gone to sleep due to inactivity. Would you like to wake it back up?

Yes, get this app back up!

If you believe this is a bug, please contact us or visit the Streamlit forums.
5. Share the Streamlit and Python versions. Latest version

The inactivity threshold to put apps to sleep has been reduced to 12 hours

1 Like

@SiddhantSadangi to confirm the inactivity threshold has changed from previously being 7 days to 12 hours?

I have embedded streamlit apps on a public facing site and going inactive within 12 hours (and the inability to wake up from the embed) makes streamlit effectively unusable for this use case. Does streamlit suggest any workaround?

2 Likes

Confirmed. The inactivity threshold had been reduced from 7 days to 1/3 (weekday/weekend) quite a while back already. It has now been reduced to 12 hours.

I’d recommend scheduling a task that pushes an empty commit every 10 hours to the repo hosting the app source.

That being said, the team is closely monitoring community feedback around this change :ear:

2 Likes

Agree, I’m in a similar situation. It’s become effectively unusable for me too. Will look into migrating away. :disappointed_face:

1 Like

Hibernation would be my #1 for finding a different hosting solution or even moving away from streamlit.

Snowflake doesn’t look to be an option for me me, too complex and too heavy weight. I’d happily pay a month fee for the service

2 Likes

Is there a pro-version not using snowflakes? People would gladly pay for that also the snowflake version seems limited I cannot use GH in it?

1 Like

Same here. A paid version of the Streamlit Community Cloud would be highly appreciated for relatively small projects that have professional/ educational applications.

1 Like

Hi all, thanks for posting here. If you are reading and your project is negatively impacted, please posting as well. This is very helpful.

Since our user base keeps growing exponentially (yay!) we need to constantly tweak different configuration parameters to keep our costs reasonable. So the more data we have on this the better.

Is there a pro-version not using snowflakes?

There’s no separate pro-version. Snowflake is what we offer here.

snowflake version seems limited I cannot use GH in it?

You can definitely use Github with Snowflake! Right now the setup process is more involved than in Community Cloud, but it’s just a one-time cost. And the Git team is working to make things a lot simpler as well.

See Using a Git repository in Snowflake | Snowflake Documentation

Also: don’t forget we can adjust certain settings for your specific apps if your use case qualifies for our “good for the world” policy

2 Likes

Have you had success with this strategy? I have tried this (committing both to the repo and to the actual .py file) and it does not seem to wake an app that is hibernating.

Indeed. It merely resets the clock for an awake app.

Soooooo back to Gradio :::

Hi @SiddhantSadangi ,
I tried the same, but no luck, can you share your task script?

Hey @Vijay1, this method will not awaken an app that is already sleeping, but only reset the timer for an active app.
You will first need to get the app back up manually

Yes, I got it. Once the app is running, we can reset the timer evry 10 or 12 hrs to keep it active and prevent it from sleeping. Is that correct?
Can you plz provide script?

Yes, correct.

I do not have a script handy. Here’s what copilot gave me:

name: Empty Commit

on:
  schedule:
    - cron: '0 */10 * * *'  # Runs every 10 hours

jobs:
  empty-commit:
    runs-on: ubuntu-latest
    steps:
      - name: Checkout repository
        uses: actions/checkout@v4

      - name: Create empty commit
        run: |
          git config --local user.email "action@github.com"
          git config --local user.name "GitHub Action"
          git commit --allow-empty -m "Empty commit to keep repository active"
          git push 

To use this workflow:

  1. Make sure you have the .github/workflows directory in your repository

  2. The workflow will automatically run when you push this file to your repository

  3. The workflow will create empty commits every 10 hours to keep your repository active

Note: Make sure your repository has the necessary permissions to push commits. If you’re using a private repository, you might need to configure repository secrets or use a personal access token for authentication.

Thanks, I will try this

1 Like