Panel serve deployment is frequently broken and cannot serve more than one user at the same time

Hi @nemesis,

Top note - it works, longer reading below:

On my machine I am able to run three instances no real issues. I had to load one at a time because of how it chews up my machines resources before releasing (so this would be a concern with multiple users trying to access at same time). If I loaded two at same time, one might not load right, blank screen, server error but I think this is all to do with the loading of the data with pandas than the app itself is my take on it. Once the app(s) are loaded 3 in total for my case, they’re smooth, responsive and just seem to work out of the box - been up now for hours no disconnect or any other concerns that I see - I get the same error as other user but seems to work anyway.

my setup:

I have a windows machine, miniconda installed created a new environment for this:

conda create -n pyvizhelp
conda install -c pyviz hvplot holoviews bokeh panel
conda install -c conda-forge jupyterlab
 python -m ipykernel install --user --name pyvizhelp --display-name "pyvizhelp"
conda install datashader

launched the server, editing takes what feels like 5+ minutes on each load. As above my notes on it are that it works, if I try two at the same time (I mean launch two or could be considered two users connecting at same instance) it’s a bit iffy but that I put down to the loading of data rather than anything else, my machine memory starts to top out but one at a time, it hikes then settles out to not that much resource used and once all three are open, I personally don’t see it as a panel or server issue here. With all three open queuing from each, zooming around all appeared independent for each app with no interference that I could notice. If it was me and not saying I’m right by any means I would look into the way data is loaded and make available to the app prior to user connecting.

Maybe Pre edit the dataset out of the app, so user doesn’t have to wait for this to happen, maybe look into other means than pandas for loading, like a dask dataframe maybe I read that these can help reduce the file size and improve load times.

So my take on it, it works, consider how you load large datasets and factor that into the operation of the app.

Hope it is of some help,

1 Like

@philippjfr Any help will appreciate. Please check my previous post.

kindly use at least up to show option in panel serve

panel serve script_name.py --port 5009 --address 10.173.2.243 --allow-websocket-origin=10.173.2.243:5009 --show --session-token-expiration 900000 --unused-session-lifetime 60000000 --keep-alive 10000000 --websocket-max-message-size 104857600000

I try this command get error like this:

panel serve nyc_taxi_v4.py --port 5009 --address 37.140.258.197 --allow-websocket-origin=37.140.258.197:5009 --show --session-token-expiration 900000 --unused-session-lifetime 60000000 --keep-alive 10000000 --websocket-max-message-size 104857600000
2022-03-07 15:09:02,693 Starting Bokeh server version 2.4.2 (running on Tornado 6.1)
2022-03-07 15:09:02,695 Cannot start Bokeh server, address ‘37.140.258.197’ not available

In the script you have written port=3002
pn.serve(run,port=3002)

in panel serve you specify port 5009

also you can test in script notebook as

pn.serve(run,port=5009, allow_websocket_origin=[“ip_address:5009”],
address=“ip_address”, show=False)

I try like this:
taxi = NYCTaxiExplorer(name=“NYC Taxi Trips”)
pn.Row(taxi.param, taxi.viewable()).servable()
pn.serve(run,port=5009, allow_websocket_origin=[“ip_address:5009”],
address=“ip_address”, show=False)

And getting this error:

bokeh.application.application - ERROR - Error running application handler <bokeh.application.handlers.script.ScriptHandler object at 0x7f89a45a7490>: name ‘run’ is not defined
File ‘nyc_taxi_v4.py’, line 82, in :
pn.serve(run,port=5009, allow_websocket_origin=[“ip_address:5009”], Traceback (most recent call last):
File “/root/miniconda3/lib/python3.7/site-packages/bokeh/application/handlers/code_runner.py”, line 231, in run
exec(self._code, module.dict)
File “/home/map/nyc/nyc_taxi_v4.py”, line 82, in
pn.serve(run,port=5009, allow_websocket_origin=[“ip_address:5009”],
NameError: name ‘run’ is not defined

But it’s working.

run= pn.Row(taxi.param, taxi.viewable())