STACK / Maxima and Timeout in Maxima command

STACK / Maxima and Timeout in Maxima command

by Thorsten Bartel -
Number of replies: 3
Picture of Core developers

Hey everyone!

Moodle 3.4.1+
STACK version 4.2.1
Maxima version 5.38.1
Yeah, I know... we're in the process of upgrading.

One of our tutors was complaining that creating a great number of STACK questions took very, very long. I checked the settings and in the STACK functionality check sometimes the formulas wouldn't even be properly displayed. It eventually hung up on me. I don't know why, but we had

timeout --kill-after=180s 180s <path>/lisp.run -q -M <path>/maxima-optimised.mem
as our Maxima command. I acted on a hunch and simply removed the timeout part, as I played around a bit with it in linux shell on a test system and noticed it'd randomly hang commands up for an indeterminate amount of time.

Now everything seems to be running smooth again. Still waiting on feedback from tutor.

Has anybody experienced something similar?

Regards
Thorsten

Average of ratings: -
In reply to Thorsten Bartel

Re: STACK / Maxima and Timeout in Maxima command

by Thorsten Bartel -
Picture of Core developers
Update with some distance: We still had some issues, especially with tests that had lots of STACK questions in them. Even more when plots were involved.
Took another look at things and decided that a cache containing more than 2M items (350k of wich were plots) is not healthy. Clearing the cache alone took an amount of time that proved this assumption. Things are now running truly smooth again and my guess is that many cached items simply couldn't be retrieved due to the database connection timing out.

Lesson learned: Regularly clear your caches (once per term is what we'll be doing from now on).
In reply to Thorsten Bartel

Re: STACK / Maxima and Timeout in Maxima command

by Tim Hunt -
Picture of Core developers Picture of Documentation writers Picture of Particularly helpful Moodlers Picture of Peer reviewers Picture of Plugin developers
I disagree with this. Don't worry about the size of the cache. Probably the more the better.

The reason clearing the cache takes a long time is almost entirely the time taken to delete the plot files on disc.

And there is some bad design (which is my fault). All the plots are in one folder, and most file systems don't like one folder containing 300k files. I have an outstanding issue to changed the directory structure to spread the files into a number of subdirectories. That will make things better.
In reply to Tim Hunt

Re: STACK / Maxima and Timeout in Maxima command

by Thorsten Bartel -
Picture of Core developers
Hello Tim and thank you very much for your reply.

I know that regarding performance, having a mature cache is preferable to having no cache at all by a large margin. But I have also noticed that having to build your cache up from scratch seems to bepreferable to having a large stale cache. After clearing our cache, performance for some activities increased from 3-5 minutes to about 10 seconds loading time.

This might however depend on the type of database used for caching (ours is a MariaDB), others might perform better with large caching tables. Plus improving the directory structure will probably speed things up, too.