I have created a simple app which is deployed on k8s. Its an app which is intended for downloading data.
I have observed that it keeps refreshing every 30 seconds, which is not acceptable as we need time to select date and time.
Also I see that it happens only when access via ingress, if I port forward the service then it keeps working ok.
I was wondering it may be because of hard coded value in tornado settings in streamlit/web/server/server.py
But I was wrong TORNADO_SETTINGS = { # Gzip HTTP responses. "compress_response": True, # Ping every 1s to keep WS alive. # 2021.06.22: this value was previously 20s, and was causing # connection instability for a small number of users. This smaller # ping_interval fixes that instability. # https://github.com/streamlit/streamlit/issues/3196 "websocket_ping_interval": 1, # If we don't get a ping response within 30s, the connection # is timed out. "websocket_ping_timeout": 30, }
We run k8s on our own server so the work around mentioned in this post is not relevant. Probably I’m doing something absolutely wrong
Finally we found out that issue was due to the default time out of gcp load balancer, which was causing the web socket connection to re-initialize every 30 secs. All we needed to do was change the time out in the backend configuration of load balancer. I hope it helps.
Hello Ikarimov,
Indeed that is annoying. I fixed by navigating to Network Services -->Load Balancing , then click on edit the button on top next to load balancer details. Click on backend configuration, select the backend service being used and click on edit.
You’ll see timeout is set to 30 seconds, increase this value to your desired value and save.
That’s it. Reload your app in new session it should work.
I know its hacky but I’m pretty sure it is configurable via gcloud sdk but I didn’t really had the time to do that.
I hope it helps, good luck!
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.