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.