☰Read-only archive⌕
Looking for help with Bokeh?

This is a read-only archive. Ask questions and join the conversation on GitHub.

Visit Community Support on GitHub →
Archived discussions · Captured October 28, 2026

Optimizing for Multiple Users

Community Support
Kanza
Kanza

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.

⌁   Link to post
Bryan
Bryan

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, aiworldwideqaid@gmail.com 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 bokeh+unsubscribe@continuum.io.

To post to this group, send email to bokeh@continuum.io.

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.

⌁   Link to post
peng_wang
peng_wang

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, aiworld...@gmail.com 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 bokeh+un...@continuum.io.

To post to this group, send email to bo...@continuum.io.

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.

⌁   Link to post

End of archived discussion · Replies are disabled