Bokeh Server 2.0.0 Session Expiration Duration

I recently migrated from a development environment on my Windows Laptop to a Linux Server and started getting ‘Token is expired’ errors when connecting to a bokeh serve application. I discovered it was timing out anytime my bokeh application took more than 5 minutes to load. I’m processing over 400 million records and rendering multiple timeseries glyphs and tabs so this is problematic. I discovered that Version 2.0.0 now implements a token expiration which defaults to 900 seconds. While the documentation says they’ve implemented the ability to control token expiration I’m unable to find any bokeh serve parameters to modify, increase, this setting. I’ve tried --session-expiration-duration but it’s not a recognized bokeh serve parameter.

Solved, replaced --session-expiration-duration with --session-token-expiration parameter. I thought I saw some documentation that stated the value was in seconds but I believe it is milliseconds because it didn’t work when I first set it to 900 (15 min) but did after changing it to 900000. Successfully rendered a bokeh report that took 8 min 33 secs to build and load.

@rossrogan Just to expand:

  • --session-expiration-duration is the minimum length of time an already created session will be kept open without any activity or input.

  • --session-token-expiration is the length of time that the JWT token for authorizing new session creation is valid for.

Usually the token expiration should be a small number but if creating a session for your app takes a very long time they you would need to bump the value as you have done.

All “time interval” parameters to the server are always in milliseconds, as you have noted.