Replies: 2 comments 2 replies
-
Hi @pplno, that's an interesting question! You can try to increase the Lines 117 to 119 in 45fdda8 If you need to fine-tune these configuration parameters individually, you can set them within a startup handler: def startup():
core.sio.eio.ping_interval = ...
core.sio.eio.ping_timeout = ...
app.on_startup(startup) I hope this helps! |
Beta Was this translation helpful? Give feedback.
-
Hi @falkoschindler.
|
Beta Was this translation helpful? Give feedback.
-
Question
In my nicegui application I need to plot rather large / slow Plotly surface plots.
Unfortunately, when the Plotly surface plot becomes to slow on the client side, the application gets stuck in a reloading / refreshing loop. When this happens you get the console log: "reloading because handshake failed for client_id xxxxxx".
Here is the code to reproduce the issue. On my machine (Intel Core i9-11900K, 32GB RAM) the application works as intended for small grid sizes
grid_x, grid_y = 200, 200
, becomes very choppy withgrid_x, grid_y = 1000, 1000
, and fully breaks down in the reloading loop withgrid_x, grid_y = 2000, 2000
I have tried to mitigate the issue by implementing my own plot class that makes the update of the ui.plotly asynchronous (
timeout=60
). This somewhat solves the issue forgrid_x, grid_y = 1000, 1000
, but the application still breaks down atgrid_x, grid_y = 2000, 2000
.See the code of my asynchronous implementation below.
Is there any general advice on running CPU-bound tasks on the client side to avoid the failing handshake?
I assume the failing handshake is connected to a timeout setting somewhere? Can it be changed to avoid the issue?
I'm aware of run.cpu_bound for the server-side, is there a client side equivalent?
Beta Was this translation helpful? Give feedback.
All reactions