WeBWorK Main Forum

Using WeBWorK to run a contest

Using WeBWorK to run a contest

by Peter Staab -
Number of replies: 3

On our campus, we have run a contest for high school student each spring.  Until last year it was in person on paper, a 50-problem multiple choice test.   We typically had 400-500 students.

We are going to run an online version of the contest this year and expecting around 200 and I think webwork is the right platform to do this on.  My thought is to use a Gateway Quiz so we can time it.  I was wondering if people can thoughts on what to do and not do for this.

In reply to Peter Staab

Re: Using WeBWorK to run a contest

by Danny Glin -

Are you planning on having all students write at the same time?  If so, this is almost a worst-case scenario in terms of load on your server.

When a student starts a Gateway Quiz the system has to create a version of the quiz for that student, which involves a whole bunch of writes to the database, and then render all of the problems on the quiz.  Because of the way the code is written this is handled serially by a single apache process.  i.e. when a student clicks on "Take ... Test", an apache process is assigned, and that process can't serve any other pages until it has created the test and rendered all 50 problems.  There are a couple of implications of this:

  1. If you have more students starting simultaneously than you have apache processes (as determined by MaxRequestWorkers in your apache configuration), then students will have to wait until previous requests have completed before their quiz will load.  This in itself won't crash your server (assuming that you have enough memory for the number of processes), but it can mean long waits for pages to load.  The one danger is students that get impatient and click reload, as this adds additional requests, which means even longer waits.
  2. A single apache process will be rendering all 50 problems for one student.  Due to the memory leaks in problem processing, each problem increases the memory footprint of the apache process, so you could see the memory usage of apache processes ballooning very quickly.  This can easily run your server out of memory.

Typically a WeBWorK server has apache configured so that MaxConnectionsPerChild is set to 50 or 100, which means that an apache process is killed after serving that many requests, and then a new process starts.  This frees up the memory that is tied up by the memory leaks in problems rendered by that process.  In a typical scenario (e.g. a server serving a mix of assignments and quizzes), the 50 requests served by a process would be mostly single questions, with the odd quiz mixed in.  If everyone is starting the quiz at the same time, then a single process might have to handle several consecutive requests which ask it to render 50 problems, so you could see memory usage for apache processes that is significantly higher than what you normally see.

If you want to be safe about memory usage, then you can go to the extreme of setting MaxConnectionsPerChild to 1, which means that an apache process will be terminated after it serves a single request.  This solves the issue of growing memory usage of these processes, but adds the processing overhead of having to start a new apache process for each request.  If your server has sufficient processing power (no, I don't know what constitutes "sufficient" here), then this may be the way to go.

Of course all of this is somewhat vague, since it is notoriously hard to quantify exactly what the memory and processor usage is for specific actions in WeBWorK, but hopefully this gives you some ideas.

In reply to Peter Staab

Re: Using WeBWorK to run a contest

by Alex Jordan -

Something to consider would be running it as homework, not a quiz, but with each question getting 1 attempt. You could make the set hidden until a proctor unhides it. The proctor could control the close date, or hide it again.

If you can stagger the start times, that is good. Even with a regular classroom of 30, I've seen issues on the first day of class where an instructor has everyone visit WW in class at the same time, and they all jump into a question within seconds of each other. It just slows things down until there is a more natural stagger to the rendering requests.

In reply to Peter Staab

Re: Using WeBWorK to run a contest

by Peter Staab -
Thanks for the ideas. We don't want the student to know if the answers are right or not as the go through the problems, I don't think a Homework Set will work. I think our numbers will be about 120 and We're looking to stagger the start times to get groups of no more than 20 starting at the same time to help us out. We're also cutting down the number of problems to 30.

Danny, I'll look into the memory usage and chat with our IT folks to see what will work for us.