I noticed that for my Sage server, each open worksheet took about 140MB
of RAM. When I ran out of memory, the server froze and lots of errors
happened. To me, it sounds like you probably ran out of memory if you
had 15 worksheets open simultaneously (which I would calculate would
need about 15*140=2100 MB of RAM).
You can test this yourself by opening up your notebook and opening up 15
worksheets in different tabs in your browser. Run a calculation in each
one and check to see how much memory you have then. Also, you might see
how much memory is consumed by running a single worksheet (i.e., check
the memory usage, start up a single worksheet and calculate something,
and then check the memory usage again).
Jason
> Many thanks, memory seems to be a big problem on my server (I did
> tests you suggested on my laptop and each worksheet is consumig a lot
> of memory). I have seen that sagenb.org has 2GB memory - like my PC.
> How many users wirk simultaneously on sagenb.org?
>
> * I think that I can set up my personal computer as second sage server
> for my class
> Is it sufficient to move the ~/login/.sage directory to clone
> all the work to the second server?
>
> * I will ask our webmaster to increase memory on my virtual server on
> Mondays :)
> But it supprised me that sage is so memory demanding :(
> The students were asked to calculate nothing more than few
> limits and draw some 2d graphs.
I think this is because Sage loads a lot more than your students are
using by default. Periodically, William (or others) has gone through
and audited the sage startup for speed, pruning unnecessary imports--
perhaps the same could be done with an eye towards memory usage. If
you're graphing and plotting, each notebook probably started up a
maxima process as well.
> * Is there any other possibility how to decrease the memory demand? I
> tried to open 17 notebooks with notebook(ulimit="-v 10240") but this
> did not help. The demand for memory was the same as for notebook()
> command.
I would imagine a lot of Sage is in shared object libraries--these
don't have to reside in memory for each individual process, do they?
I wonder if something like pyprocessing could be used, which seems to
effectively re-use the loaded libraries.
> I wonder how the others use sage in education. Do they have so big
> memory on their servers?
> Thank you very much.
I would imagine a couple of GB at least, but I personally don't have
any experience. The summer REU programs that have used Sage here were
on a computer with an atypically large amount of RAM, but that
shouldn't be a necessity.
- Robert
Okay, I was using top to calculate this. What is a better way to
calculate the actual memory being used? I'd like to have an accurate
idea of the memory requirements of a big Sage server.
Thanks,
Jason
Sage uses /proc/pid/status on Linux. I don't know if this is "crappy"
or not; it's code that I got from
http://aspn.activestate.com/ASPN/Cookbook/Python/Recipe/286222
Python Cookbook, by Jean Brouwers
On OSX, indeed it just naively reads top, which is... well just as
good or bad as top at reporting a valid number. I don't know whether
OS X top is sensible or not, though I don't see why it would be wrong.
William
+1 Create a trac ticket. This will be an easy point for the
"fix-the-most-trac-bugs-in-sage contest we're having next week.
Willam
I should retract this statement. I just measured it again and found
that it took about 40MB per worksheet process. To measure this, I
started the sage server, created a new worksheet, and ran "1+1". I then
looked at the free memory reported at the top of top. Then I created
another new worksheet and ran "1+1", and checked the free memory again.
The free memory went down by about 45MB. Michael Abshoff says that
that numbers sounds about right. I don't know if I measured
inaccurately before or if I just misremembered the number. At any rate,
with that number, it seems that 15 simultaneous worksheets would use a
minimum of 15*45=675MB, which is still more than you allocated. And as
others point out, this is before the OS, the sage server, etc.
Jason
+1, that sounds like a very good idea. I'd imagine one could have a
fresh copy of sage, and just fork from there for every new doctest/
notebook session. (It would probably be a lot simpler, and still
scale much better, for the notebook to start an unused sage process
in the background and then repeatedly forking that rather than trying
to fork the notebook process itself).
- Robert
Nice sites. I noticed a small typo on the front page of
http://user.mendelu.cz/marik/maw/index.php?lang=en&form=derivace
In the text "The calculators are divided into several groups, the
desription is available", the word "description" is missing the "c".
Thanks,
Jason