Frustrated: Streamlit frontend disconnects from apps with long-running processes

Update: we still donā€™t know whatā€™s going on, but we were able to find a possible solution.

In Streamlitā€™s sever/server.py, change this:

    "websocket_ping_interval": 20,  # Ping every 20s to keep WS alive.

to this

    "websocket_ping_interval": 1,  # Ping every 1s to keep WS alive.

In @Kladarā€™s case, this appears to solve the problem, and I donā€™t expect it to have any noticeable negative impact.

Iā€™ll talk to our eng team to see if it makes sense to make this the default, as itā€™s very possible that Iā€™m missing something obvious :laughing:

5 Likes