question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

[BUG] when using nginx in front of multiple bokeh server instances, an app may be loaded multiple times

See original GitHub issue

FOLLOW THESE INSTRUCTIONS CAREFULLY

ISSUES THAT DO NOT CONTAIN NECESSARY INFORMATION MAY BE CLOSED, IMMEDIATELY

The issue tracker is NOT the place for general support. For questions and technical assistance, come join the Bokeh Project Discourse.

For defects or deficiencies, please provide ALL OF THE FOLLOWING:

ALL software version info (bokeh, python, notebook, OS, browser, any other relevant packages)

bokeh server version: 1.1.0 python version: 3.6.6

Description of expected behavior and the observed behavior

I have deployed a number of jpython notebooks that I load through a standalone bokeh server application. I run multiple instance of the bokeh server with nginx in front. Frequently, when I load one of the notebooks via an http call, the python code runs more than once. The expectation is that it will only run once. Running twice adds a performance hit, even though it eventually does work.

After discussion with @bryevdv at https://discourse.bokeh.org/t/using-standalone-bokeh-server-to-display-jupyter-notebooks-that-contains-some-holoview-objects/4015/6 , it seems this is a known issue.

Complete, minimal, self-contained example code that reproduces the issue

# code goes here between backticks

Stack traceback and/or browser JavaScript console output

Screenshots or screencasts of the bug in action

Issue Analytics

  • State:open
  • Created 4 years ago
  • Comments:12 (7 by maintainers)

github_iconTop GitHub Comments

1reaction
bryevdvcommented, Sep 23, 2019

@chris-ratcliffe Thank you for running the experiment. Unless Tornado itself offers some solution for sticky sessions with --num-procs then there is probably nothing that can be done in that case. I will look in to that, but at a minimum will use this issue to clearly document the state of affairs and what can be expected in various configurations, e.g how this can be avoided with nginx.

0reactions
bryevdvcommented, Aug 25, 2020

Just thinking out loud but another possible approach is to set some sort of testable condition that could be used to distinguish between “running in the HTTP request” vs “really running in the WS handler” Then app code could skip anything that does real work in the HTTP request run… that would be pretty ugly but at least provide an avenue for when optimizing this is important.

Read more comments on GitHub >

github_iconTop Results From Across the Web

having trouble with bokeh server, multiple apps and nginx reverse ...
I am trying to bokeh serve multiple apps, lets say: appA, appB, appC. I have all my apps in separate folders. I have...
Read more >
Deploy app to AWS Elastic Beanstalk - HoloViz Discourse
I finally could make it work in AWS ELB with Docker. I needed 3 files: application.py, Dockerfile, and requirements.txt. As previously said, the...
Read more >
Why is bokeh plot on web server loading so slow?
On to your specific problem: One reason the demo site might load ... (e.g. if you are not using WebGL or DataTables then...
Read more >
Deploying a Flask application to Elastic Beanstalk
Create, configure and deploy a Flask application to AWS Elastic Beanstalk with ... Apache or NGINX as a reverse proxy that sits in...
Read more >
latest PDF - PyWebIO
Using PyWebIO, developers can write applications just like writing terminal scripts ... You can call defer_call(func) multiple times in the.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found