Summary
I am working on a Streamlit app which (from time to time) runs some expensive computations. Since the computation runs on the GPU and the memory is quite limited Iām looking for a way to limit the number of āactiveā (i.e. simultaneous) users to one.
The definition of āactiveā can be quite flexible here, depending on what is possible, i.e. it could be defined as āone user is logged inā or āone user has the application openā. Any ideas how this could be achieved easily?
1 Like
Hey @mibaumgartner,
If youāre hosting your app with Streamlit Community Cloud, you might consider using st.experimental_user
in conjunction with session state ā that said, there isnāt a built-in way to do this, so I canāt guarantee that this would work perfectly for this specific use case, but I think that would probably be your best bet.
1 Like
Thanks for the quick answer, Iāll give it a try!
Hello, I was just wondering if there are any updates on this topic? Also what if we are using EC2 and not streamlit cloud .
There still isnāt a built-in way to handle this. If you are using a service other than Streamlit Community Cloud, you can refer to that serviceās documentation on how to set concurrency limits.