Latency on Heroku

We’ve had a blast this weekend building a Streamlit app to simulate Coronavirus spread:

We’ve deployed it on Heroku, which was pretty straightforward (and aided by this blogpost

However, we’re now seeing decent traffic and I’m trying to understand whether simply increasing the size of the Heroku dyno is going to help reduce latency (which keeps spiking to >1s) or not. Is Streamlit spawning multiple processes behind the scenes or do we need to explicitly pursue a horizontal scaling strategy e.g. via Docker?

Any help much appreciated!


I’m having exactly the same problem. I created this app for COVID-19: using Streamlit and I’m having that problem scaling it on Heroku. It’s my first app deployed and the high traffic is burning it. Any help?

Hey! Our solution in the end was just to vastly increase the resources available :slight_smile:

Start by adding more Dynos of the same tier - horizontal scaling. If that doesn’t work and you’re persistently seeing out of memory issues, increase the performance of each Dynos. We’re now on Performance M Dynos with autoscaling to keep up with the demand.

We’ve asked Heroku for help to cover the costs - they’ve said yes but yet to see the credits hit my account.

Hope that helps,


Hi @archydeberker! Thanks for posting! Streamlit does not spawn multiple processes, so I would think horizontal scaling is a good solution here.