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

Make websocket_max_message_size configurable in notebooks #8583

Closed
nasedil opened this Issue Jan 24, 2019 · 0 comments

Comments

Projects
None yet
2 participants
@nasedil
Copy link
Contributor

nasedil commented Jan 24, 2019

When bokeh server is embedded in a notebook (like here https://github.com/bokeh/bokeh/blob/master/examples/howto/server_embed/notebook_embed.ipynb) there are connection errors when plots are large, like in #7374 (and smaller plots work just fine). I see from the docs I can use --websocket-max-message-size argument or websocket_max_message_size kwarg with a large enough value for a standalone bokeh server.

However, it is not currently possible to pass that argument to the Server class from notebook when using bokeh.io.show(app, notebook_url):

server = Server({"/": app}, io_loop=loop, port=port, allow_websocket_origin=[origin])

The solution would be to pass something like server_kwargs to show() so that they go through to the Server.__init__.

An example notebook to test the functionality can be constructed from the following code:

import numpy as np

from bokeh.plotting import figure
from bokeh.io import show, output_notebook
from bokeh.palettes import Inferno

output_notebook()

def modify_doc(doc):
    size = 3000
    a = np.broadcast_to((np.arange(size, dtype=np.float64))[np.newaxis, :], (size, size))

    plot = figure(x_range=(0, 100), y_range=(0, 100))
    plot.image(
        image=[a], x=[0], y=[0], dw=[100], dh=[100],
        palette=Inferno[256]
    )
    
    doc.add_root(plot)

show(modify_doc)

@bryevdv bryevdv added the type: task label Jan 31, 2019

@bryevdv bryevdv added this to the 1.1 milestone Jan 31, 2019

@bryevdv bryevdv closed this in #8584 Feb 1, 2019

@bryevdv bryevdv changed the title Allow to pass websocket_max_message_size when embedding bokeh server in a notebook Allow passing websocket_max_message_size in notebook server apps Mar 24, 2019

@bryevdv bryevdv changed the title Allow passing websocket_max_message_size in notebook server apps websocket_max_message_size should be configurable in notebook apps Mar 24, 2019

@bryevdv bryevdv changed the title websocket_max_message_size should be configurable in notebook apps Make websocket_max_message_size configurable in notebooks Mar 24, 2019

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.