Is STACK very resource consuming?

Is STACK very resource consuming?

by Daniel Gandolfo -
Number of replies: 20

Hello,
this question is about the STACK plugin which seems to be well suited for developing math questions.

I asked the moodle admin in my university to install the STACK plugin to test it (actually, he will). He told me that people who inquired about STACK told him that STACK uses a lot of resources.

What is the reality? Is STACK very demanding in terms of resources compared to, for example, the Formulas plugin that I use intensively?

Thanks for infos.
Daniel.

Average of ratings: -
In reply to Daniel Gandolfo

Re: Is STACK very resource consuming?

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 think this is something to be aware of, but not something to be unduly frightened of.

Because of what STACK is doing (which is very worthwhile if you are a mathematician) it certainly is more heavy-weight than other quesiton types. A sensible way to start is to use it for classwork first, not final assessment. Then, once you can see what impact it has on your servers, you can move on to higher-stakes use.

Also, the part of STACK which is most demanding is the back-end code which processes the maths using some software called Maxima. The good way to set things up puts that load onto a separate server, using https://github.com/maths/stack_util_maximapool, or these days, more conveniently, https://github.com/uni-halle/maximapool-docker. Doing that deals with most concerns about performance. Also, worth ensuring that you are on Moodle 3.9 or later, since  MDL-67183 helps. Again, you may not need to do that when initially trying STACK out to see if it is something you want, but it is a useful option as your use grows.

We use MaximaPool on some pretty modest servers (we have two of them, but only because we always have multiple servers for resiliance), and they never get about 10% CPU load (the average is nearer 2%). And, that includes on the busiest day this year, when students attempted 18,000 questions in one day.

Average of ratings:Useful (3)
In reply to Tim Hunt

Re: Is STACK very resource consuming?

by Daniel Gandolfo -
I have to see what moodle version we use, I think we are not yet on 3.9...
The examples at the end are very convincing. Anyway, I'll see how it goes here when I use it and will give my comments here.

Thanks for the very complete answer!
In reply to Tim Hunt

Re: Is STACK very resource consuming?

by Thorsten Bartel -
Picture of Core developers
To expand on Tim's excellent answer, please keep an eye on memory requirements of your MaximaPool server. This has proven to be more of a bottleneck for us than CPU load.

