How to *really* scale a Streamlit App?

Having used Streamlit for a while, I’m absolutely impressed with the functionalities Streamlit provides, however, one question that has bugged me always is that ‘Can you really build an end-to-end application with Streamlit which will have, say,1000 users daily?’

I’m absolutely a novice when it comes to deployment procedures but in my little knowledge about Working systems I have, is it realistically possible to build a ‘something’ with Streamlit, if lets say we use more generous resources/services when it comes to Databases and Cloud. (Not thinking about Streamlit Cloud here, oviously) ?

Any opinions on the same are welcome. Have you guys built something similar? I’m all ears.

5 Likes

I have had pretty good success with scaling up a Streamlit application for a larger user base. The method I am using is to deploy the application in a container and put that behind a load balancer to scale the number of containers up or down based on usage. I haven’t seen any issues with scaling it up assuming you implement all your additional services like databases, user authentication, etc, to also support the larger user base.

6 Likes

That’s interesting. What tyoe of load balancer do you set up though? Something like sticky sessions so that the same user session always go to the same container?

I mean, at least the session_state must be kept be tweet two requests from the same user session, so all those requests from a same user must land in the same container behind the load balancer. That rules out a round Robin load balancer for example, am I right?

Have you written more about your set up or do you know if there’s any information available anywhere in that regard?

Hi @ayanatherate I believe I can address your question. Pls have a read of my post on this topic below and vote on the items you most want to hear about.

Hi @Alexandre_Dumont if you’re interested, have a read of my post below and vote on the topics of interest. I will talk about these issues in our production deployment

HI Austin, can you plz point to details on how you did it ?