App sleeps after 2 days of no traffic instead of 7 days

Hello, I deploy my app in streamlit PAAS and its working nicely
This app is public and I want it to run all the time for job interviews.

I saw from guides that after 7 days the app will go to sleep mode due to less traffic,
and in order to wake it up the user needs to click it.

But when I tried to enter the app after 2 days, it goes to sleep as well…
I want to workaround it so the app will go live all the time, what can I do?
I would appreciate how to solve this with automatic/manual solutions.
Best regards,
Dor

What is PAAS?

the streamlit community platform for deploy apps

If there are no users, just let it sleep, it saves resources for the host. The users if really interested would just press a button to wake up the sleeping app.

Generally the author of the app with so many users needs to monetize (or even a donation just to maintain best user experience like lichess site) the app. Then rent a server or an upgraded hosting to get high uptime (low downtime) services. It benefits the users due to very low downtime, give a small profit to the host and developer. Everyone is happy.

Would love to see a response to the OP question: “I want to workaround it so the app will go live all the time, what can I do?” The Moderator’s response “just let it sleep” does not answer the question and “The users if really interested would just press a button to wake up the sleeping app.” is conjecture on the Moderator’s part.

I have the same thing happening. The app goes to sleep after only two days rather than seven as Streamlit indicates in its documentation.

3 Likes

I thought I could use an availability test (we use Azure) to prevent the app from sleeping. Ping tests from services like Azure Application Insights are not sufficient to prevent a Streamlit app from sleeping because they only check the backend’s availability and do not simulate real user interactions or load the full app (which involves WebSocket connections). For the app to stay awake, a real or simulated user visit is required.

To prevent the app from sleeping, you would need to simulate an actual user interaction, such as visiting the app in a browser and loading the full page. This can be done programmatically using tools like Selenium, which can automate the browser and simulate page loads by actually visiting the URL and rendering the page, thereby creating the required WebSocket connections.

I should note our company would pay for a Streamlit service plan that would prevent the need for this, especially if it includes some other benefits.