Load Testing

Load Testing

by Graham Stone -
Number of replies: 5
Picture of Testers

Good Afternoon,


Has anybody ever done any load testing of their Moodle servers?  I have just been asked by our Quality team what the maximum number of users our Moodle could deal with logging on at the same time.


If you have answered yes how did you go about it etc?


Thanks,


Average of ratings: -
In reply to Graham Stone

Re: Load Testing

by Jeff White -

If you already have production instance, you need to determine the average number of action per minute per user. I had Piwik up for my environment so I was able to find that out easy. Just do this math: average visit time / average actions per visit = Average actions per minute per user. I got about 1 action per minute per user with my environment. 

Check out this built in tool in Moodle. /admin/tool/generator/maketestplan.php and then build a jmeter server and install this tool: https://github.com/lucisgit/moodle-jmeter-script-generator 

It is not easy to determine your maximum supported users out of the box so I just made simple bash script that ran a load test at growing increments of 25 users and 25 actions per minute (throughput). 

"

#!/bin/bash

##  make your script resets your moodledata, caches, and database to a clean instance each time the the script loops. I am not including that part of my script as that is different for your site. Read the documentation on the moodle-performance-comparison for a better explanation.##

COUNTER=25

while [  $COUNTER -lt 525 ]; do

./test_runner.sh -u $COUNTER -t $COUNTER Moodle UsersTPM_$COUNTER ./testplan.jmx ./users.csv ./site_data.properties

mv runs_samples/data.* runs_samples/new/UserTPM$COUNTER.jtl

let COUNTER=COUNTER+25

done

"

  • You can overwrite the values provided by the test plan using test_runner.sh options:
    • -u=[users_number]
    • -l=[loops_number]
    • -r=[rampup_period]
    • -t=[throughput]

My load test ran for days, taking several hours for each tier of users and throughput. So after several days, I had a couple of jmeter test results... not very helpful and organized. I tried out https://loadosophia.org to make sense of the data and I was happy. I made the estimate the maximum number of concurrent users  we can support before a drop in performance is when an web page takes longer longer than 1 second to load (high standards). So I got a nice graph like this: 

Graph

Try to make your test course as similar as possible to your courses in your production environment. Make sure your Moodle server isolated as you are going to hitting your server hard, so if you have are sharing resources with a production environment someone is going to be mad you.

Average of ratings: Useful (3)
In reply to Graham Stone

Re: Load Testing

by Howard Miller -
Picture of Core developers Picture of Documentation writers Picture of Particularly helpful Moodlers Picture of Peer reviewers Picture of Plugin developers

Testing people logging in doesn't tell you anything useful. Try to imagine what your worst case is - a large class doing a quiz at the same time perhaps?

In reply to Howard Miller

Re: Load Testing

by Jeff White -

The admin/tool/generator/maketestplan.php tool does not do quizzes unfortunately sad. It does do forum posts and I think that has similar hits on the database. Correct me if I am wrong.

All my load testing shows logging in and logging out to have the least impact in response time. This is especially true if you are using memcached/memcache for session handling. 

In reply to Jeff White

Re: Load Testing

by Michael Hughes -

We used the tool to create the basic course and test plan and then embellished it ourselves on a stand alone instance of JMeter. You can get JMeter to pretty much simulate anything, submitting answers, uploading docs etc. You just need to use the jmx file it produces and load up with a copy of JMeter http://jmeter.apache.org/

You then need to decide what you are testing, is it performance of specific activities, before and after type testing like upgrades, or seeing what load your system can handle. And then edit JMeter settings accordingly for target throughput, number users, loops of test etc

Mike