Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to free up Bokeh server after disconnecting from app (getting error: port 5006 is already in use)

Tags:

I'm on day 1 of using Bokeh, and I'm trying to understand how the server works. First, I ran one of the example apps with

bokeh serve --show main.py

And I saw this info:

enter image description here

So then I saw there were no other unused sessions available, so I wasn't entirely surprised when I tried to run another app in parallel (launched from another window with the same command) and it failed:

enter image description here

So then I thought if I closed the app window I would be able to run a different app, and I noticed the server did register that I closed the web browser:

enter image description here

However I am still getting this error:

port 5006 is already in use

I went through the docs, and I apologize if I am missing something, but my two questions are

  1. How can I get the server to serve more than one app in parallel with different browser tabs?
  2. How an I reset the server when I close the browser window so that even if only one client can be served at a time, the server knows that a browser has been closed and another client should be accepted?

Thanks for suggestions and links.

like image 756
helloB Avatar asked May 16 '16 20:05

helloB


2 Answers

You can start multiple apps with a single invocation of the bokeh command:

bokeh serve --show app1.py, app2/ app3.py

Or you can run different apps on different ports explicitly:

bokeh serve --show --port 5001 app1.py
bokeh serve --show --port 5002 app2.py
like image 149
bigreddot Avatar answered Sep 28 '22 04:09

bigreddot


If there is ever a need to use port 5006 (for whatever reason). For linux this is the solution: Get the process ID from

netstat -tupln

Note down the PID from the list, and the run the following command

kill -9 <pid>

Now you should be able to use the default port again!

like image 36
Vivek Avatar answered Sep 28 '22 04:09

Vivek