Slow response protocol exceptions protocol error token is expired

panel web application response is slow with following detail .Your help and guidance required to improve and speed it up

I am running following below mentioned panel stand alone web application with following below mentioned commands

/usr/bin/nohup /home/NCOR6649/anaconda3/bin/panel serve main_cell_alm_anly.py --port 5050 --address xx.xx.xx.xx --allow-websocket-origin=‘xxxxx:5050’ --unused-session-lifetime 60000 --keep-alive 10000 --use-xheaders --num-procs 0 &

and we are getting below mentioned an error thrown when we access the page from chrome, then after we refresh button on chrome it began to appear with web socket open appear in logs

020-12-07 12:46:06,466 WebSocket connection opened
2020-12-07 12:48:42,426 ServerConnection created

Error

HTTPServerRequest(protocol='http', host='xx.xx.xx.xx:5050', method='GET', uri='/main_cell_alm_anly/ws', version='HTTP/1.1', remote_ip='xx.xx.xx.xx')
Traceback (most recent call last):
  File "/home/NCOR6649/anaconda3/lib/python3.7/site-packages/tornado/websocket.py", line 956, in _accept_connection
    open_result = handler.open(*handler.open_args, **handler.open_kwargs)
  File "/home/NCOR6649/anaconda3/lib/python3.7/site-packages/bokeh/server/views/ws.py", line 135, in open
raise ProtocolError("Token is expired.")
bokeh.protocol.exceptions.ProtocolError: Token is expired.

It is solved on bokeh website

by passing following argument in panel command --session-token-expiration=900000

It should be included in panel deply and export
https://panel.holoviz.org/user_guide/Deploy_and_Export.html#

This indicates there is some issue with the token expiration as it is extremely unlikely to time out in any ordinary cases. Thanks for pointing out that the deploy guide has to be updated though, I’ve pushed a PR here: https://github.com/holoviz/panel/pull/1976/files