Jmeter or loading script/app to simulate concurrent users takng quizzes

Jmeter or loading script/app to simulate concurrent users takng quizzes

by Jerry Lau -
Number of replies: 5

Hello folks.

We have problems with quizzes taking the entire platform down and want to simulate it.

We are not Jmeter experts or moodle gurus but is there a script that someone can share with us that would:

simulate about 70 or x number of people taking a quiz at the same time like in a classroom?

Running moodle 3.4.4 with good mysql db server resources and separate app server with Apache.

Thank you!

Average of ratings: -
In reply to Jerry Lau

Re: Jmeter or loading script/app to simulate concurrent users takng quizzes

by Tim Hunt -
Picture of Core developers Picture of Documentation writers Picture of Particularly helpful Moodlers Picture of Peer reviewers Picture of Plugin developers

The one built into Moodle does not seem to cover quizzes yet: https://github.com/moodle/moodle/tree/master/admin/tool/generator

We have a tool for generating jMeter scripts at the OU, but it is hrorrible old code, and does lots of things specific to OU systems, so I can't share the whole thing, however, I have shared the bits specific to the quiz, which has useful stuff like how to generate the POST data you need to simulate answering a range of core and non-core question types.

And, I have attached a jMeter script that is the kind of thing our tool generates, when you ask it to make a script to loadtest a quiz. This probably the more useful thing. Again, you won't be able to use this directly, but it should show you the kind of things you need to put in your own jMeter scripts.

Hopefully, that is enough that you can make something that works for you.

(Note, the way that script uses a 'HTTP URL Re-writing Modifier' is bad. Best not to copy that bit. I must fix that one day.)

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

Re: Jmeter or loading script/app to simulate concurrent users takng quizzes

by Jerry Lau -

I was just thinking.. how can we test that concurrency load when the quiz only allows one person to attempt a quiz? If we use scripting, we only specify one user only not multiple ones, correct?

The students are able to log in but it takes about 2-3 minutes to save a question and it is kicking them out and forcing them to log back in.

This maybe related also from a department of a failed course shell copy. This is a first for them with this issue, but our feeling is that any users with large question banks will see a backup and/or restore error now.

How can we even check "corruption" and where are these question banks stored?

In reply to Jerry Lau

Re: Jmeter or loading script/app to simulate concurrent users takng quizzes

by Tim Hunt -
Picture of Core developers Picture of Documentation writers Picture of Particularly helpful Moodlers Picture of Peer reviewers Picture of Plugin developers

You can specify multiple users. One way to do this in a jMeter script is to use a CSV file listing the user account you want to use, with their passwords. 

You load that with https://jmeter.apache.org/usermanual/component_reference.html#CSV_Data_Set_Config, then each thread will grab a different username from the CSV file.

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

Re: Jmeter or loading script/app to simulate concurrent users takng quizzes

by Jerry Lau -

So i guess I have to know what the questions are in advance, select an answer and "record" it for each type of user, correct? 

Not sure how to set that up .. which answer/selection they choose from (any choice is fine) from a question to Jmeter.

In reply to Jerry Lau

Re: Jmeter or loading script/app to simulate concurrent users takng quizzes

by Tim Hunt -
Picture of Core developers Picture of Documentation writers Picture of Particularly helpful Moodlers Picture of Peer reviewers Picture of Plugin developers

Well, the POST data you need is different for different question types, so I would not try to load-test a completely random quiz. (However, the only time randomisation has an effect is when the user clicks Start attempt, so you should be able to do meaningful testing with a non-random quiz.)

For a given question type, you can probably use a fixed answer. E.g. answer=frog for any shortanswer question. answer=0 for any multiple-choice question with one right answer (radio buttons). choice0=1 for any multiple choice question with multiple options to select (checkboxes) etc.

Average of ratings: Useful (1)