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

doc: Add section in load balancing about Bokeh extensions #7832

Open
wants to merge 6 commits into
base: main
Choose a base branch
from

Conversation

hoxbro
Copy link
Member

@hoxbro hoxbro commented Apr 4, 2025

Fixes #4074 by adding an example of how to use it with custom extensions.

Copy link
Contributor

@Coderambling Coderambling left a 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
Copy link
Contributor

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?

Copy link
Member Author

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.

Copy link
Contributor

@Coderambling Coderambling Apr 9, 2025

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".

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
since it potentially occupies multiple machines and since each process is
isolated there is no sharing of cached data or global state.

Copy link
Contributor

@Coderambling Coderambling Apr 5, 2025

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?

Copy link
Member Author

@hoxbro hoxbro Apr 9, 2025

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.

@hoxbro
Copy link
Member Author

hoxbro commented Apr 6, 2025

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.

@Coderambling
Copy link
Contributor

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.

@Coderambling
Copy link
Contributor

Coderambling commented Apr 8, 2025

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

@hoxbro
Copy link
Member Author

hoxbro commented Apr 9, 2025

Thank you for the review 👍

I have applied most of the changes.

Would be good to add a section on / mention of panel.holoviz.org/how_to/profiling/profile.html

Good idea, maybe have a See also section at the bottom. Edit: Added in e1c0e3d

Copy link
Contributor

@Coderambling Coderambling left a 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
Copy link
Contributor

@Coderambling Coderambling Apr 9, 2025

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
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
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

@hoxbro hoxbro marked this pull request as ready for review April 10, 2025 06:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Panel, Nginx Load Balancing and Custom Extensions breaks
2 participants