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
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.
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.
Thanks for stopping by! We use cookies to help us understand how you interact with our website.
By clicking “Accept all”, you consent to our use of cookies. For more information, please see our privacy policy.
Cookie settings
Strictly necessary cookies
These cookies are necessary for the website to function and cannot be switched off. They are usually only set in response to actions made by you which amount to a request for services, such as setting your privacy preferences, logging in or filling in forms.
Performance cookies
These cookies allow us to count visits and traffic sources so we can measure and improve the performance of our site. They help us understand how visitors move around the site and which pages are most frequently visited.
Functional cookies
These cookies are used to record your choices and settings, maintain your preferences over time and recognize you when you return to our website. These cookies help us to personalize our content for you and remember your preferences.
Targeting cookies
These cookies may be deployed to our site by our advertising partners to build a profile of your interest and provide you with content that is relevant to you, including showing you relevant ads on other websites.