-
-
Notifications
You must be signed in to change notification settings - Fork 573
docs: Add section in load balancing about Bokeh extensions #7832
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
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice doc and very useful image. What software was used to create it?
Left some suggestions / comments inline, mainly adding some comma's and other interpunction, and suggestions for further clarification.
| Load balancing is the most complex approach to set up but is guaranteed to | ||
| improve concurrent usage of your application since different users are not | ||
| contending for access to the same process or even necessarily the same physical | ||
| compute and memory resources. At the same time it is more wasteful of resources |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
At the same time it can be more resource-intensive. Since each process is isolated, there is no sharing of cached data or global state between processes.
Note: are there potential solutions to isolated cache / global state? Like a cache at a higher level that is accessible by each process?
If so, provide some high-level mention or hint to these solutions?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Removing multiple machines as part of the sentence is incorrect to me, mainly because a way to share resources if you were on the same machine would be to save them to disk.
I don't think there is a high-level solution. It will depend on the use case. One acceptable solution would be to accept it is isolated; another would be to have a server used to communicate with it or set your system up to have file access.
People who need to use load balancing will likely already know how to handle it; if not, there will be better resources for this than this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Agree, my suggestion (without the multiple machine part) was an incomplete paste from the original.
I meant to suggest keeping the paragraph the same, but using "resource-intensive" instead of "wasteful of resources".
| compute and memory resources. At the same time it is more wasteful of resources | ||
| since it potentially occupies multiple machines and since each process is | ||
| isolated there is no sharing of cached data or global state. | ||
|
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should there be a mention that Tornado is used by default, and that Django, Flask and FastAPI are also options? I am not sure if and how using one of these four (or more)? options relates to concurrency / load balancing, but should this at least be mentioned, with links to the Panel docs for use of Flask and FastAPI?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I would not mention it, as it has nothing to do with load balancing.
|
Can you do the suggestions as code review ±? The image itself is the image from nginx. Have just changed it to our server, because the original url no longer exists. |
|
Yes I went for the comment option by mistake. Can do it as code review but not before this weekend. If a release is imminent then I will do it during the next release. |
|
Would be good to add a section on / mention of https://panel.holoviz.org/how_to/profiling/profile.html , so users know there are ways to profile an application for memory use etc. So they can use this to plan / monitor when implementing load balancing. Like the example here: https://discord.com/channels/1075331058024861767/1088149441988526241/1345112448474288210 . And link to https://panel.holoviz.org/how_to/profiling/admin.html |
|
Thank you for the review 👍 I have applied most of the changes.
Good idea, maybe have a |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Agree, my sugestion was incomplete. I meant to suggest keeping the paragraph the same, but using "resource-intensive" instead of "wasteful of resources".
| Load balancing is the most complex approach to set up but is guaranteed to | ||
| improve concurrent usage of your application since different users are not | ||
| contending for access to the same process or even necessarily the same physical | ||
| compute and memory resources. At the same time it is more wasteful of resources |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Agree, my suggestion (without the multiple machine part) was an incomplete paste from the original.
I meant to suggest keeping the paragraph the same, but using "resource-intensive" instead of "wasteful of resources".
| Load balancing is the most complex approach to set up but is guaranteed to | ||
| improve concurrent usage of your application since different users are not | ||
| contending for access to the same process or even necessarily the same physical | ||
| compute and memory resources. At the same time it is more wasteful of resources |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| compute and memory resources. At the same time it is more wasteful of resources | |
| compute and memory resources. At the same time it is more resource-intensive |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I ran the files locally pretty successfully with docker, the only change I needed was to remove localhost/ from docker run -dt -p 8000:80 localhost/my-container. The app was then available at http://localhost:8000/proxy/app.
However, I don't manage to understand what this is really fixing. Is it that, in a load-balancing context, serving additional Bokeh extensions like ipywidgets_bokeh can only be done reliably with BOKEH_RESOURCES=server? Or are there other specific settings make in the Docker or NGINX files that are worth highlighting?
If you want to serve a custom Bokeh model, in the example it uses |
|
This pull request has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs. |
Fixes #4074 by adding an example of how to use it with custom extensions.