There is also an advanced attempt to implement a maxima webservice in golang (opposed to MaximaPool's Java approach) here:
https://github.com/mathinstitut/goemaxima

Cheers
Average of ratings:Useful (1)
In reply to Thorsten Bartel

Re: Is STACK very resource consuming?

by Tim Hunt -
Picture of Core developers Picture of Documentation writers Picture of Particularly helpful Moodlers Picture of Peer reviewers Picture of Plugin developers
Interesting. Thanks for sharing that approach using Go. Would you care to guess when that might be ready for production use?

I see you have copied the 'maxima' folder from STACK into your repo. Did you consder fetching it from github at build time?

I was wondering about trying to package up Maxima as an AWS Lambda - but I am not sure if that is an appropriate approach.
In reply to Tim Hunt

Re: Is STACK very resource consuming?

by Thorsten Bartel -
Picture of Core developers
It was not my intent to claim this work as my own, sorry for any confusion.
The repo is owned by the faculty of mathematics and computer science at the University of Göttingen (as far as I know). I don't have any contact points (yet) and have only looked a bit into existing alternatives to MaximaPool. As the project is public, I thought it could be interesting to share.

As far as I know, it is already used in production, see here:
https://projects.gwdg.de/projects/netzwerk-mathe-digital/wiki/stack-maxima-pool-technical-details

It seems to be maintained mainly by Ilias users, but thanks to the architecture of STACK, this should still make it applicable to anyone using STACK in a Moodle environment.

As far as AWS is concerned I can only speak for myself and what I perceive to be the situation amongst German universities: Most would be very hesitant to needlessly place any service inside a cloud environment. Deployable docker images (such as the one you shared) or install & configuration scripts (such as an Ansible playbook) seem to be much more favored.
Average of ratings:Useful (2)
In reply to Thorsten Bartel

Re: Is STACK very resource consuming?

by Marcus Green -
Picture of Core developers Picture of Particularly helpful Moodlers Picture of Plugin developers Picture of Testers
'Most would be very hesitant to needlessly place any service inside a cloud environment. '
What are the reason for your hesitancy?
In reply to Marcus Green

Re: Is STACK very resource consuming?

by Thorsten Bartel -
Picture of Core developers

Very strict data protection laws and the extra effort coming with ensuring compliance.
Setting up your own open source system on premises is much easier in most cases.

In reply to Tim Hunt

Re: Is STACK very resource consuming?

by Frauke Sprengel -

@Tim Hunt:

I forwarded your suggestion to the responsible person in Göttingen.

In reply to Tim Hunt

Re: Is STACK very resource consuming?

by Stefan Koospal -

Hello,

my name is Stefan Koospal, System Admin, Math. Institut Goettingen. My team created that "go" solution for the STACK back end.  The solution is in production.

Further on we offer a Kubernetes based service with this solution(Public Maxima Pool). It's free to use without notice. This service should help to spread the use of STACK. It used by STACK users in Europe.

Online exams with up to 500 users at a time are running smoothless (about 100 requests per minute).  At the moment we see the limit at 1000 STACK(=maxima) requests per minute. We are just adding 6 blades to be started on request to expand the maximum limit to 2000 requests per minute.

Further details (how to use our Kubernetes cluster, how to use the "go" solution) you can find here:

https://projects.gwdg.de/projects/netzwerk-mathe-digital/wiki/stack-maxima-pool-technical-details


Average of ratings:Useful (1)
In reply to Stefan Koospal

Re: Is STACK very resource consuming?

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 just want to say, thank you very much for creating this solution.
In reply to Tim Hunt

Re: Is STACK very resource consuming?

by Stefan Koospal -
> I was wondering about trying to package up Maxima as an AWS Lambda - but I am not sure if that is an appropriate approach.
I am afraid, that will not work. The "Go" solution is only a frontend to maxima. What we offer is a docker container with the "Go"-solution, maxima, gnuplot. For AWS Lambda you need a native Linux executable (as far I know), not a container with a set of binaries.
Average of ratings:Useful (1)
In reply to Stefan Koospal

Re: Is STACK very resource consuming?

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 was not considering using your Go solution as a basis of the Lambda.

Before I discovered your solution, I was considering working out how (if) it might be possible to wrap maxima up in a lambda, but I probably won't bother now. I was guessing that the AWS infrastructure for executing Lambdas is doing something very similar to MaximaPool or your Go solution, but with a far greater degree of sophistication, scalability, monitoring and reporting. (Plus, it is always fun to explore new technologies.)
Average of ratings:Useful (1)
In reply to Tim Hunt

Re: Is STACK very resource consuming?

by Stefan Koospal -
Let me know if you are successful. The problem I see is to wrap maxima and gnuplot in one lambda. For scalability, monitoring and reporting we use kubernetes, rancher and kibana.
In reply to Tim Hunt

Re: Is STACK very resource consuming?

by Stefan Koospal -
> I see you have copied the 'maxima' folder from STACK into your repo. Did you consder fetching it from github at build time?

The 2017121800 version contains a slightly patched version for ilias, so we felt more convenient to just vendor the files rather than downloading the files, although either way probably works fine.
In reply to Thorsten Bartel

Re: Is STACK very resource consuming?

by Bruce Musinguzi -
I have tried to implement goemaxima but invain
am i supposed to install other software like maxima, gplot etc before i deal with goemaxima??
at the end of it all, i don't get anything from http://[address:port]/goemaxima. or http://[address:port]/maxima
In reply to Bruce Musinguzi

Re: Is STACK very resource consuming?

by Stefan Koospal -
The goemaxima image includes maxima and gnuplot. You only have to install a basic linux and docker.
Please follow the instructions:
https://projects.gwdg.de/projects/netzwerk-mathe-digital/wiki/stack-maxima-pool-technical-details
In reply to Stefan Koospal

Re: Is STACK very resource consuming?

by Bruce Musinguzi -
thank you for the pointer, successfully created the image
When i visit http://ipaddress:port/goemaxima i see a "Hostname and Version" (I guess that means its good).
But i can't get it to work yet, i am not sure why...
What should the "Stack Plugin" configuration be like?
i.e Platform type,Maxima command etc
Please advise.
In reply to Bruce Musinguzi

Re: Is STACK very resource consuming?

by Stefan Koospal -
Sorry, I can not help you with details of configuration of STACK in Moodle. We use STACK with ILIAS. Perhaps somebody else here can help you.
In reply to Bruce Musinguzi

Re: Is STACK very resource consuming?

by Thorsten Bartel -
Picture of Core developers
Hi Bruce,

in Moodle, you'd have to adjust the following settings:
- platform: set this to "Server"
- maximaversion: choose the maxima version included in the goemaxima image
- maximacommandserver: this should be set to the URL of the maxima applet (I'm guessing that's in the form "http://ipaddress:port/goemaxima" you mentioned earlier - however, I have only experience with MaximaPool, not goemaxima.)

That should be about it. This is for the latest STACK version, though - older versions would require you to enter the URL into the "maximacommand" field when having "platform" set to "Server".

Cheers
In reply to Thorsten Bartel

Re: Is STACK very resource consuming?

by Bruce Musinguzi -
Thank you @Thorsten Bartel and @Stefan Koospal, i have had time to play with the different settings.
I set url, i.e "http://ipaddress:port/goemaxima" to both maximacommand and maximacommandserver, and it worked well
When i set the url to maximacommand only, it did not work, and then tried maximacommandserver only, it worked.

so now i have both of them to the same URL, the rest are set as @Thorsten Bartel specified.
Thank you every body for your help.