Load Testing

Re: Load Testing

by Jeff White -
Number of replies: 0

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)