Open thondeboer opened 1 year ago
I guess what we really need is server-based paging of large dataframes like we can do in Dash. Could implement ourserlves I guessif we can catch some of the events, like sort on a dataframe
I don't know pretty well the architecture. I think the websocket link timeout is 20 seconds on uvicorn. This setting is not editable in the current implementation.
You may try temporarily to modify the line 404 of streamsync.serve:server
in your venv to see how it impact your situation and add ws_ping_timeout
?
uvicorn.run(asgi_app, host=host,
port=port, log_level=log_level, ws_max_size=MAX_WEBSOCKET_MESSAGE_SIZE, ws_ping_timeout=600)
Could you share more details about the volume your application is trying to fetch using the browser inspector ?
Did you try to bind visibility on a variable in the state and keep the state empty till the visibility variable is triggerd on the backend ?
def handle_timer_tick(state: StreamsyncState):
if state['tick_visible'] is False:
return
df = state["random_df"]
for i in range(5):
df[f'pgcf_{i+1}'] = np.around(np.random.rand(10, 1), decimals=9)
state["random_df"] = df
def trigger_auto_refresh(state: StreamsyncState):
state["tick_visible"] = not state["tick_visible"]
Yeah, I'll consider doing this to create the data until requested. Will also look at the messages as you suggested above
I have described a design to chunk frame inside the websocket payload. It will ensure we keep the frame below a size and highly reduce the risk of timeout : https://github.com/FabienArcellier/streamsync/issues/12
It involves adding an encoder / decoder on backend / frontend to rebuild the frame.
I am trying to serve quite a bit of information but get timeouts as shown below and app becomes unresponsive
I tried to make some of the data invisible, since it is not needed until user wants to see it, but that does not help.
Any ideas on how to avoid this timeout? Or can we extend the teimeout somewhere in the settings>