Hi everyone.
We have deployed streamlit app on google cloud run.
Streamlit version → 1.31
With 1 gb container, 1 vcpu and minimum to moderate traffic it’s costing us 1.5-2$ everyday.
Is there a way to deploy it on gcp with less cost?
We want application to be scalable for concurrent users.
I’m having the exact same problem. It’s because it’s constantly pinging the health check endpoints (/_stcore/health , /_stcore/host-config , and /_stcore/stream ). This makes streamlit absolutely useless for a lot of use cases with GCP, and no one seems to either know why it’s constantly keeping the container alive with those checks, or how to disable them. I see requests every 5 minutes or so in the logs, and I’m using version 1.32.
Note that my specific application is for testing purposes and has nearly 0 uses (which I can double check because the app makes api calls on another backend and that backend is absolutely dead) and it’s still costing me 2$ daily, and of course I have min instances set to 0 (which you should check as well, having the one instance running in idle would produce the 1-2$ daily charge as well)
I have setup the min instance as 0 as well.
Planning to migrate this to compute engine.
I’m experiencing the same issue.
I’ve deployed a Streamlit app on Google Cloud Run (using Streamlit version 1.37.0) and I’ve noticed that even when users leave the app open, the page keeps reconnecting due to the constant WebSocket pings.
Streamlit uses WebSockets for real-time updates and interactive user experiences. This results in unnecessary charges, which add up to around $1.5-2 per day with minimal usage. Additionally, because the connection is constantly maintained, the more inactive users or open browser tabs there are, the more the number of instances increases. This can lead to increased costs, degraded performance, and delayed scaling.
I’m curious if there’s any way to close the WebSocket connection when there’s no data update for a certain period. Alternatively, I’m interested in exploring other solutions. Has anyone found a solution to this?