Skip to content

Add websocket comms how-to guide #7952

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

Merged
merged 4 commits into from
Jul 21, 2025
Merged

Conversation

MarcSkovMadsen
Copy link
Collaborator

@MarcSkovMadsen MarcSkovMadsen commented May 30, 2025

In panel-extensions/panel-material-ui#278 I update the FileInput to enable uploading large files via chunked file transfer. Thus describing the WebSocket limitations is no longer central there. I also remember Philipp mentioning that this should be carved out into a separate guide due to its general nature.

Todo:

  • Philipp: Document how to configure server messages when using panel serve.

@MarcSkovMadsen MarcSkovMadsen requested a review from Copilot May 30, 2025 04:24
Copy link
Contributor

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

Extracts detailed WebSocket configuration guidance into its own how-to guide and links it from the FileInput example

  • Condense the upload size section in the FileInput notebook to a brief note with a link to the new guide
  • Add a standalone WebSocket configuration guide (websockets.md) with instructions for Panel/Bokeh/Tornado/Jupyter/Kubernetes
  • Update the server how-to index to include a card and toctree entry for the WebSocket guide

Reviewed Changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated 3 comments.

File Description
examples/reference/widgets/FileInput.ipynb Replace lengthy upload limits section with link to the WebSocket Configuration Guide
doc/how_to/server/websockets.md Add a comprehensive guide on configuring WebSocket communication settings
doc/how_to/server/index.md Add a grid-item card and toctree entry for the WebSocket guide
Comments suppressed due to low confidence (1)

examples/reference/widgets/FileInput.ipynb:155

  • Verify that the relative link ../../how_to/server/websockets.html correctly resolves from the notebook’s location; consider using an absolute or adjusted relative path so readers can reliably open the guide.
While the `FileInput` widget doesn't set any limit on the size of a file that can be selected by a user, the infrastructure onto which Panel relies (web browsers, Bokeh, Tornado, notebooks, kubernetes etc.) limits significantly what is actually possible. By default the `FileInput` widget allows to upload data that is in the order of 10 MB. To increase these limits see the [Websocket Configuration Guide](../../how_to/server/websockets.html).

@MarcSkovMadsen MarcSkovMadsen requested a review from philippjfr May 30, 2025 04:40
Copy link
Member

@hoxbro hoxbro left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just had a related problem with FileInput this week. And as far as I can see, there is no way to increase the socket size with a CLI command for panel serve; I would love to see it, though.

| Component | Default Limit | Description |
|-----------|---------------|-------------|
| Browser | Several GB | Rarely the bottleneck |
| WebSocket Message Size | 20 MB | Tornado/Bokeh default setting |
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Isn't 20 MB only Bokeh's default setting?

Co-authored-by: Simon Høxbro Hansen <simon.hansen@me.com>
Copy link

codecov bot commented Jul 21, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 71.19%. Comparing base (0c50e6c) to head (f1a4be3).
Report is 4 commits behind head on main.

Additional details and impacted files
@@             Coverage Diff             @@
##             main    #7952       +/-   ##
===========================================
- Coverage   86.07%   71.19%   -14.88%     
===========================================
  Files         346      345        -1     
  Lines       53818    53817        -1     
===========================================
- Hits        46322    38314     -8008     
- Misses       7496    15503     +8007     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@philippjfr philippjfr merged commit bba8b9a into main Jul 21, 2025
14 of 19 checks passed
@philippjfr philippjfr deleted the enhancement/websocket-config branch July 21, 2025 10:28
philippjfr added a commit that referenced this pull request Jul 21, 2025
* websocket comms

* copilot feedback

* Update doc/how_to/server/websockets.md

Co-authored-by: Simon Høxbro Hansen <simon.hansen@me.com>

---------

Co-authored-by: Simon Høxbro Hansen <simon.hansen@me.com>
Co-authored-by: Philipp Rudiger <prudiger@anaconda.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants