[bokeh] multiple bokeh apps using one server

Hi,

To run multiple apps, there are two options:

1) Run each app on a different server instances (on different ports):

   bokeh serve \-\-port 5000 foo\.py                bokeh serve --port 5001 bar.py

2) Run all the apps on a single server (by passing every app script or directory on the same command line):

  $ bokeh serve foo.py bar.py

As an example, all of the running demos on http://demo.bokehplots.com/ are deployed in this second fashion.

Thanks,

Bryan

···

On May 14, 2016, at 4:35 AM, [email protected] wrote:

Dear all:

I used python3 to scripts myapp [ python code: curdoc().add_root(mylayout)]
and then run the bokeh server(11.0) to show it [bokeh serve --show myapp.py]

Actually everything seems corrcet,
but if I want to run more apps in one bokeh server under local area network,
how do I write python code in *.py?
and then using what's kind of server cmd to run those??

--
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/d965d596-a5ae-4c27-8adb-69b39cdc2f0c%40continuum.io.
For more options, visit https://groups.google.com/a/continuum.io/d/optout.

Dear Bryan Van de ven

Thanks for your useful suggestion. It can work perfect.!!
I truly appreciate it …!!!

By the way, it just has two little questions…!

1.How can I change the web title name (“bokeh application”) ?

2.Can I control the web-link name in python scripts ?(“localhost:5006/XXXX”) ,
XXXX want to be modify by python scripts.
I mean I don’t want to the same names between the web-link and python program
How should I do ???
In the python scripts ,I used [ curdoc().add_root(myapp) ] to generate this document

Thank a lot !!!

···

To set the document title, you want to do:

  curdoc().title = "My Title"

There is no current facility to change the URL scheme on the Bokeh server itself, beyond adding an optional "prefix". E.g.:

   bokeh serve --prefix foo bar.py

will serve at:

  localhost:5006/foo/bar

Typically in a "production" deployment, you'd run the Bokeh server behind a reverse-proxy or other web-server (e.g. Nginx, or Apache), and map your preferred URLS to the Bokeh server ones there. This is how the the http://demo.bokehplots.com/ site works, for instance. It's possible a feature to support customizing URLs on the Bokeh server directly would be a reasonable feature, either as an API or a command line option. But this would represent new development. I'd encourage you to make an issue on GitHub if you'd like to promote or discuss the idea.

Thanks,

Bryan

···

On May 14, 2016, at 12:25 PM, tomwu <[email protected]> wrote:

Dear Bryan Van de ven

Thanks for your useful suggestion. It can work perfect.!!
I truly appreciate it ....!!!

By the way, it just has two little questions...!

1.How can I change the web title name ("bokeh application") ?

2.Can I control the web-link name in python scripts ?("localhost:5006/XXXX") ,
XXXX want to be modify by python scripts.
I mean I don't want to the same names between the web-link and python program
How should I do ???
In the python scripts ,I used [ curdoc().add_root(myapp) ] to generate this document

Thank a lot !!!

--
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/d89b1e16-19f4-44ce-b18e-3c6a3537b85e%40continuum.io.
For more options, visit https://groups.google.com/a/continuum.io/d/optout.

Thank for your instructions and steers.

I’m deeply appreciated about everything you’ve done…Thanks…!

Bryan Van de ven於 2016年5月14日星期六 UTC+8下午8時22分05秒寫道:

···

To set the document title, you want to do:

    curdoc().title = "My Title"

There is no current facility to change the URL scheme on the Bokeh server itself, beyond adding an optional “prefix”. E.g.:

     bokeh serve --prefix foo bar.py

will serve at:

    localhost:5006/foo/bar

Typically in a “production” deployment, you’d run the Bokeh server behind a reverse-proxy or other web-server (e.g. Nginx, or Apache), and map your preferred URLS to the Bokeh server ones there. This is how the the http://demo.bokehplots.com/ site works, for instance. It’s possible a feature to support customizing URLs on the Bokeh server directly would be a reasonable feature, either as an API or a command line option. But this would represent new development. I’d encourage you to make an issue on GitHub if you’d like to promote or discuss the idea.

Thanks,

Bryan

On May 14, 2016, at 12:25 PM, tomwu [email protected] wrote:

Dear Bryan Van de ven

Thanks for your useful suggestion. It can work perfect.!!

I truly appreciate it …!!!

By the way, it just has two little questions…!

1.How can I change the web title name (“bokeh application”) ?

2.Can I control the web-link name in python scripts ?(“localhost:5006/XXXX”) ,
XXXX want to be modify by python scripts.

I mean I don’t want to the same names between the web-link and python program
How should I do ???

In the python scripts ,I used [ curdoc().add_root(myapp) ] to generate this document

Thank a lot !!!


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/d89b1e16-19f4-44ce-b18e-3c6a3537b85e%40continuum.io.

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

Dear Byuan:

How many apps can I run in the single server ??
It has any constraints?

Thanks alot

Hi,

There are no externally imposed limits. In practice, it will depend on how much work/computation an app does as well as how many concurrent users/connections are expected at any given time. In particular, if an app does blocking work, and you expect to have multiple users at once, you will either need to "scale out" behind a load balancer (as described in the users guide) or offload some of the work to separate threads (there was some recent discussion on GH, there are details.. you can't modify the Bokeh document outside the main thread, e.g)

Bryan

···

On May 18, 2016, at 12:49 PM, tomwu <[email protected]> wrote:

Dear Byuan:

How many apps can I run in the single server ??
It has any constraints?

Thanks alot

--
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/fa03dae5-bd1c-4fc7-960a-4a4d0b04f183%40continuum.io.
For more options, visit https://groups.google.com/a/continuum.io/d/optout.

Thanks a lot! It’s very useful !!!

Hi, is it possible to serve an application using an already spawned server instance? For example, the jupyter notebook server can serve the notebooks that are saved in the same directory even after spawning the server. I am trying to avoid spawning a new server instance every time I want to deploy a new Bokeh application.

···

On Saturday, May 14, 2016 at 4:50:15 AM UTC-5, Bryan Van de ven wrote:

Hi,

To run multiple apps, there are two options:

  1. Run each app on a different server instances (on different ports):

     $ bokeh serve --port 5000 foo.py
    
    
    
     $ bokeh serve --port 5001 bar.py
    
  2. Run all the apps on a single server (by passing every app script or directory on the same command line):

     $ bokeh serve foo.py bar.py
    

As an example, all of the running demos on http://demo.bokehplots.com/ are deployed in this second fashion.

Thanks,

Bryan

On May 14, 2016, at 4:35 AM, [email protected] wrote:

Dear all:

I used python3 to scripts myapp [ python code: curdoc().add_root(mylayout)]

and then run the bokeh server(11.0) to show it [bokeh serve --show myapp.py]

Actually everything seems corrcet,
but if I want to run more apps in one bokeh server under local area network,
how do I write python code in *.py?

and then using what’s kind of server cmd to run those??


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/d965d596-a5ae-4c27-8adb-69b39cdc2f0c%40continuum.io.

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