ASKSAGE: Sage Q&A Forum - Individual question feedhttps://ask.sagemath.org/questions/Q&A Forum for SageenCopyright Sage, 2010. Some rights reserved under creative commons license.Thu, 10 Jul 2014 15:45:14 -0500How does Notebook worksheet timeout work?https://ask.sagemath.org/question/23351/how-does-notebook-worksheet-timeout-work/I cannot understand how the Sage Notebook server actually treats the `timeout` parameter. The [documentation](http://sagemath.org/doc/reference/notebook/sagenb/notebook/notebook_object.html) just says that it is the "*...seconds until idle worksheet sessions automatically timeout.*" However, it is not completely clear when the worksheet is considered *idle*.
From [this answer](http://ask.sagemath.org/question/7638/what-state-is-preserved-when-i-close-a-running-notebook-browser-window/?answer=11556#post-id-11556) by William Stein it follows that the worksheet is considered *idle* if the user closes the corresponding tab in the browser.
I performed several tests today and here is what I got:
1. I started my local Notebook server with `timeout=10` and opened a couple of worksheets in my browser. After that I closed some of them keeping the others open, and just waited for the corresponding message in the console. After about 10 minutes I saw a bunch of messages in the console saying that Sage had just closed all of my opened worksheets. So, Sage server closed all the worksheets regardless of whether they were opened in the browser or not.
2. During the second test I opened two worksheets and started to refresh only one of them (by pressing `F5`). After ~10min Sage closed both of them at the same time. So, obviously, refreshing the page does not help.
3. The third test was to start computing something and see what happens. So I started some "never-ending" computation in the worksheet and kept the page open in the browser. It showed the rotating stick (`/ \ / \ ...`) for ~10 minutes and than terminated the process again, despite the fact that I kept the browser tab open all the time.
So it looks like the only thing that resets the timer is starting some cell to calculate something (`Shift+Enter`).
*And just a side note: I noticed that the minimum actual timeout is 10 minutes.*
---------------
My question is: are all my tests and conclusions correct? And if they are, is it really the intended behaviour for Notebook server?Thu, 10 Jul 2014 12:26:37 -0500https://ask.sagemath.org/question/23351/how-does-notebook-worksheet-timeout-work/Answer by kcrisman for <p>I cannot understand how the Sage Notebook server actually treats the <code>timeout</code> parameter. The <a href="http://sagemath.org/doc/reference/notebook/sagenb/notebook/notebook_object.html">documentation</a> just says that it is the "<em>...seconds until idle worksheet sessions automatically timeout.</em>" However, it is not completely clear when the worksheet is considered <em>idle</em>.</p>
<p>From <a href="http://ask.sagemath.org/question/7638/what-state-is-preserved-when-i-close-a-running-notebook-browser-window/?answer=11556#post-id-11556">this answer</a> by William Stein it follows that the worksheet is considered <em>idle</em> if the user closes the corresponding tab in the browser.</p>
<p>I performed several tests today and here is what I got:</p>
<ol>
<li><p>I started my local Notebook server with <code>timeout=10</code> and opened a couple of worksheets in my browser. After that I closed some of them keeping the others open, and just waited for the corresponding message in the console. After about 10 minutes I saw a bunch of messages in the console saying that Sage had just closed all of my opened worksheets. So, Sage server closed all the worksheets regardless of whether they were opened in the browser or not.</p></li>
<li><p>During the second test I opened two worksheets and started to refresh only one of them (by pressing <code>F5</code>). After ~10min Sage closed both of them at the same time. So, obviously, refreshing the page does not help.</p></li>
<li><p>The third test was to start computing something and see what happens. So I started some "never-ending" computation in the worksheet and kept the page open in the browser. It showed the rotating stick (<code>/ \ / \ ...</code>) for ~10 minutes and than terminated the process again, despite the fact that I kept the browser tab open all the time.</p></li>
</ol>
<p>So it looks like the only thing that resets the timer is starting some cell to calculate something (<code>Shift+Enter</code>).</p>
<p><em>And just a side note: I noticed that the minimum actual timeout is 10 minutes.</em></p>
<hr/>
<p>My question is: are all my tests and conclusions correct? And if they are, is it really the intended behaviour for Notebook server?</p>
https://ask.sagemath.org/question/23351/how-does-notebook-worksheet-timeout-work/?answer=23354#post-id-23354I'm not sure about the computation piece, but yes, the timeout is supposed to be independent of whether a worksheet is open in a browser or not. In fact, that is sort of the point - if you aren't interacting with the sheet, Sage will close it with that timeout. And if you close the worksheet in the window, you may intend for the computation to continue, so that shouldn't stop the computation.
But this is only a heuristic answer, and others may have more technical replies, in particular about your third point.Thu, 10 Jul 2014 15:45:14 -0500https://ask.sagemath.org/question/23351/how-does-notebook-worksheet-timeout-work/?answer=23354#post-id-23354