Hi everyone! My streamlit app worked locally and on streamlit cloud. But after I added st.cache, the app continues working locally but doesn’t work on cloud anymore. On cloud it starts running the cached function, but after the cached function ends it doesn’t go further and gives an error ’ Oh no.Error running app. Streamlit server consistently failed status checks’ without much explanation.
Do you know what could be the problem and how can I fix it?
This is my app https://spikescape-cache.streamlitapp.com/
I thought that there could be a problem with a memory limit on the cloud when I use st.cache. But exactly the same program but without st.cache works fine.
Hi @blackary thank you for your reply! I tried st.experimental_memo, but it didn’t help. It worked the same way as st.cache - run the cached function, but crashed with the same error ‘Streamlit server consistently failed status checks’ after.
OK, thought it was worth a shot, as that resolves a number of problems for users. Can you please share some minimal reproducible code which shows this error?
I have checked our logs, and confirmed that the app has been getting killed periodically because it goes over the 3GB memory limit.
In general that means you will either need to refactor the app to use less memory, or move it to your own hosted server that has more memory.
I wonder if it would be possible to save some of the data in an external database, so that you don’t have to keep it all in memory, and then query that database in your app.
@blackary thank you very much! I will think how to use a database. May I ask, do you by any chance know why the app doesn’t get killed when I remove the @st.cache line but also load this amount of data?
@stepdasha My guess is that without the cache, the objects get loaded temporarily in memory, but then disappear when you’re no longer using them in your code. When you use the cache, they stick around forever (or as long as you set the ttl to be), using more and more memory until it hits the limit of the node it’s running on.
FWIW, even though st.experimental_memo didn’t seen to resolve this issue, it is the recommended way to cache data currently (though it will likely be moved out of experimental, and may get renamed to something else in future versions of streamlit), as it generally causes fewer issues than st.cache.
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.