I’ve recently deployed a streamlit app a friend made to Heroku. It was running just fine last night when I deployed it, but since this morning at 9am (GMT +1), it has started timing out and memory is going through the roof.
It was tweeted by someone with a lot of followers so I suspect it may be a concurrency issue, but I’d love to hear your thoughts.
Do you have a Heroku graph for the number of connected users or page views for the same time period?
Also, is it possible for you to increase the number of dynos or the performance of the dynos? Other users solved similar memory issues on Heroku via that approach Latency on Heroku. Perhaps you simply need more resources.
If that doesn’t solve it and you see memory usage continually rising and not falling please let us know. However from the graph you shared it looks like the memory is rising and then falling.
Each page visit looks like it’ll be reading a lot of CSV files and holding them in memory - a few hundred people at the same time with one meg of data means a few hundred meg in total. You’re also going to have every page load & input change result in lots more network requests to load that data in from github.
Caches are shared, right? You could cache those CSV loads for a start.
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.