Greetings from HelloFresh Berlin. I hope this message finds you well.
We are currently facing some challenges with the performance of our Streamlit app and were hoping to seek your valuable support and insights from the Streamlit forum.
Our app’s running time is displaying significant inconsistency with noticeable variations during each run. This complexity arises from the deployment of our app on AWS/Docker. We have thoughtfully integrated all functionalities by utilizing a Python wheel stored within the Docker image.
Additionally, we have observed a lag before the app initializes and starts running. The time it takes to populate fields and charts upon startup is also longer than desired.
Moreover, when modifications are made to widget values, there is a delay of a couple of seconds before the app resumes running.
We have particularly noticed that side tab widgets tend to load rather slowly. Interestingly, the subsequent run change how widget looks , then the widget reappears
this happen when you switch between side tabs also
Another observation pertains to the app’s behavior with multiple side tabs. Regrettably, the app does not recall the user’s last active tab, necessitating the user to navigate back each time. We understand that this could be slightly frustrating for our users.
We kindly request your assistance in identifying the potential reasons for these issues and seeking advice on how we could go about improving the overall performance of our Streamlit app.
We deeply appreciate your support and look forward to your valuable insights.
Hi there!,
While I may not be an expert, I think that a lot of your problems can be solved using caching and adding session state values:
Caching might be the solution to the slow running of the app, though more context is required for knowing if it can be implemented here:
Regarding the widget reappearing, streamlit reruns the script on every user interaction or state change. This, combined with the slow speed, might be causing the widget to ‘reappear’ during the switch.
About the user’s last active tab, you can store the previous page in the session state of the user:
This might be a bit of a hack as a solution, but you can use the switch_page() option in the streamlit-extras library to navigate back to the stored page. (Streamlit-extras is (I believe) a third-party extension module for streamlit):
These are a few personal tips I use, maybe someone else can give you a better answer
Cheers,
Moiz
Without actual code it is very difficult to understand why this is happening to your app. However, regarding the performance issues:
If you experience poor performance when running the app locally, the issue is most likely in the code and/or dependencies. Profile and optimize your code - and as suggested by @momos, use caching and session state to improve performance further.
If you experience poor performance only after Docker/AWS deployment, then the issue can be in (1) your Docker build, or (2) your AWS deployment settings. For example, are you building the Docker image on an M1 Mac? Because this can cause issues:
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.