Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Backend performance: delete stale connections #2977

Merged
merged 3 commits into from
Aug 5, 2024
Merged

Conversation

fonsp
Copy link
Owner

@fonsp fonsp commented Aug 5, 2024

After a client disconnects, Pluto continues to calculate and send updates for that client. This can be a performance problem: on every refresh of a notebook, the update logic becomes slower.

This PR fixes that, and removes clients from memory after their websocket disconnects.

This PR also updates the frontend's reconnecting logic. This is currently not implemented (and incorrect: all updates while disconnected are ignored). I replaced it with a call to reset_shared_state.

TOOD

  • test reconnecting logic

Reconnecting:

Schermopname.2024-08-05.om.14.29.31.mov

@fonsp fonsp added frontend Concerning the HTML editor backend Concerning the julia server and runtime HTTP/WS The connection between backend and frontend performance labels Aug 5, 2024
Copy link
Contributor

github-actions bot commented Aug 5, 2024

Try this Pull Request!

Open Julia and type:

julia> import Pkg
julia> Pkg.activate(temp=true)
julia> Pkg.add(url="https://github.com/fonsp/Pluto.jl", rev="forget-stale-connections")
julia> using Pluto

@fonsp fonsp marked this pull request as ready for review August 5, 2024 12:31
@fonsp fonsp merged commit 7bb276b into main Aug 5, 2024
16 checks passed
@fonsp fonsp deleted the forget-stale-connections branch August 5, 2024 13:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backend Concerning the julia server and runtime frontend Concerning the HTML editor HTTP/WS The connection between backend and frontend performance
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant