Note:

If you want to create a new page for developers, you should create it on the Moodle Developer Resource site.

Load testing Moodle with JMeter: Difference between revisions

From MoodleDocs
mNo edit summary
No edit summary
(25 intermediate revisions by 4 users not shown)
Line 1: Line 1:
Being the original load testing tool for servers, introduced in 1998(!), JMeter [http://jmeter.apache.org/] has always been the number one load testing resp. performance measuring tool for Moodle. Around its release 2.5, Moodle developers made the testing process vastly simpler by adding many scripts. The topic of this page are the two scripts  ''Make test course''  and ''Make JMeter test plan'', both available under ''Site administration > Development''. Together with the set of add-ons [https://github.com/moodlehq/moodle-performance-comparison Moodle performance comparison] they comprise a full set of load testing tools.


This article is a stub until we collect enough information about the developments since [https://docs.moodle.org/dev/index.php?title=JMeter&oldid=35771 previous update in 2012]. All improvements are welcome!
Warning:  Do not run these scripts on a production system! These scripts generate large amounts of artificial data and load the server to its limit and beyond, making it to bloat and become non-responsive. Don't even run them on a separate Moodle instance in the production server: their effect on the DBMS is undocumented.


You can also add your comments to the [https://docs.moodle.org/dev/index.php?title=Talk:JMeter&action=edit&redlink=1 discussion page] or to the the [https://moodle.org/mod/forum/discuss.php?d=395002 discussion in the General developer forum].
<h2>Make test course</h2>
(Moved to https://docs.moodle.org/39/en/Test_course_generator)


<hr/ >
<h2>Make JMeter test plan</h2>
The [http://jmeter.apache.org/ Apache JMeter] has always been the most common load testing resp. performance measuring tool in the Moodle community. Since around release 2.5, Moodle makes the process of load testing with JMeter vastly simpler through two built-in scripts '''Make test course''' (Site administration > Development > Make test course) and '''Make JMeter test plan''' (dito > Make JMeter test plan) augmented by a set of add-ons [https://github.com/moodlehq/moodle-performance-comparison Moodle performance comparison]. This document is about the two built-in scripts and JMeter.
(Moved to https://docs.moodle.org/39/en/JMeter_test_plan_generator)


Warning:  '''Do not run these scripts on a production system!'''
<h2>Running the test plan on JMeter</h2>
JMeter is a Java application so it can run on Windows, Mac, or Linux. It can be run on the command line or on its graphical client on your desktop. First check if Java is installed in your client computer by opening a console and entering '
java -version'. If it doesn't return a version, first install [https://www.java.com/ Java] on your client. The instructions vary with the operating system.


These scripts generate data and load the server to its limit and beyond, making it to bloat and become nonreponsive. Don't even run them on a separate Moodle instance in the production server: their effect on the DBMS is undocumented.
To install JMeter go to the [http://jmeter.apache.org/download_jmeter.cgi JMeter page], download the zip and unzip it to the directory of your choice.


<h2>Make test course</h2>
To run JMeter. open the /bin subdirectory and use either jmeter.bat on Windows or ./jmeter on Linux. This will open the JMeter GUI.
(to be filled)


<h2>Make JMeter test plan</h2>
First step is to go to File -> Open and select the testplan.jmx file. This will open a tree on the left hand side of JMeter.
(to be filled)
Open the Warm-up site -> Default site request and enter the protocol (http or https) and Server name or IP. Then go to CSV Users Data and locate your users.csv file under Filename. <b>Repeat </b> this for Moodle Test.


<h2>Running the test plan on JMeter</h2>
Right mouse click on the Test Plan, then Add -> Listener. I choose Aggregate Report so I can follow the run as it happens. Save the changes in your test plan and run it.
(to be filled)


==See also==
==References==
*[http://jmeter.apache.org/jmeter/ Apache JMeter homepage]
* [1] [http://jmeter.apache.org/ Apache JMeter homepage]
*[https://moodle.org/mod/forum/discuss.php?d=377231 Jmeter or loading script/app to simulate concurrent users takng quizzes] (October 2018)
* [2] [https://docs.moodle.org/en/Performance_recommendations#Obtain_a_baseline_benchmark Moodle Docs: Performance -> Obtain_a_baseline_benchmark]
*[https://moodle.org/mod/forum/discuss.php?d=368620 Has anyone successfully run a jmeter test with 1000 users?] (April 2018)
* [3] [https://moodle.org/mod/forum/discuss.php?d=377231 Jmeter or loading script/app to simulate concurrent users taking quizzes] (October 2018)
* [4]  [https://moodle.org/mod/forum/discuss.php?d=368620 Has anyone successfully run a jmeter test with 1000 users?] (April 2018)


[[Category:Developer tools]]
[[Category:Developer tools]]

Revision as of 06:13, 23 August 2021

Being the original load testing tool for servers, introduced in 1998(!), JMeter [1] has always been the number one load testing resp. performance measuring tool for Moodle. Around its release 2.5, Moodle developers made the testing process vastly simpler by adding many scripts. The topic of this page are the two scripts Make test course and Make JMeter test plan, both available under Site administration > Development. Together with the set of add-ons Moodle performance comparison they comprise a full set of load testing tools.

Warning: Do not run these scripts on a production system! These scripts generate large amounts of artificial data and load the server to its limit and beyond, making it to bloat and become non-responsive. Don't even run them on a separate Moodle instance in the production server: their effect on the DBMS is undocumented.

Make test course

(Moved to https://docs.moodle.org/39/en/Test_course_generator)

Make JMeter test plan

(Moved to https://docs.moodle.org/39/en/JMeter_test_plan_generator)

Running the test plan on JMeter

JMeter is a Java application so it can run on Windows, Mac, or Linux. It can be run on the command line or on its graphical client on your desktop. First check if Java is installed in your client computer by opening a console and entering ' java -version'. If it doesn't return a version, first install Java on your client. The instructions vary with the operating system.

To install JMeter go to the JMeter page, download the zip and unzip it to the directory of your choice.

To run JMeter. open the /bin subdirectory and use either jmeter.bat on Windows or ./jmeter on Linux. This will open the JMeter GUI.

First step is to go to File -> Open and select the testplan.jmx file. This will open a tree on the left hand side of JMeter. Open the Warm-up site -> Default site request and enter the protocol (http or https) and Server name or IP. Then go to CSV Users Data and locate your users.csv file under Filename. Repeat this for Moodle Test.

Right mouse click on the Test Plan, then Add -> Listener. I choose Aggregate Report so I can follow the run as it happens. Save the changes in your test plan and run it.

References