Optimizing for Multiple Users

Hi,

What would be the best way to implement a way to have multiple users use the bokeh app at the same time without significant effect on speed. I know you could run it through a flask embed and then gunicorn, but I was wondering if there is a way to do it through the bokeh server?

Thanks.

Hi,

If you want to support multiple users on a single Bokeh server, the main consideration is to avoid blocking work in any Bokeh callbacks. Tornado is single threaded but asynchronous, so you want to make sure that callbacks return very quickly. One way to do this is to offload any blocking tasks to threads. You can see see docs and examples of doing that here:

[https://bokeh.pydata.org/en/latest/docs/user_guide/server.html#updating-from-threads](https://bokeh.pydata.org/en/latest/docs/user_guide/server.html#updating-from-threads)

[https://bokeh.pydata.org/en/latest/docs/user_guide/server.html#updating-from-unlocked-callbacks](https://bokeh.pydata.org/en/latest/docs/user_guide/server.html#updating-from-unlocked-callbacks)

Of course, you can offload blocking work to threads even if you are running multiple Bokeh server processes too, so if you do eventually scale by using gunicorn or a load balancer then there’s no problems mixing approaches.

Thanks,

Bryan

···

On Jul 11, 2018, at 10:51, [email protected] wrote:

Hi,

What would be the best way to implement a way to have multiple users use the bokeh app at the same time without significant effect on speed. I know you could run it through a flask embed and then gunicorn, but I was wondering if there is a way to do it through the bokeh server?

Thanks.

You received this message because you are subscribed to the Google Groups “Bokeh Discussion - Public” group.

To unsubscribe from this group and stop receiving emails from it, send an email to [email protected].

To post to this group, send email to [email protected].

To view this discussion on the web visit https://groups.google.com/a/continuum.io/d/msgid/bokeh/8e737905-a75c-4493-b30f-720d92c95772%40continuum.io.

For more options, visit https://groups.google.com/a/continuum.io/d/optout.

This is pretty good. Currently, my solution is Flask + Bokeh server + IIS. The biggest issue is that launching web application is so slow. And also, the response is tremendously slowly if I select item from combBox to update plots’ ColumnDataSource.

any comments? thanks

···

On Wednesday, July 11, 2018 at 10:16:23 AM UTC-6, Bryan Van de ven wrote:

Hi,

If you want to support multiple users on a single Bokeh server, the main consideration is to avoid blocking work in any Bokeh callbacks. Tornado is single threaded but asynchronous, so you want to make sure that callbacks return very quickly. One way to do this is to offload any blocking tasks to threads. You can see see docs and examples of doing that here:

https://bokeh.pydata.org/en/latest/docs/user_guide/server.html#updating-from-threads

https://bokeh.pydata.org/en/latest/docs/user_guide/server.html#updating-from-unlocked-callbacks

Of course, you can offload blocking work to threads even if you are running multiple Bokeh server processes too, so if you do eventually scale by using gunicorn or a load balancer then there’s no problems mixing approaches.

Thanks,

Bryan

On Jul 11, 2018, at 10:51, [email protected] wrote:

Hi,

What would be the best way to implement a way to have multiple users use the bokeh app at the same time without significant effect on speed. I know you could run it through a flask embed and then gunicorn, but I was wondering if there is a way to do it through the bokeh server?

Thanks.

You received this message because you are subscribed to the Google Groups “Bokeh Discussion - Public” group.

To unsubscribe from this group and stop receiving emails from it, send an email to [email protected].

To post to this group, send email to [email protected].

To view this discussion on the web visit https://groups.google.com/a/continuum.io/d/msgid/bokeh/8e737905-a75c-4493-b30f-720d92c95772%40continuum.io.

For more options, visit https://groups.google.com/a/continuum.io/d/optout.