Automatically destroy sessions after period of time bokeh serve


Is it possible to have user sessions automatically destroyed after a period of non-use? I tried the following command line arguments:


but they don’t seem to do what I want. The use case is that I’ll have colleagues keep tabs open for days on end. Due to the size of the data I serve, this can become a bit of resource issue on my server.

Can I specifically destroy sessions on the server side? I’ve tried to invoke the destroy() method, but seem to run into other problems.


So, I’ve recently had a vague notion of noticing that unused sessions are not being collected any more the way they used to be, but have not had a chance to follow up on things. Can you do the following?

  • Test out those command line options with a toy example with an older version, e.g. Bokeh 1.4 or 1.2 ?

  • Assuming they work as expected on the older version, file a bug report on Github issues with all this information?

If you are not able to test with older versions, I’d say go ahead and make a GH issue regardless. Unfortunately I don’t have any workarounds to suggest offhand.

You can also run with --log-level=debug At that level Bokeh should report every time it runs the unused session check with some stats as well. Certainly in the past you would see sessions get collected after some timeout but perhaps there has been a regression. There are two possibilities: The checks are not running at all (you’ll see no log messages) or the check is running, but not closing any sessions (you’ll see log messages but the stats won’t go down). That’s also important info for a GH issue.