<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>https://docs.moodle.org/dev/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=Ratna</id>
	<title>MoodleDocs - User contributions [en]</title>
	<link rel="self" type="application/atom+xml" href="https://docs.moodle.org/dev/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=Ratna"/>
	<link rel="alternate" type="text/html" href="https://docs.moodle.org/dev/Special:Contributions/Ratna"/>
	<updated>2026-06-09T20:24:51Z</updated>
	<subtitle>User contributions</subtitle>
	<generator>MediaWiki 1.43.5</generator>
	<entry>
		<id>https://docs.moodle.org/dev/index.php?title=Load_testing_Moodle_with_JMeter&amp;diff=61606</id>
		<title>Load testing Moodle with JMeter</title>
		<link rel="alternate" type="text/html" href="https://docs.moodle.org/dev/index.php?title=Load_testing_Moodle_with_JMeter&amp;diff=61606"/>
		<updated>2022-01-07T17:55:25Z</updated>

		<summary type="html">&lt;p&gt;Ratna: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;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 is the usage of the two scripts &#039;&#039;Make test course&#039;&#039; [https://docs.moodle.org/en/Test_course_generator] and &#039;&#039;Make JMeter test plan&#039;&#039; [https://docs.moodle.org/en/JMeter_test_plan_generator] and JMeter running on a client machine.&lt;br /&gt;
&lt;br /&gt;
Warning:  Do not run these scripts nor JMeter targeting a production system! They generate a large amounts of artificial data and load the server to its limit and beyond, making it to bloat and/or become non-responsive. Don&#039;t even run them on a separate Moodle instance in the production server: their effect on the DBMS is undocumented.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;h2&amp;gt;Prerequisite&amp;lt;/h2&amp;gt;&lt;br /&gt;
&amp;lt;h3&amp;gt;JMeter installed on your client computer&amp;lt;/h3&amp;gt;&lt;br /&gt;
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 &#039;java -version&#039;. If it doesn&#039;t return a version, first install [https://www.java.com/ Java] on your client. The instructions vary with the operating system.&lt;br /&gt;
&lt;br /&gt;
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.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;h2&amp;gt;A test plan&amp;lt;/h3&amp;gt;&lt;br /&gt;
You can make a test plan from the JMeter client in DIY style. We do not describe that path here, assuming you know JMeter. This page describes how to make a test plan with the scripts built in to Moodle and run it.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;h3&amp;gt;Make test course&amp;lt;/h3&amp;gt;&lt;br /&gt;
See https://docs.moodle.org/en/Test_course_generator&lt;br /&gt;
&lt;br /&gt;
&amp;lt;h3&amp;gt;Make JMeter test plan&amp;lt;/h3&amp;gt;&lt;br /&gt;
See https://docs.moodle.org/en/JMeter_test_plan_generator&lt;br /&gt;
&lt;br /&gt;
&amp;lt;h2&amp;gt;Running the test plan on JMeter&amp;lt;/h2&amp;gt;&lt;br /&gt;
To run JMeter open the /bin subdirectory and use either jmeter.bat on Windows or ./jmeter on Linux. This will open the JMeter GUI.&lt;br /&gt;
&lt;br /&gt;
First step is to go to File -&amp;gt; Open and select the testplan.jmx file you downloaded above. This will open a tree on the left hand side of JMeter. Open the Warm-up site -&amp;gt; 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. &amp;lt;b&amp;gt;Repeat &amp;lt;/b&amp;gt; this for Moodle Test.&lt;br /&gt;
&lt;br /&gt;
Right mouse click on the Test Plan, then Add -&amp;gt; Listener. Choose Aggregate Report so you can follow the run as it happens. Save the changes in your test plan and run it.&lt;br /&gt;
&lt;br /&gt;
==References==&lt;br /&gt;
* [1] [http://jmeter.apache.org/ Apache JMeter homepage]&lt;br /&gt;
* [2] [https://docs.moodle.org/en/Performance_recommendations#Obtain_a_baseline_benchmark Moodle Docs: Performance -&amp;gt; Obtain_a_baseline_benchmark]&lt;br /&gt;
* [3] [https://moodle.org/mod/forum/discuss.php?d=377231 Jmeter or loading script/app to simulate concurrent users taking quizzes] (October 2018)&lt;br /&gt;
* [4]  [https://moodle.org/mod/forum/discuss.php?d=368620 Has anyone successfully run a jmeter test with 1000 users?] (April 2018)&lt;br /&gt;
&lt;br /&gt;
[[Category:Developer tools]]&lt;/div&gt;</summary>
		<author><name>Ratna</name></author>
	</entry>
	<entry>
		<id>https://docs.moodle.org/dev/index.php?title=Load_testing_Moodle_with_JMeter&amp;diff=61605</id>
		<title>Load testing Moodle with JMeter</title>
		<link rel="alternate" type="text/html" href="https://docs.moodle.org/dev/index.php?title=Load_testing_Moodle_with_JMeter&amp;diff=61605"/>
		<updated>2022-01-07T17:52:04Z</updated>

		<summary type="html">&lt;p&gt;Ratna: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;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 is the usage of the two scripts &#039;&#039;Make test course&#039;&#039; [https://docs.moodle.org/en/Test_course_generator]  and &#039;&#039;Make JMeter test plan&#039;&#039; [https://docs.moodle.org/en/JMeter_test_plan_generator] on JMeter running in a client machine.&lt;br /&gt;
&lt;br /&gt;
Warning:  Do not run these scripts nor JMeter targeting a production system! They generate a large amounts of artificial data and load the server to its limit and beyond, making it to bloat and/or become non-responsive. Don&#039;t even run them on a separate Moodle instance in the production server: their effect on the DBMS is undocumented.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;h2&amp;gt;Prerequisite&amp;lt;/h2&amp;gt;&lt;br /&gt;
&amp;lt;h3&amp;gt;JMeter installed on your client computer&amp;lt;/h3&amp;gt;&lt;br /&gt;
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 &#039;java -version&#039;. If it doesn&#039;t return a version, first install [https://www.java.com/ Java] on your client. The instructions vary with the operating system.&lt;br /&gt;
&lt;br /&gt;
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.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;h2&amp;gt;A test plan&amp;lt;/h3&amp;gt;&lt;br /&gt;
You can make a test plan from the JMeter client in DIY style. We do not describe that path here, assuming you know JMeter. This page describes how to make a test plan with the script built in to Moodle.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;h3&amp;gt;Make test course&amp;lt;/h3&amp;gt;&lt;br /&gt;
See https://docs.moodle.org/en/Test_course_generator&lt;br /&gt;
&lt;br /&gt;
&amp;lt;h3&amp;gt;Make JMeter test plan&amp;lt;/h3&amp;gt;&lt;br /&gt;
See https://docs.moodle.org/en/JMeter_test_plan_generator&lt;br /&gt;
&lt;br /&gt;
&amp;lt;h2&amp;gt;Running the test plan on JMeter&amp;lt;/h2&amp;gt;&lt;br /&gt;
To run JMeter open the /bin subdirectory and use either jmeter.bat on Windows or ./jmeter on Linux. This will open the JMeter GUI.&lt;br /&gt;
&lt;br /&gt;
First step is to go to File -&amp;gt; Open and select the testplan.jmx file you downloaded above. This will open a tree on the left hand side of JMeter. Open the Warm-up site -&amp;gt; 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. &amp;lt;b&amp;gt;Repeat &amp;lt;/b&amp;gt; this for Moodle Test.&lt;br /&gt;
&lt;br /&gt;
Right mouse click on the Test Plan, then Add -&amp;gt; Listener. Choose Aggregate Report so you can follow the run as it happens. Save the changes in your test plan and run it.&lt;br /&gt;
&lt;br /&gt;
==References==&lt;br /&gt;
* [1] [http://jmeter.apache.org/ Apache JMeter homepage]&lt;br /&gt;
* [2] [https://docs.moodle.org/en/Performance_recommendations#Obtain_a_baseline_benchmark Moodle Docs: Performance -&amp;gt; Obtain_a_baseline_benchmark]&lt;br /&gt;
* [3] [https://moodle.org/mod/forum/discuss.php?d=377231 Jmeter or loading script/app to simulate concurrent users taking quizzes] (October 2018)&lt;br /&gt;
* [4]  [https://moodle.org/mod/forum/discuss.php?d=368620 Has anyone successfully run a jmeter test with 1000 users?] (April 2018)&lt;br /&gt;
&lt;br /&gt;
[[Category:Developer tools]]&lt;/div&gt;</summary>
		<author><name>Ratna</name></author>
	</entry>
	<entry>
		<id>https://docs.moodle.org/dev/index.php?title=Load_testing_Moodle_with_JMeter&amp;diff=61604</id>
		<title>Load testing Moodle with JMeter</title>
		<link rel="alternate" type="text/html" href="https://docs.moodle.org/dev/index.php?title=Load_testing_Moodle_with_JMeter&amp;diff=61604"/>
		<updated>2022-01-07T17:35:17Z</updated>

		<summary type="html">&lt;p&gt;Ratna: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;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  &#039;&#039;Make test course&#039;&#039;  and &#039;&#039;Make JMeter test plan&#039;&#039;, both available under &#039;&#039;Site administration &amp;gt; Development&#039;&#039;. 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.&lt;br /&gt;
&lt;br /&gt;
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&#039;t even run them on a separate Moodle instance in the production server: their effect on the DBMS is undocumented.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;h2&amp;gt;Prerequisite&amp;lt;/h2&amp;gt;&lt;br /&gt;
&amp;lt;h3&amp;gt;JMeter installed on your client computer&amp;lt;/h3&amp;gt;&lt;br /&gt;
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 &#039;java -version&#039;. If it doesn&#039;t return a version, first install [https://www.java.com/ Java] on your client. The instructions vary with the operating system.&lt;br /&gt;
&lt;br /&gt;
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.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;h2&amp;gt;A test plan&amp;lt;/h3&amp;gt;&lt;br /&gt;
You can make a test plan from the JMeter client in DIY style. We do not describe that path here, assuming you know JMeter. This page describes how to make a test plan with the script built in to Moodle.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;h3&amp;gt;Make test course&amp;lt;/h3&amp;gt;&lt;br /&gt;
See https://docs.moodle.org/39/en/Test_course_generator&lt;br /&gt;
&lt;br /&gt;
&amp;lt;h3&amp;gt;Make JMeter test plan&amp;lt;/h3&amp;gt;&lt;br /&gt;
See https://docs.moodle.org/39/en/JMeter_test_plan_generator&lt;br /&gt;
&lt;br /&gt;
&amp;lt;h2&amp;gt;Running the test plan on JMeter&amp;lt;/h2&amp;gt;&lt;br /&gt;
To run JMeter open the /bin subdirectory and use either jmeter.bat on Windows or ./jmeter on Linux. This will open the JMeter GUI.&lt;br /&gt;
&lt;br /&gt;
First step is to go to File -&amp;gt; Open and select the testplan.jmx file you downloaded above. This will open a tree on the left hand side of JMeter. Open the Warm-up site -&amp;gt; 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. &amp;lt;b&amp;gt;Repeat &amp;lt;/b&amp;gt; this for Moodle Test.&lt;br /&gt;
&lt;br /&gt;
Right mouse click on the Test Plan, then Add -&amp;gt; Listener. Choose Aggregate Report so you can follow the run as it happens. Save the changes in your test plan and run it.&lt;br /&gt;
&lt;br /&gt;
==References==&lt;br /&gt;
* [1] [http://jmeter.apache.org/ Apache JMeter homepage]&lt;br /&gt;
* [2] [https://docs.moodle.org/en/Performance_recommendations#Obtain_a_baseline_benchmark Moodle Docs: Performance -&amp;gt; Obtain_a_baseline_benchmark]&lt;br /&gt;
* [3] [https://moodle.org/mod/forum/discuss.php?d=377231 Jmeter or loading script/app to simulate concurrent users taking quizzes] (October 2018)&lt;br /&gt;
* [4]  [https://moodle.org/mod/forum/discuss.php?d=368620 Has anyone successfully run a jmeter test with 1000 users?] (April 2018)&lt;br /&gt;
&lt;br /&gt;
[[Category:Developer tools]]&lt;/div&gt;</summary>
		<author><name>Ratna</name></author>
	</entry>
	<entry>
		<id>https://docs.moodle.org/dev/index.php?title=Load_testing_Moodle_with_JMeter&amp;diff=61603</id>
		<title>Load testing Moodle with JMeter</title>
		<link rel="alternate" type="text/html" href="https://docs.moodle.org/dev/index.php?title=Load_testing_Moodle_with_JMeter&amp;diff=61603"/>
		<updated>2022-01-07T17:32:30Z</updated>

		<summary type="html">&lt;p&gt;Ratna: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;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  &#039;&#039;Make test course&#039;&#039;  and &#039;&#039;Make JMeter test plan&#039;&#039;, both available under &#039;&#039;Site administration &amp;gt; Development&#039;&#039;. 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.&lt;br /&gt;
&lt;br /&gt;
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&#039;t even run them on a separate Moodle instance in the production server: their effect on the DBMS is undocumented.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;h2&amp;gt;Prerequisite&amp;lt;/h2&amp;gt;&lt;br /&gt;
&amp;lt;h3&amp;gt;JMeter installed on your client computer&amp;lt;/h3&amp;gt;&lt;br /&gt;
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 &#039;java -version&#039;. If it doesn&#039;t return a version, first install [https://www.java.com/ Java] on your client. The instructions vary with the operating system.&lt;br /&gt;
&lt;br /&gt;
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.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;h2&amp;gt;A test plan&amp;lt;/h3&amp;gt;&lt;br /&gt;
You can make a test plan from the JMeter client in DIY style. We do not describe that path here, assuming you know JMeter. This page describes how to make a test plan with the script built in to Moodle.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;h3&amp;gt;Make test course&amp;lt;/h3&amp;gt;&lt;br /&gt;
(Moved to https://docs.moodle.org/39/en/Test_course_generator)&lt;br /&gt;
&lt;br /&gt;
&amp;lt;h3&amp;gt;Make JMeter test plan&amp;lt;/h3&amp;gt;&lt;br /&gt;
(Moved to https://docs.moodle.org/39/en/JMeter_test_plan_generator)&lt;br /&gt;
&lt;br /&gt;
&amp;lt;h2&amp;gt;Running the test plan on JMeter&amp;lt;/h2&amp;gt;&lt;br /&gt;
To run JMeter open the /bin subdirectory and use either jmeter.bat on Windows or ./jmeter on Linux. This will open the JMeter GUI.&lt;br /&gt;
&lt;br /&gt;
First step is to go to File -&amp;gt; Open and select the testplan.jmx file. This will open a tree on the left hand side of JMeter. &lt;br /&gt;
Open the Warm-up site -&amp;gt; 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. &amp;lt;b&amp;gt;Repeat &amp;lt;/b&amp;gt; this for Moodle Test.&lt;br /&gt;
&lt;br /&gt;
Right mouse click on the Test Plan, then Add -&amp;gt; Listener. I choose Aggregate Report so I can follow the run as it happens. Save the changes in your test plan and run it.&lt;br /&gt;
&lt;br /&gt;
==References==&lt;br /&gt;
* [1] [http://jmeter.apache.org/ Apache JMeter homepage]&lt;br /&gt;
* [2] [https://docs.moodle.org/en/Performance_recommendations#Obtain_a_baseline_benchmark Moodle Docs: Performance -&amp;gt; Obtain_a_baseline_benchmark]&lt;br /&gt;
* [3] [https://moodle.org/mod/forum/discuss.php?d=377231 Jmeter or loading script/app to simulate concurrent users taking quizzes] (October 2018)&lt;br /&gt;
* [4]  [https://moodle.org/mod/forum/discuss.php?d=368620 Has anyone successfully run a jmeter test with 1000 users?] (April 2018)&lt;br /&gt;
&lt;br /&gt;
[[Category:Developer tools]]&lt;/div&gt;</summary>
		<author><name>Ratna</name></author>
	</entry>
	<entry>
		<id>https://docs.moodle.org/dev/index.php?title=Talk:Load_testing_Moodle_with_JMeter&amp;diff=61117</id>
		<title>Talk:Load testing Moodle with JMeter</title>
		<link rel="alternate" type="text/html" href="https://docs.moodle.org/dev/index.php?title=Talk:Load_testing_Moodle_with_JMeter&amp;diff=61117"/>
		<updated>2021-08-23T06:17:28Z</updated>

		<summary type="html">&lt;p&gt;Ratna: Created page with &amp;quot;I have stopped updating this page. The last state is as discussed in the forum https://moodle.org/mod/forum/discuss.php?d=424763.  Please free to extend/correct as necessary.&amp;quot;&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;I have stopped updating this page. The last state is as discussed in the forum https://moodle.org/mod/forum/discuss.php?d=424763.&lt;br /&gt;
&lt;br /&gt;
Please free to extend/correct as necessary.&lt;/div&gt;</summary>
		<author><name>Ratna</name></author>
	</entry>
	<entry>
		<id>https://docs.moodle.org/dev/index.php?title=Load_testing_Moodle_with_JMeter&amp;diff=61116</id>
		<title>Load testing Moodle with JMeter</title>
		<link rel="alternate" type="text/html" href="https://docs.moodle.org/dev/index.php?title=Load_testing_Moodle_with_JMeter&amp;diff=61116"/>
		<updated>2021-08-23T06:13:03Z</updated>

		<summary type="html">&lt;p&gt;Ratna: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;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  &#039;&#039;Make test course&#039;&#039;  and &#039;&#039;Make JMeter test plan&#039;&#039;, both available under &#039;&#039;Site administration &amp;gt; Development&#039;&#039;. 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.&lt;br /&gt;
&lt;br /&gt;
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&#039;t even run them on a separate Moodle instance in the production server: their effect on the DBMS is undocumented.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;h2&amp;gt;Make test course&amp;lt;/h2&amp;gt;&lt;br /&gt;
(Moved to https://docs.moodle.org/39/en/Test_course_generator)&lt;br /&gt;
&lt;br /&gt;
&amp;lt;h2&amp;gt;Make JMeter test plan&amp;lt;/h2&amp;gt;&lt;br /&gt;
(Moved to https://docs.moodle.org/39/en/JMeter_test_plan_generator)&lt;br /&gt;
&lt;br /&gt;
&amp;lt;h2&amp;gt;Running the test plan on JMeter&amp;lt;/h2&amp;gt;&lt;br /&gt;
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 &#039;&lt;br /&gt;
java -version&#039;. If it doesn&#039;t return a version, first install [https://www.java.com/ Java] on your client. The instructions vary with the operating system.&lt;br /&gt;
&lt;br /&gt;
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.&lt;br /&gt;
&lt;br /&gt;
To run JMeter. open the /bin subdirectory and use either jmeter.bat on Windows or ./jmeter on Linux. This will open the JMeter GUI.&lt;br /&gt;
&lt;br /&gt;
First step is to go to File -&amp;gt; Open and select the testplan.jmx file. This will open a tree on the left hand side of JMeter. &lt;br /&gt;
Open the Warm-up site -&amp;gt; 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. &amp;lt;b&amp;gt;Repeat &amp;lt;/b&amp;gt; this for Moodle Test.&lt;br /&gt;
&lt;br /&gt;
Right mouse click on the Test Plan, then Add -&amp;gt; Listener. I choose Aggregate Report so I can follow the run as it happens. Save the changes in your test plan and run it.&lt;br /&gt;
&lt;br /&gt;
==References==&lt;br /&gt;
* [1] [http://jmeter.apache.org/ Apache JMeter homepage]&lt;br /&gt;
* [2] [https://docs.moodle.org/en/Performance_recommendations#Obtain_a_baseline_benchmark Moodle Docs: Performance -&amp;gt; Obtain_a_baseline_benchmark]&lt;br /&gt;
* [3] [https://moodle.org/mod/forum/discuss.php?d=377231 Jmeter or loading script/app to simulate concurrent users taking quizzes] (October 2018)&lt;br /&gt;
* [4]  [https://moodle.org/mod/forum/discuss.php?d=368620 Has anyone successfully run a jmeter test with 1000 users?] (April 2018)&lt;br /&gt;
&lt;br /&gt;
[[Category:Developer tools]]&lt;/div&gt;</summary>
		<author><name>Ratna</name></author>
	</entry>
	<entry>
		<id>https://docs.moodle.org/dev/index.php?title=Load_testing_Moodle_with_JMeter&amp;diff=60512</id>
		<title>Load testing Moodle with JMeter</title>
		<link rel="alternate" type="text/html" href="https://docs.moodle.org/dev/index.php?title=Load_testing_Moodle_with_JMeter&amp;diff=60512"/>
		<updated>2021-07-27T15:10:44Z</updated>

		<summary type="html">&lt;p&gt;Ratna: Moved the content of https://docs.moodle.org/dev/JMeter#Make_JMeter_test_plan to https://docs.moodle.org/39/en/JMeter_test_plan_generator and linked here.&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;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  &#039;&#039;Make test course&#039;&#039;  and &#039;&#039;Make JMeter test plan&#039;&#039;, both available under &#039;&#039;Site administration &amp;gt; Development&#039;&#039;. 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.&lt;br /&gt;
&lt;br /&gt;
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&#039;t even run them on a separate Moodle instance in the production server: their effect on the DBMS is undocumented.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;h2&amp;gt;Make test course&amp;lt;/h2&amp;gt;&lt;br /&gt;
(Moved to https://docs.moodle.org/39/en/Test_course_generator)&lt;br /&gt;
&lt;br /&gt;
&amp;lt;h2&amp;gt;Make JMeter test plan&amp;lt;/h2&amp;gt;&lt;br /&gt;
(Moved to https://docs.moodle.org/39/en/JMeter_test_plan_generator)&lt;br /&gt;
&lt;br /&gt;
&amp;lt;h2&amp;gt;Running the test plan on JMeter&amp;lt;/h2&amp;gt;&lt;br /&gt;
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 &#039;&lt;br /&gt;
java -version&#039;. If it doesn&#039;t return a version, first install [https://www.java.com/ Java] on your client. The instructions vary with the operating system.&lt;br /&gt;
&lt;br /&gt;
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.&lt;br /&gt;
&lt;br /&gt;
To run JMeter. open the /bin subdirectory and use either jmeter.bat on Windows or ./jmeter on Linux. This will open the JMeter GUI.&lt;br /&gt;
&lt;br /&gt;
First step is to go to File -&amp;gt; Open and select the testplan.jmx file. This will open a tree on the left hand side of JMeter. &lt;br /&gt;
Open the Warm-up site -&amp;gt; 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. &amp;lt;b&amp;gt;Repeat &amp;lt;/b&amp;gt; this for Moodle Test.&lt;br /&gt;
&lt;br /&gt;
Right mouse click on the Test Plan, then Add -&amp;gt; Listener. I choose Aggregate Report so I can follow the run as it happens. Save the changes in your test plan and run it.&lt;br /&gt;
&lt;br /&gt;
==References==&lt;br /&gt;
* [1] [http://jmeter.apache.org/ Apache JMeter homepage]&lt;br /&gt;
* [2] [https://docs.moodle.org/311/en/Performance_recommendations#Obtain_a_baseline_benchmark MoodleDocs Performance Obtain_a_baseline_benchmark]&lt;br /&gt;
* [3] [https://moodle.org/mod/forum/discuss.php?d=377231 Jmeter or loading script/app to simulate concurrent users taking quizzes] (October 2018)&lt;br /&gt;
* [4]  [https://moodle.org/mod/forum/discuss.php?d=368620 Has anyone successfully run a jmeter test with 1000 users?] (April 2018)&lt;br /&gt;
&lt;br /&gt;
[[Category:Developer tools]]&lt;/div&gt;</summary>
		<author><name>Ratna</name></author>
	</entry>
	<entry>
		<id>https://docs.moodle.org/dev/index.php?title=Load_testing_Moodle_with_JMeter&amp;diff=60511</id>
		<title>Load testing Moodle with JMeter</title>
		<link rel="alternate" type="text/html" href="https://docs.moodle.org/dev/index.php?title=Load_testing_Moodle_with_JMeter&amp;diff=60511"/>
		<updated>2021-07-27T10:00:58Z</updated>

		<summary type="html">&lt;p&gt;Ratna: Moved https://docs.moodle.org/dev/Load_testing_Moodle_with_JMeter#Make_test_course to https://docs.moodle.org/39/en/Test_course_generator&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;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  &#039;&#039;Make test course&#039;&#039;  and &#039;&#039;Make JMeter test plan&#039;&#039;, both available under &#039;&#039;Site administration &amp;gt; Development&#039;&#039;. 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.&lt;br /&gt;
&lt;br /&gt;
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&#039;t even run them on a separate Moodle instance in the production server: their effect on the DBMS is undocumented.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;h2&amp;gt;Make test course&amp;lt;/h2&amp;gt;&lt;br /&gt;
(Moved to https://docs.moodle.org/39/en/Test_course_generator)&lt;br /&gt;
&lt;br /&gt;
&amp;lt;h2&amp;gt;Make JMeter test plan&amp;lt;/h2&amp;gt;&lt;br /&gt;
This script creates a JMeter test plan file along with the user credentials file. Here too it is necessary to set &#039;&#039;Site administration &amp;gt; Development &amp;gt; Debugging&#039;&#039; to DEVELOPER. Also note that, unlike making the test course, this is a single script. Therefore the PHP max_execution_time need to be at least as long as the time for the whole script, which could be anything from a minute to hours depending on the size of the course you select.&lt;br /&gt;
&lt;br /&gt;
This test plan is designed to work along with Moodle performance comparison [https://github.com/moodlehq/moodle-performance-comparison], which makes it easier to run the test plan in a specific Moodle environment, to gather information about the runs and to compare the results, so you will need to download it and use it&#039;s test_runner.sh script or follow the installation and usage instructions.&lt;br /&gt;
&lt;br /&gt;
You need to set the same password for all the test users by adding the line &amp;quot;$CFG-&amp;gt;tool_generator_users_password = &#039;YOURSECRET&#039;;&amp;quot; to config.php of Moodle. You might want to set &amp;quot;$CFG-&amp;gt;passwordpolicy = 0;&amp;quot; too, in case the proposed user password does not satisfy the password policy of the site. There is no default value for this password to prevent unintended usages of the tool. You need to use the update passwords option in case your course users have other passwords or they were generated by tool_generator but without setting a $CFG-&amp;gt;tool_generator_users_password value.&lt;br /&gt;
&lt;br /&gt;
This script is a part of tool_generator so it works well with the courses generated by the courses and the site generators, it can also be used with any course that contains, at least:&lt;br /&gt;
- Enough enrolled users (depends on the test plan size you select) with the $CFG-&amp;gt;tool_generator_users_password password set&lt;br /&gt;
- A page module instance&lt;br /&gt;
- A forum module instance with at least one discussion and one reply&lt;br /&gt;
&lt;br /&gt;
You have to consider your server&#039;s capacity when running large test plans as the amount to load generated by JMeter can be specially big. The ramp-up period has been adjusted according to the number of threads (users) to reduce this kind of issues but the load is still huge.&lt;br /&gt;
&lt;br /&gt;
Visit  &#039;&#039;Site administration &amp;gt; Development &amp;gt; Make JMeter test plan&#039;&#039;. Under Size of course your have six possibilities: XS (1 user, 5 loops and 1 ramp-up period), S (30 users, 5 loops and 6 ramp-up period), M (100 users, 5 loops and 40 ramp-up period), L (1000 users, 6 loops and 100 ramp-up period), XL (5000 users, 6 loops and 500 ramp-up period) and XXL (1000 users, 7 loops and 800 ramp-up period). As target course select one of the courses created above. Also &#039;&#039;Update course users password&#039;&#039; should be ticked. &lt;br /&gt;
&lt;br /&gt;
Consider that the server resources you will need to make bigger test plans will be accordingly higher.&lt;br /&gt;
&lt;br /&gt;
Once successful you can download a test plan [[File:testplan_timestamp.jmx|testplan_timestamp.jmx]] and a users file [[File:users_timestamp.csv|users_timestamp.csv]] &lt;br /&gt;
&lt;br /&gt;
There is also a PHP CLI version of the script. Run it with --help to see its options:&lt;br /&gt;
&lt;br /&gt;
  $ php admin/tool/generator/cli/maketestplan.php --help&lt;br /&gt;
  Options:&lt;br /&gt;
  -h, --help              Print out this help&lt;br /&gt;
  --shortname             Short name of the test plan&#039;s target course (required)&lt;br /&gt;
  --size                  Size of the test plan to create XS, S, M, L, XL, or XXL (required)&lt;br /&gt;
  --bypasscheck           Bypasses the developer-mode check (be careful!)&lt;br /&gt;
  --updateuserspassword   Updates the target course users password according to $CFG-&amp;gt;tool_generator_users_password&lt;br /&gt;
  &lt;br /&gt;
  * XS (1 Nutzter, 5 Schleifen und 1 Steigerungsrate)&lt;br /&gt;
  * S (30 Nutzter, 5 Schleifen und 6 Steigerungsrate)&lt;br /&gt;
  * M (100 Nutzter, 5 Schleifen und 40 Steigerungsrate)&lt;br /&gt;
  * L (1000 Nutzter, 6 Schleifen und 100 Steigerungsrate)&lt;br /&gt;
  * XL (5000 Nutzter, 6 Schleifen und 500 Steigerungsrate)&lt;br /&gt;
  * XXL (10000 Nutzter, 7 Schleifen und 800 Steigerungsrate)&lt;br /&gt;
   &lt;br /&gt;
Example: &lt;br /&gt;
  $ sudo -u www-data /usr/bin/php admin/tool/generator/cli/maketestplan.php --shortname=&amp;quot;testcourse_12&amp;quot; --size=S&lt;br /&gt;
&lt;br /&gt;
&amp;lt;h2&amp;gt;Running the test plan on JMeter&amp;lt;/h2&amp;gt;&lt;br /&gt;
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 &#039;&lt;br /&gt;
java -version&#039;. If it doesn&#039;t return a version, first install [https://www.java.com/ Java] on your client. The instructions vary with the operating system.&lt;br /&gt;
&lt;br /&gt;
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.&lt;br /&gt;
&lt;br /&gt;
To run JMeter. open the /bin subdirectory and use either jmeter.bat on Windows or ./jmeter on Linux. This will open the JMeter GUI.&lt;br /&gt;
&lt;br /&gt;
First step is to go to File -&amp;gt; Open and select the testplan.jmx file. This will open a tree on the left hand side of JMeter. &lt;br /&gt;
Open the Warm-up site -&amp;gt; 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. &amp;lt;b&amp;gt;Repeat &amp;lt;/b&amp;gt; this for Moodle Test.&lt;br /&gt;
&lt;br /&gt;
Right mouse click on the Test Plan, then Add -&amp;gt; Listener. I choose Aggregate Report so I can follow the run as it happens. Save the changes in your test plan and run it.&lt;br /&gt;
&lt;br /&gt;
==References==&lt;br /&gt;
* [1] [http://jmeter.apache.org/ Apache JMeter homepage]&lt;br /&gt;
* [2] [https://docs.moodle.org/en/Performance MoodleDocs Performance]&lt;br /&gt;
* [3] [https://moodle.org/mod/forum/discuss.php?d=377231 Jmeter or loading script/app to simulate concurrent users takng quizzes] (October 2018)&lt;br /&gt;
* [4]  [https://moodle.org/mod/forum/discuss.php?d=368620 Has anyone successfully run a jmeter test with 1000 users?] (April 2018)&lt;br /&gt;
&lt;br /&gt;
[[Category:Developer tools]]&lt;/div&gt;</summary>
		<author><name>Ratna</name></author>
	</entry>
	<entry>
		<id>https://docs.moodle.org/dev/index.php?title=Load_testing_Moodle_with_JMeter&amp;diff=60441</id>
		<title>Load testing Moodle with JMeter</title>
		<link rel="alternate" type="text/html" href="https://docs.moodle.org/dev/index.php?title=Load_testing_Moodle_with_JMeter&amp;diff=60441"/>
		<updated>2021-07-17T17:43:48Z</updated>

		<summary type="html">&lt;p&gt;Ratna: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;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  &#039;&#039;Make test course&#039;&#039;  and &#039;&#039;Make JMeter test plan&#039;&#039;, both available under &#039;&#039;Site administration &amp;gt; Development&#039;&#039;. 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.&lt;br /&gt;
&lt;br /&gt;
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&#039;t even run them on a separate Moodle instance in the production server: their effect on the DBMS is undocumented.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;h2&amp;gt;Make test course&amp;lt;/h2&amp;gt;&lt;br /&gt;
This tool creates sample courses with many sections, files, various activities and users. These are intended to be used as standardized loads for checking the reliability and performance of various system components under load.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Warning: Courses created using this feature can occupy a large amount of database and filesystem space (tens of gigabytes). You will have to delete those courses (and wait for various cleanup runs) to release the space they consumed.&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Before making a course first you have set the debugging level under &#039;&#039;Site administration &amp;gt; Development &amp;gt; Debugging&#039;&#039; to DEVELOPER. Then go to &#039;&#039;Site administration &amp;gt; Development &amp;gt; Make test course&#039;&#039;. You have a choice amoung the sizes XS, S, M, L, XL and XXL:&lt;br /&gt;
&lt;br /&gt;
[[File:make-a-test-course.png|thumb]]&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Size of course&lt;br /&gt;
! Approx. size &lt;br /&gt;
! No. of assignments&lt;br /&gt;
! No. of pages&lt;br /&gt;
! No. of small files&lt;br /&gt;
! No. of big files&lt;br /&gt;
! No. of sections&lt;br /&gt;
! No. of users&lt;br /&gt;
! No. of forum posts&lt;br /&gt;
! Approx. time to create&lt;br /&gt;
|-&lt;br /&gt;
! XS&lt;br /&gt;
| 10 kB&lt;br /&gt;
| 1&lt;br /&gt;
| 1&lt;br /&gt;
| 1&lt;br /&gt;
| 1&lt;br /&gt;
| 1&lt;br /&gt;
| 1&lt;br /&gt;
| 2&lt;br /&gt;
| 1 sec&lt;br /&gt;
|-&lt;br /&gt;
! S&lt;br /&gt;
| 10 MB&lt;br /&gt;
| 10&lt;br /&gt;
| 50&lt;br /&gt;
| 64&lt;br /&gt;
| 2&lt;br /&gt;
| 10&lt;br /&gt;
| 100&lt;br /&gt;
| 20&lt;br /&gt;
| 30 sec&lt;br /&gt;
|-&lt;br /&gt;
! M&lt;br /&gt;
| 100 MB&lt;br /&gt;
| 100&lt;br /&gt;
| 200&lt;br /&gt;
| 128&lt;br /&gt;
| 5&lt;br /&gt;
| 100&lt;br /&gt;
| 1,000&lt;br /&gt;
| 500&lt;br /&gt;
| 2 min&lt;br /&gt;
|-&lt;br /&gt;
! L&lt;br /&gt;
| 1 GB&lt;br /&gt;
| 500&lt;br /&gt;
| 1,000&lt;br /&gt;
| 1,024&lt;br /&gt;
| 10&lt;br /&gt;
| 500&lt;br /&gt;
| 10,000&lt;br /&gt;
| 5,000&lt;br /&gt;
| 30 min&lt;br /&gt;
|-&lt;br /&gt;
! XL&lt;br /&gt;
| 10 GB&lt;br /&gt;
| 1,000&lt;br /&gt;
| 5,000&lt;br /&gt;
| 16,384&lt;br /&gt;
| 10&lt;br /&gt;
| 1,000&lt;br /&gt;
| 50,000&lt;br /&gt;
| 10,000&lt;br /&gt;
| 2 hours&lt;br /&gt;
|-&lt;br /&gt;
! XXL&lt;br /&gt;
| 20 GB&lt;br /&gt;
| 2,000&lt;br /&gt;
| 10,000&lt;br /&gt;
| 32,768&lt;br /&gt;
| 10&lt;br /&gt;
| 2,000&lt;br /&gt;
| 100,000&lt;br /&gt;
| 20,000&lt;br /&gt;
| 4 hours&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Sample output (from a course of type M):&lt;br /&gt;
  Creating course&lt;br /&gt;
  Creating [Course name]&lt;br /&gt;
  Creating assignments (100): . . . . . . . . . . . . done (12.7s)&lt;br /&gt;
  Creating pages (200): . . done (1.5s)&lt;br /&gt;
  Creating small files (128): done (0.4s)&lt;br /&gt;
  Creating big files (5): . done (1.3s)&lt;br /&gt;
  Checking user accounts (1000)&lt;br /&gt;
  Creating user accounts (1 - 1000): . . . . . . . . done (8.7s)&lt;br /&gt;
  Enrolling users into course (1000): . . . . . . done (5.7s)&lt;br /&gt;
  Creating forum (500 posts): . . done (1.7s)&lt;br /&gt;
  Course completed (32.2s)&lt;br /&gt;
&lt;br /&gt;
Pl. note that bigger courses take longer to be created - the biggest up to 4 hours on a decent server. Your server may run out of space or time out if it can&#039;t handle the size you selected.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;h2&amp;gt;Make JMeter test plan&amp;lt;/h2&amp;gt;&lt;br /&gt;
This script creates a JMeter test plan file along with the user credentials file. Here too it is necessary to set &#039;&#039;Site administration &amp;gt; Development &amp;gt; Debugging&#039;&#039; to DEVELOPER. Also note that, unlike making the test course, this is a single script. Therefore the PHP max_execution_time need to be at least as long as the time for the whole script, which could be anything from a minute to hours depending on the size of the course you select.&lt;br /&gt;
&lt;br /&gt;
This test plan is designed to work along with Moodle performance comparison [https://github.com/moodlehq/moodle-performance-comparison], which makes it easier to run the test plan in a specific Moodle environment, to gather information about the runs and to compare the results, so you will need to download it and use it&#039;s test_runner.sh script or follow the installation and usage instructions.&lt;br /&gt;
&lt;br /&gt;
You need to set the same password for all the test users by adding the line &amp;quot;$CFG-&amp;gt;tool_generator_users_password = &#039;YOURSECRET&#039;;&amp;quot; to config.php of Moodle. You might want to set &amp;quot;$CFG-&amp;gt;passwordpolicy = 0;&amp;quot; too, in case the proposed user password does not satisfy the password policy of the site. There is no default value for this password to prevent unintended usages of the tool. You need to use the update passwords option in case your course users have other passwords or they were generated by tool_generator but without setting a $CFG-&amp;gt;tool_generator_users_password value.&lt;br /&gt;
&lt;br /&gt;
This script is a part of tool_generator so it works well with the courses generated by the courses and the site generators, it can also be used with any course that contains, at least:&lt;br /&gt;
- Enough enrolled users (depends on the test plan size you select) with the $CFG-&amp;gt;tool_generator_users_password password set&lt;br /&gt;
- A page module instance&lt;br /&gt;
- A forum module instance with at least one discussion and one reply&lt;br /&gt;
&lt;br /&gt;
You have to consider your server&#039;s capacity when running large test plans as the amount to load generated by JMeter can be specially big. The ramp-up period has been adjusted according to the number of threads (users) to reduce this kind of issues but the load is still huge.&lt;br /&gt;
&lt;br /&gt;
Visit  &#039;&#039;Site administration &amp;gt; Development &amp;gt; Make JMeter test plan&#039;&#039;. Under Size of course your have six possibilities: XS (1 user, 5 loops and 1 ramp-up period), S (30 users, 5 loops and 6 ramp-up period), M (100 users, 5 loops and 40 ramp-up period), L (1000 users, 6 loops and 100 ramp-up period), XL (5000 users, 6 loops and 500 ramp-up period) and XXL (1000 users, 7 loops and 800 ramp-up period). As target course select one of the courses created above. Also &#039;&#039;Update course users password&#039;&#039; should be ticked. &lt;br /&gt;
&lt;br /&gt;
Consider that the server resources you will need to make bigger test plans will be accordingly higher.&lt;br /&gt;
&lt;br /&gt;
Once successful you can download a test plan [[File:testplan_timestamp.jmx|testplan_timestamp.jmx]] and a users file [[File:users_timestamp.csv|users_timestamp.csv]] &lt;br /&gt;
&lt;br /&gt;
There is also a PHP CLI version of the script. Run it with --help to see its options:&lt;br /&gt;
&lt;br /&gt;
  $ php admin/tool/generator/cli/maketestplan.php --help&lt;br /&gt;
  Options:&lt;br /&gt;
  -h, --help              Print out this help&lt;br /&gt;
  --shortname             Short name of the test plan&#039;s target course (required)&lt;br /&gt;
  --size                  Size of the test plan to create XS, S, M, L, XL, or XXL (required)&lt;br /&gt;
  --bypasscheck           Bypasses the developer-mode check (be careful!)&lt;br /&gt;
  --updateuserspassword   Updates the target course users password according to $CFG-&amp;gt;tool_generator_users_password&lt;br /&gt;
  &lt;br /&gt;
  * XS (1 Nutzter, 5 Schleifen und 1 Steigerungsrate)&lt;br /&gt;
  * S (30 Nutzter, 5 Schleifen und 6 Steigerungsrate)&lt;br /&gt;
  * M (100 Nutzter, 5 Schleifen und 40 Steigerungsrate)&lt;br /&gt;
  * L (1000 Nutzter, 6 Schleifen und 100 Steigerungsrate)&lt;br /&gt;
  * XL (5000 Nutzter, 6 Schleifen und 500 Steigerungsrate)&lt;br /&gt;
  * XXL (10000 Nutzter, 7 Schleifen und 800 Steigerungsrate)&lt;br /&gt;
   &lt;br /&gt;
Example: &lt;br /&gt;
  $ sudo -u www-data /usr/bin/php admin/tool/generator/cli/maketestplan.php --shortname=&amp;quot;testcourse_12&amp;quot; --size=S&lt;br /&gt;
&lt;br /&gt;
&amp;lt;h2&amp;gt;Running the test plan on JMeter&amp;lt;/h2&amp;gt;&lt;br /&gt;
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 &#039;&lt;br /&gt;
java -version&#039;. If it doesn&#039;t return a version, first install [https://www.java.com/ Java] on your client. The instructions vary with the operating system.&lt;br /&gt;
&lt;br /&gt;
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.&lt;br /&gt;
&lt;br /&gt;
To run JMeter. open the /bin subdirectory and use either jmeter.bat on Windows or ./jmeter on Linux. This will open the JMeter GUI.&lt;br /&gt;
&lt;br /&gt;
First step is to go to File -&amp;gt; Open and select the testplan.jmx file. This will open a tree on the left hand side of JMeter. &lt;br /&gt;
Open the Warm-up site -&amp;gt; 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. &amp;lt;b&amp;gt;Repeat &amp;lt;/b&amp;gt; this for Moodle Test.&lt;br /&gt;
&lt;br /&gt;
Right mouse click on the Test Plan, then Add -&amp;gt; Listener. I choose Aggregate Report so I can follow the run as it happens. Save the changes in your test plan and run it.&lt;br /&gt;
&lt;br /&gt;
==References==&lt;br /&gt;
* [1] [http://jmeter.apache.org/ Apache JMeter homepage]&lt;br /&gt;
* [2] [https://docs.moodle.org/en/Performance MoodleDocs Performance]&lt;br /&gt;
* [3] [https://moodle.org/mod/forum/discuss.php?d=377231 Jmeter or loading script/app to simulate concurrent users takng quizzes] (October 2018)&lt;br /&gt;
* [4]  [https://moodle.org/mod/forum/discuss.php?d=368620 Has anyone successfully run a jmeter test with 1000 users?] (April 2018)&lt;br /&gt;
&lt;br /&gt;
[[Category:Developer tools]]&lt;/div&gt;</summary>
		<author><name>Ratna</name></author>
	</entry>
	<entry>
		<id>https://docs.moodle.org/dev/index.php?title=Load_testing_Moodle_with_JMeter&amp;diff=60440</id>
		<title>Load testing Moodle with JMeter</title>
		<link rel="alternate" type="text/html" href="https://docs.moodle.org/dev/index.php?title=Load_testing_Moodle_with_JMeter&amp;diff=60440"/>
		<updated>2021-07-17T09:15:32Z</updated>

		<summary type="html">&lt;p&gt;Ratna: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Being the original server load testing tool, 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  &#039;&#039;Make test course&#039;&#039;  and &#039;&#039;Make JMeter test plan&#039;&#039;, both available under &#039;&#039;Site administration &amp;gt; Development&#039;&#039;. 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.&lt;br /&gt;
&lt;br /&gt;
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&#039;t even run them on a separate Moodle instance in the production server: their effect on the DBMS is undocumented.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;h2&amp;gt;Make test course&amp;lt;/h2&amp;gt;&lt;br /&gt;
This tool creates sample courses with many sections, files, various activities and users. These are intended to be used as standardized loads for checking the reliability and performance of various system components under load.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Warning: Courses created using this feature can occupy a large amount of database and filesystem space (tens of gigabytes). You will have to delete those courses (and wait for various cleanup runs) to release the space they consumed.&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Before making a course first you have set the debugging level under &#039;&#039;Site administration &amp;gt; Development &amp;gt; Debugging&#039;&#039; to DEVELOPER. Then go to &#039;&#039;Site administration &amp;gt; Development &amp;gt; Make test course&#039;&#039;. You have a choice amoung the sizes XS, S, M, L, XL and XXL:&lt;br /&gt;
&lt;br /&gt;
[[File:make-a-test-course.png|thumb]]&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Size of course&lt;br /&gt;
! Approx. size &lt;br /&gt;
! No. of assignments&lt;br /&gt;
! No. of pages&lt;br /&gt;
! No. of small files&lt;br /&gt;
! No. of big files&lt;br /&gt;
! No. of sections&lt;br /&gt;
! No. of users&lt;br /&gt;
! No. of forum posts&lt;br /&gt;
! Time to create, estimated&lt;br /&gt;
! Time to create, actual*&lt;br /&gt;
|-&lt;br /&gt;
! XS&lt;br /&gt;
| 10 kB&lt;br /&gt;
| 1&lt;br /&gt;
| 1&lt;br /&gt;
| 1&lt;br /&gt;
| 1&lt;br /&gt;
| 1&lt;br /&gt;
| 1&lt;br /&gt;
| 2&lt;br /&gt;
| 1 sec&lt;br /&gt;
| 0.6 sec&lt;br /&gt;
|-&lt;br /&gt;
! S&lt;br /&gt;
| 10 MB&lt;br /&gt;
| 10&lt;br /&gt;
| 50&lt;br /&gt;
| 64&lt;br /&gt;
| 2&lt;br /&gt;
| 10&lt;br /&gt;
| 100&lt;br /&gt;
| 20&lt;br /&gt;
| 30 sec&lt;br /&gt;
| 12.1 sec&lt;br /&gt;
|-&lt;br /&gt;
! M&lt;br /&gt;
| 100 MB&lt;br /&gt;
| 100&lt;br /&gt;
| 200&lt;br /&gt;
| 128&lt;br /&gt;
| 5&lt;br /&gt;
| 100&lt;br /&gt;
| 1,000&lt;br /&gt;
| 500&lt;br /&gt;
| 2 min&lt;br /&gt;
| 2 min 0.1 sec&lt;br /&gt;
|-&lt;br /&gt;
! L&lt;br /&gt;
| 1 GB&lt;br /&gt;
| 500&lt;br /&gt;
| 1,000&lt;br /&gt;
| 1,024&lt;br /&gt;
| 10&lt;br /&gt;
| 500&lt;br /&gt;
| 10,000&lt;br /&gt;
| 5,000&lt;br /&gt;
| 30 min&lt;br /&gt;
| 22 min 36 sec&lt;br /&gt;
|-&lt;br /&gt;
! XL&lt;br /&gt;
| 10 GB&lt;br /&gt;
| 1,000&lt;br /&gt;
| 5,000&lt;br /&gt;
| 16,384&lt;br /&gt;
| 10&lt;br /&gt;
| 1,000&lt;br /&gt;
| 50,000&lt;br /&gt;
| 10,000&lt;br /&gt;
| 2 hours&lt;br /&gt;
| ?&lt;br /&gt;
|-&lt;br /&gt;
! XXL&lt;br /&gt;
| 20 GB&lt;br /&gt;
| 2,000&lt;br /&gt;
| 10,000&lt;br /&gt;
| 32,768&lt;br /&gt;
| 10&lt;br /&gt;
| 2,000&lt;br /&gt;
| 100,000&lt;br /&gt;
| 20,000&lt;br /&gt;
| 4 hours&lt;br /&gt;
| ?&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
) In a VPS 8 vCPU, 32 GB RAM, 240 GB SSD storage&lt;br /&gt;
Sample output (from a course of type M):&lt;br /&gt;
  Creating course&lt;br /&gt;
  Creating [Course name]&lt;br /&gt;
  Creating assignments (100): . . . . . . . . . . . . done (12.7s)&lt;br /&gt;
  Creating pages (200): . . done (1.5s)&lt;br /&gt;
  Creating small files (128): done (0.4s)&lt;br /&gt;
  Creating big files (5): . done (1.3s)&lt;br /&gt;
  Checking user accounts (1000)&lt;br /&gt;
  Creating user accounts (1 - 1000): . . . . . . . . done (8.7s)&lt;br /&gt;
  Enrolling users into course (1000): . . . . . . done (5.7s)&lt;br /&gt;
  Creating forum (500 posts): . . done (1.7s)&lt;br /&gt;
  Course completed (32.2s)&lt;br /&gt;
&lt;br /&gt;
Pl. note that bigger courses take longer to be created - up to 4 hours on a decent server. Your server may time out if it can&#039;t handle the size you selected.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;h2&amp;gt;Make JMeter test plan&amp;lt;/h2&amp;gt;&lt;br /&gt;
This tool creates a JMeter test plan file along with the user credentials file. Here too it is necessary to set &#039;&#039;Site administration &amp;gt; Development &amp;gt; Debugging&#039;&#039; to DEVELOPER. Also note that, unlike making the test course, this is a single script. To the PHP max_execution_time need to be at least as long as the time for the whole script, which could be anything from a minute to hours depending on the size of the course you select.&lt;br /&gt;
&lt;br /&gt;
This test plan is designed to work along with [https://github.com/moodlehq/moodle-performance-comparison Moodle performance comparison], which makes easier to run the test plan in a specific Moodle environment, gathers information about the runs and compares the results, so you will need to download it and use it&#039;s test_runner.sh script or follow the installation and usage instructions.&lt;br /&gt;
&lt;br /&gt;
You need to set the same password for all the test users by adding the line &amp;quot;$CFG-&amp;gt;tool_generator_users_password = &#039;moodle&#039;;&amp;quot; to config.php of Moodle. You might want to set &amp;quot;$CFG-&amp;gt;passwordpolicy = 0;&amp;quot; too in case the proposed user password conflicts with the password policy of the site.&lt;br /&gt;
&lt;br /&gt;
There is no default value for this password to prevent unintended usages of the tool. You need to use the update passwords option in case your course users have other passwords or they were generated by tool_generator but without setting a $CFG-&amp;gt;tool_generator_users_password value.&lt;br /&gt;
&lt;br /&gt;
It is part of tool_generator so it works well with the courses generated by the courses and the site generators, it can also be used with any course that contains, at least:&lt;br /&gt;
- Enough enrolled users (depends on the test plan size you select) with the password reset to &#039;moodle&#039;&lt;br /&gt;
- A page module instance&lt;br /&gt;
- A forum module instance with at least one discussion and one reply&lt;br /&gt;
&lt;br /&gt;
You might want to consider your servers capacity when running large test plans as the amount to load generated by JMeter can be specially big. The ramp up period has been adjusted according to the number of threads (users) to reduce this kind of issues but the load is still huge.&lt;br /&gt;
&lt;br /&gt;
Visit  &#039;&#039;Site administration &amp;gt; Development &amp;gt; Make JMeter test plan&#039;&#039;. Under Size of course your have six possibilities: XS (1 user, 5 loops and 1 rampup period), S (30 users, 5 loops and 6 rampup period), M (100 users, 5 loops and 40 rampup period), L (1000 users, 6 loops and 100 rampup period), XL (5000 users, 6 loops and 500 rampup period) and XXL (1000 users, 7 loops and 800 rampup period). As target course select one of the courses created above. Also &#039;&#039;Update course users password&#039;&#039; should be ticked. &lt;br /&gt;
&lt;br /&gt;
Once successful you can download a test plan [[File:testplan_timestamp.jmx|testplan_timestamp.jmx]] and a users file [[File:users_timestamp.csv|users_timestamp.csv]] &lt;br /&gt;
&lt;br /&gt;
  $ php admin/tool/generator/cli/maketestplan.php --help&lt;br /&gt;
  Options:&lt;br /&gt;
  -h, --help              Print out this help&lt;br /&gt;
  --shortname             Shortname of the test plan&#039;s target course (required)&lt;br /&gt;
  --size                  Size of the test plan to create XS, S, M, L, XL, or XXL (required)&lt;br /&gt;
  --bypasscheck           Bypasses the developer-mode check (be careful!)&lt;br /&gt;
  --updateuserspassword   Updates the target course users password according to $CFG-&amp;gt;tool_generator_users_password&lt;br /&gt;
  &lt;br /&gt;
  * XS (1 Nutzter, 5 Schleifen und 1 Steigerungsrate)&lt;br /&gt;
  * S (30 Nutzter, 5 Schleifen und 6 Steigerungsrate)&lt;br /&gt;
  * M (100 Nutzter, 5 Schleifen und 40 Steigerungsrate)&lt;br /&gt;
  * L (1000 Nutzter, 6 Schleifen und 100 Steigerungsrate)&lt;br /&gt;
  * XL (5000 Nutzter, 6 Schleifen und 500 Steigerungsrate)&lt;br /&gt;
  * XXL (10000 Nutzter, 7 Schleifen und 800 Steigerungsrate)&lt;br /&gt;
  &lt;br /&gt;
  Consider that, the server resources you will need to run the test plan will be higher as the test plan size is higher.&lt;br /&gt;
  &lt;br /&gt;
  Example from Moodle root directory: &lt;br /&gt;
  $ sudo -u www-data /usr/bin/php admin/tool/generator/cli/maketestplan.php --shortname=&amp;quot;testcourse_12&amp;quot; --size=S&lt;br /&gt;
&lt;br /&gt;
&amp;lt;h2&amp;gt;Running the test plan on JMeter&amp;lt;/h2&amp;gt;&lt;br /&gt;
JMeter is a Java application so it can run on Windows, Mac, or Linux. It can be run on the command line on a server  but you should also install a graphical user interface version on your desktop. You can check if Java is installed by opening a console and entering:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;php&amp;quot;&amp;gt;&lt;br /&gt;
java -version&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
If it doesn&#039;t return a version, go to the [https://www.java.com/ Java] site and install.&lt;br /&gt;
&lt;br /&gt;
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.&lt;br /&gt;
&lt;br /&gt;
To run JMeter. open the /bin subdirectory and use either jmeter.bat on Windows or ./jmeter on Linux. This will open the JMeter GUI.&lt;br /&gt;
&lt;br /&gt;
First step is to go to File -&amp;gt; Open and select the testplan.jmx file. This will open a tree on the left hand side of JMeter. &lt;br /&gt;
Open the Warm-up site -&amp;gt; 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. &amp;lt;b&amp;gt;Repeat &amp;lt;/b&amp;gt; this for Moodle Test.&lt;br /&gt;
&lt;br /&gt;
Right mouse click on the Test Plan, then Add -&amp;gt; Listener. I choose Aggregate Report so I can follow the run as it happens. Save the changes in your test plan and run it.&lt;br /&gt;
&lt;br /&gt;
==References==&lt;br /&gt;
* [1] [http://jmeter.apache.org/ Apache JMeter homepage]&lt;br /&gt;
* [2] [https://docs.moodle.org/en/Performance MoodleDocs Performance]&lt;br /&gt;
* [3] [https://moodle.org/mod/forum/discuss.php?d=377231 Jmeter or loading script/app to simulate concurrent users takng quizzes] (October 2018)&lt;br /&gt;
* [4]  [https://moodle.org/mod/forum/discuss.php?d=368620 Has anyone successfully run a jmeter test with 1000 users?] (April 2018)&lt;br /&gt;
&lt;br /&gt;
[[Category:Developer tools]]&lt;/div&gt;</summary>
		<author><name>Ratna</name></author>
	</entry>
	<entry>
		<id>https://docs.moodle.org/dev/index.php?title=Load_testing_Moodle_with_JMeter&amp;diff=59132</id>
		<title>Load testing Moodle with JMeter</title>
		<link rel="alternate" type="text/html" href="https://docs.moodle.org/dev/index.php?title=Load_testing_Moodle_with_JMeter&amp;diff=59132"/>
		<updated>2021-07-08T19:21:35Z</updated>

		<summary type="html">&lt;p&gt;Ratna: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Being the original server load testing tool, introduced in 1998(!), JMeter [1] has always been the number one load testing resp. performance measuring tool for Moodle. Around the release 2.5, Moodle developers made the testing process vastly simpler by adding many scripts. The topic of this page are the two scripts  &#039;&#039;Make test course&#039;&#039;  and &#039;&#039;Make JMeter test plan&#039;&#039;, both available under &#039;&#039;Site administration &amp;gt; Development&#039;&#039;. 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.&lt;br /&gt;
&lt;br /&gt;
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&#039;t even run them on a separate Moodle instance in the production server: their effect on the DBMS is undocumented.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;h2&amp;gt;Make test course&amp;lt;/h2&amp;gt;&lt;br /&gt;
This tool creates sample courses with many sections, files, various activities and also include users. These are intended to provide a standardized measure for checking the reliability and performance of various system components (such as backup and restore).&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Warning: Courses created using this feature can occupy a large amount of database and filesystem space (tens of gigabytes). You will need to delete the courses (and wait for various cleanup runs) to release this space again.&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
To create such a course first you have set the debugging level under &#039;&#039;Site administration &amp;gt; Development &amp;gt; Debugging&#039;&#039; to DEVELOPER. Then go to &#039;&#039;Site administration &amp;gt; Development &amp;gt; Make test course&#039;&#039;. You have a choice amoung sizes XS, S, M, L, XL and XXL:&lt;br /&gt;
&lt;br /&gt;
[[File:make-a-test-course.png|thumb]]&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Size of course&lt;br /&gt;
! Approx. size &lt;br /&gt;
! No. of assignments&lt;br /&gt;
! No. of pages&lt;br /&gt;
! No. of small files&lt;br /&gt;
! No. of big files&lt;br /&gt;
! No. of sections&lt;br /&gt;
! No. of users&lt;br /&gt;
! No. of forum posts&lt;br /&gt;
! Approx. time to create&lt;br /&gt;
|-&lt;br /&gt;
! XS&lt;br /&gt;
| 10 kB&lt;br /&gt;
| 1&lt;br /&gt;
| 1&lt;br /&gt;
| 1&lt;br /&gt;
| 1&lt;br /&gt;
| 1&lt;br /&gt;
| 1&lt;br /&gt;
| 2&lt;br /&gt;
| 1 sec&lt;br /&gt;
|-&lt;br /&gt;
! S&lt;br /&gt;
| 10 MB&lt;br /&gt;
| 10&lt;br /&gt;
| 50&lt;br /&gt;
| 64&lt;br /&gt;
| 2&lt;br /&gt;
| 10&lt;br /&gt;
| 100&lt;br /&gt;
| 20&lt;br /&gt;
| 30 sec&lt;br /&gt;
|-&lt;br /&gt;
! M&lt;br /&gt;
| 100&amp;amp;nbsp;MB&lt;br /&gt;
| 100&lt;br /&gt;
| 200&lt;br /&gt;
| 128&lt;br /&gt;
| 5&lt;br /&gt;
| 100&lt;br /&gt;
| 1,000&lt;br /&gt;
| 500&lt;br /&gt;
| 2 min&lt;br /&gt;
|-&lt;br /&gt;
! L&lt;br /&gt;
| 1 GB&lt;br /&gt;
| 500&lt;br /&gt;
| 1,000&lt;br /&gt;
| 1,024&lt;br /&gt;
| 10&lt;br /&gt;
| 500&lt;br /&gt;
| 10,000&lt;br /&gt;
| 5,000&lt;br /&gt;
| 30 min&lt;br /&gt;
|-&lt;br /&gt;
! XL&lt;br /&gt;
| 10 GB&lt;br /&gt;
| 1,000&lt;br /&gt;
| 5,000&lt;br /&gt;
| 16,384&lt;br /&gt;
| 10&lt;br /&gt;
| 1,000&lt;br /&gt;
| 50,000&lt;br /&gt;
| 10,000&lt;br /&gt;
| 2 hours&lt;br /&gt;
|-&lt;br /&gt;
! XXL&lt;br /&gt;
| 20 GB&lt;br /&gt;
| 2,000&lt;br /&gt;
| 10,000&lt;br /&gt;
| 32,768&lt;br /&gt;
| 10&lt;br /&gt;
| 2,000&lt;br /&gt;
| 100,000&lt;br /&gt;
| 20,000&lt;br /&gt;
| 4 hours&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Sample output (from a course of type M):&lt;br /&gt;
  Creating course&lt;br /&gt;
  Creating [Course name]&lt;br /&gt;
  Creating assignments (100): . . . . . . . . . . . . done (12.7s)&lt;br /&gt;
  Creating pages (200): . . done (1.5s)&lt;br /&gt;
  Creating small files (128): done (0.4s)&lt;br /&gt;
  Creating big files (5): . done (1.3s)&lt;br /&gt;
  Checking user accounts (1000)&lt;br /&gt;
  Creating user accounts (1 - 1000): . . . . . . . . done (8.7s)&lt;br /&gt;
  Enrolling users into course (1000): . . . . . . done (5.7s)&lt;br /&gt;
  Creating forum (500 posts): . . done (1.7s)&lt;br /&gt;
  Course completed (32.2s)&lt;br /&gt;
&lt;br /&gt;
Pl. note that bigger courses take longer to be created - up to 4 hours on a decent server. Your server may time out if it can&#039;t handle the size you selected.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;h2&amp;gt;Make JMeter test plan&amp;lt;/h2&amp;gt;&lt;br /&gt;
This tool creates a JMeter test plan file along with the user credentials file. Here too it is necessary to set &#039;&#039;Site administration &amp;gt; Development &amp;gt; Debugging&#039;&#039; to DEVELOPER. Also note that, unlike making the test course, this is a single script. To the PHP max_execution_time need to be at least as long as the time for the whole script, which could be anything from a minute to hours depending on the size of the course you select.&lt;br /&gt;
&lt;br /&gt;
This test plan is designed to work along with [https://github.com/moodlehq/moodle-performance-comparison Moodle performance comparison], which makes easier to run the test plan in a specific Moodle environment, gathers information about the runs and compares the results, so you will need to download it and use it&#039;s test_runner.sh script or follow the installation and usage instructions.&lt;br /&gt;
&lt;br /&gt;
You need to set the same password for all the test users by adding the line &amp;quot;$CFG-&amp;gt;tool_generator_users_password = &#039;moodle&#039;;&amp;quot; to config.php of Moodle. You might want to set &amp;quot;$CFG-&amp;gt;passwordpolicy = 0;&amp;quot; too in case the proposed user password conflicts with the password policy of the site.&lt;br /&gt;
&lt;br /&gt;
There is no default value for this password to prevent unintended usages of the tool. You need to use the update passwords option in case your course users have other passwords or they were generated by tool_generator but without setting a $CFG-&amp;gt;tool_generator_users_password value.&lt;br /&gt;
&lt;br /&gt;
It is part of tool_generator so it works well with the courses generated by the courses and the site generators, it can also be used with any course that contains, at least:&lt;br /&gt;
- Enough enrolled users (depends on the test plan size you select) with the password reset to &#039;moodle&#039;&lt;br /&gt;
- A page module instance&lt;br /&gt;
- A forum module instance with at least one discussion and one reply&lt;br /&gt;
&lt;br /&gt;
You might want to consider your servers capacity when running large test plans as the amount to load generated by JMeter can be specially big. The ramp up period has been adjusted according to the number of threads (users) to reduce this kind of issues but the load is still huge.&lt;br /&gt;
&lt;br /&gt;
Visit  &#039;&#039;Site administration &amp;gt; Development &amp;gt; Make JMeter test plan&#039;&#039;. Under Size of course your have six possibilities: XS (1 user, 5 loops and 1 rampup period), S (30 users, 5 loops and 6 rampup period), M (100 users, 5 loops and 40 rampup period), L (1000 users, 6 loops and 100 rampup period), XL (5000 users, 6 loops and 500 rampup period) and XXL (1000 users, 7 loops and 800 rampup period). As target course select one of the courses created above. Also &#039;&#039;Update course users password&#039;&#039; should be ticked. &lt;br /&gt;
&lt;br /&gt;
Once successful you can download a test plan [[File:testplan_timestamp.jmx|testplan_timestamp.jmx]] and a users file [[File:users_timestamp.csv|users_timestamp.csv]] &lt;br /&gt;
&lt;br /&gt;
  $ php admin/tool/generator/cli/maketestplan.php --help&lt;br /&gt;
  Options:&lt;br /&gt;
  -h, --help              Print out this help&lt;br /&gt;
  --shortname             Shortname of the test plan&#039;s target course (required)&lt;br /&gt;
  --size                  Size of the test plan to create XS, S, M, L, XL, or XXL (required)&lt;br /&gt;
  --bypasscheck           Bypasses the developer-mode check (be careful!)&lt;br /&gt;
  --updateuserspassword   Updates the target course users password according to $CFG-&amp;gt;tool_generator_users_password&lt;br /&gt;
  &lt;br /&gt;
  * XS (1 Nutzter, 5 Schleifen und 1 Steigerungsrate)&lt;br /&gt;
  * S (30 Nutzter, 5 Schleifen und 6 Steigerungsrate)&lt;br /&gt;
  * M (100 Nutzter, 5 Schleifen und 40 Steigerungsrate)&lt;br /&gt;
  * L (1000 Nutzter, 6 Schleifen und 100 Steigerungsrate)&lt;br /&gt;
  * XL (5000 Nutzter, 6 Schleifen und 500 Steigerungsrate)&lt;br /&gt;
  * XXL (10000 Nutzter, 7 Schleifen und 800 Steigerungsrate)&lt;br /&gt;
  &lt;br /&gt;
  Consider that, the server resources you will need to run the test plan will be higher as the test plan size is higher.&lt;br /&gt;
  &lt;br /&gt;
  Example from Moodle root directory: &lt;br /&gt;
  $ sudo -u www-data /usr/bin/php admin/tool/generator/cli/maketestplan.php --shortname=&amp;quot;testcourse_12&amp;quot; --size=S&lt;br /&gt;
&lt;br /&gt;
&amp;lt;h2&amp;gt;Running the test plan on JMeter&amp;lt;/h2&amp;gt;&lt;br /&gt;
JMeter is a Java application so it can run on Windows, Mac, or Linux. It can be run on the command line on a server  but you should also install a graphical user interface version on your desktop. You can check if Java is installed by opening a console and entering:&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
java -version&amp;lt;/code&amp;gt;&lt;br /&gt;
If it doesn&#039;t return a version, go to the [https://www.java.com/ Java] site and install.&lt;br /&gt;
&lt;br /&gt;
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.&lt;br /&gt;
&lt;br /&gt;
To run JMeter. open the /bin subdirectory and use either jmeter.bat on Windows or ./jmeter on Linux. This will open the JMeter GUI.&lt;br /&gt;
&lt;br /&gt;
First step is to go to File -&amp;gt; Open and select the testplan.jmx file. This will open a tree on the left hand side of JMeter. &lt;br /&gt;
Open the Warm-up site -&amp;gt; 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. &amp;lt;b&amp;gt;Repeat &amp;lt;/b&amp;gt; this for Moodle Test.&lt;br /&gt;
&lt;br /&gt;
Right mouse click on the Test Plan, then Add -&amp;gt; Listener. I choose Aggregate Report so I can follow the run as it happens. Save the changes in your test plan and run it.&lt;br /&gt;
&lt;br /&gt;
==References==&lt;br /&gt;
* [1] [http://jmeter.apache.org/ Apache JMeter homepage]&lt;br /&gt;
* [2] [https://docs.moodle.org/en/Performance MoodleDocs Performance]&lt;br /&gt;
* [3] [https://moodle.org/mod/forum/discuss.php?d=377231 Jmeter or loading script/app to simulate concurrent users takng quizzes] (October 2018)&lt;br /&gt;
* [4]  [https://moodle.org/mod/forum/discuss.php?d=368620 Has anyone successfully run a jmeter test with 1000 users?] (April 2018)&lt;br /&gt;
&lt;br /&gt;
[[Category:Developer tools]]&lt;/div&gt;</summary>
		<author><name>Ratna</name></author>
	</entry>
	<entry>
		<id>https://docs.moodle.org/dev/index.php?title=Load_testing_Moodle_with_JMeter&amp;diff=59123</id>
		<title>Load testing Moodle with JMeter</title>
		<link rel="alternate" type="text/html" href="https://docs.moodle.org/dev/index.php?title=Load_testing_Moodle_with_JMeter&amp;diff=59123"/>
		<updated>2021-07-03T18:18:39Z</updated>

		<summary type="html">&lt;p&gt;Ratna: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Being the original server load testing tool, introduced in 1998(!), JMeter [1] has always been the number one load testing resp. performance measuring tool for Moodle. Around the release 2.5, Moodle developers made the testing process vastly simpler by adding many scripts. The topic of this page are the two scripts  &#039;&#039;Make test course&#039;&#039;  and &#039;&#039;Make JMeter test plan&#039;&#039;, both available under &#039;&#039;Site administration &amp;gt; Development&#039;&#039;. 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.&lt;br /&gt;
&lt;br /&gt;
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&#039;t even run them on a separate Moodle instance in the production server: their effect on the DBMS is undocumented.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;h2&amp;gt;Make test course&amp;lt;/h2&amp;gt;&lt;br /&gt;
This tool creates sample courses with many sections, files, various activities and also include users. These are intended to provide a standardized measure for checking the reliability and performance of various system components (such as backup and restore).&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Warning: Courses created using this feature can occupy a large amount of database and filesystem space (tens of gigabytes). You will need to delete the courses (and wait for various cleanup runs) to release this space again.&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
To create such a course first you have set the debugging level under &#039;&#039;Site administration &amp;gt; Development &amp;gt; Debugging&#039;&#039; to DEVELOPER. Then go to &#039;&#039;Site administration &amp;gt; Development &amp;gt; Make test course&#039;&#039;. You have a choice amoung sizes XS, S, M, L, XL and XXL:&lt;br /&gt;
&lt;br /&gt;
[[File:make-a-test-course.png|thumb]]&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Size of course&lt;br /&gt;
! Approx. size &lt;br /&gt;
! No. of assignments&lt;br /&gt;
! No. of pages&lt;br /&gt;
! No. of small files&lt;br /&gt;
! No. of big files&lt;br /&gt;
! No. of sections&lt;br /&gt;
! No. of users&lt;br /&gt;
! No. of forum posts&lt;br /&gt;
! Approx. time to create&lt;br /&gt;
|-&lt;br /&gt;
! XS&lt;br /&gt;
| 10 kB&lt;br /&gt;
| 1&lt;br /&gt;
| 1&lt;br /&gt;
| 1&lt;br /&gt;
| 1&lt;br /&gt;
| 1&lt;br /&gt;
| 1&lt;br /&gt;
| 2&lt;br /&gt;
| 1 sec&lt;br /&gt;
|-&lt;br /&gt;
! S&lt;br /&gt;
| 10 MB&lt;br /&gt;
| 10&lt;br /&gt;
| 50&lt;br /&gt;
| 64&lt;br /&gt;
| 2&lt;br /&gt;
| 10&lt;br /&gt;
| 100&lt;br /&gt;
| 20&lt;br /&gt;
| 30 sec&lt;br /&gt;
|-&lt;br /&gt;
! M&lt;br /&gt;
| 100&amp;amp;nbsp;MB&lt;br /&gt;
| 100&lt;br /&gt;
| 200&lt;br /&gt;
| 128&lt;br /&gt;
| 5&lt;br /&gt;
| 100&lt;br /&gt;
| 1,000&lt;br /&gt;
| 500&lt;br /&gt;
| 2 min&lt;br /&gt;
|-&lt;br /&gt;
! L&lt;br /&gt;
| 1 GB&lt;br /&gt;
| 500&lt;br /&gt;
| 1,000&lt;br /&gt;
| 1,024&lt;br /&gt;
| 10&lt;br /&gt;
| 500&lt;br /&gt;
| 10,000&lt;br /&gt;
| 5,000&lt;br /&gt;
| 30 min&lt;br /&gt;
|-&lt;br /&gt;
! XL&lt;br /&gt;
| 10 GB&lt;br /&gt;
| 1,000&lt;br /&gt;
| 5,000&lt;br /&gt;
| 16,384&lt;br /&gt;
| 10&lt;br /&gt;
| 1,000&lt;br /&gt;
| 50,000&lt;br /&gt;
| 10,000&lt;br /&gt;
| 2 hours&lt;br /&gt;
|-&lt;br /&gt;
! XXL&lt;br /&gt;
| 20 GB&lt;br /&gt;
| 2,000&lt;br /&gt;
| 10,000&lt;br /&gt;
| 32,768&lt;br /&gt;
| 10&lt;br /&gt;
| 2,000&lt;br /&gt;
| 100,000&lt;br /&gt;
| 20,000&lt;br /&gt;
| 4 hours&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Sample output (from a course of type M):&lt;br /&gt;
  Creating course&lt;br /&gt;
  Creating [Course name]&lt;br /&gt;
  Creating assignments (100): . . . . . . . . . . . . done (12.7s)&lt;br /&gt;
  Creating pages (200): . . done (1.5s)&lt;br /&gt;
  Creating small files (128): done (0.4s)&lt;br /&gt;
  Creating big files (5): . done (1.3s)&lt;br /&gt;
  Checking user accounts (1000)&lt;br /&gt;
  Creating user accounts (1 - 1000): . . . . . . . . done (8.7s)&lt;br /&gt;
  Enrolling users into course (1000): . . . . . . done (5.7s)&lt;br /&gt;
  Creating forum (500 posts): . . done (1.7s)&lt;br /&gt;
  Course completed (32.2s)&lt;br /&gt;
&lt;br /&gt;
Pl. note that bigger courses take longer to be created - up to 4 hours on a decent server. Your server may time out if it can&#039;t handle the size you selected.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;h2&amp;gt;Make JMeter test plan&amp;lt;/h2&amp;gt;&lt;br /&gt;
This tool creates a JMeter test plan file along with the user credentials file. Here too it is necessary to set &#039;&#039;Site administration &amp;gt; Development &amp;gt; Debugging&#039;&#039; to DEVELOPER. Also note that, unlike making the test course, this is a single script. To the PHP max_execution_time need to be at least as long as the time for the whole script, which could be anything from a minute to hours depending on the size of the course you select.&lt;br /&gt;
&lt;br /&gt;
This test plan is designed to work along with [https://github.com/moodlehq/moodle-performance-comparison Moodle performance comparison], which makes easier to run the test plan in a specific Moodle environment, gathers information about the runs and compares the results, so you will need to download it and use it&#039;s test_runner.sh script or follow the installation and usage instructions.&lt;br /&gt;
&lt;br /&gt;
You need to set the same password for all the test users by adding the linke &#039;&#039;$CFG-&amp;gt;tool_generator_users_password = &#039;moodle&#039;;&#039; to config.php of Moodle. You might want to set &#039;$CFG-&amp;gt;passwordpolicy = 0;&#039; too in case the proposed user password conflicts with the password policy of the site.&lt;br /&gt;
&lt;br /&gt;
There is no default value for this password to prevent unintended usages of the tool. You need to use the update passwords option in case your course users have other passwords or they were generated by tool_generator but without setting a $CFG-&amp;gt;tool_generator_users_password value.&lt;br /&gt;
&lt;br /&gt;
It is part of tool_generator so it works well with the courses generated by the courses and the site generators, it can also be used with any course that contains, at least:&lt;br /&gt;
- Enough enrolled users (depends on the test plan size you select) with the password reset to &#039;moodle&#039;&lt;br /&gt;
- A page module instance&lt;br /&gt;
- A forum module instance with at least one discussion and one reply&lt;br /&gt;
&lt;br /&gt;
You might want to consider your servers capacity when running large test plans as the amount to load generated by JMeter can be specially big. The ramp up period has been adjusted according to the number of threads (users) to reduce this kind of issues but the load is still huge.&lt;br /&gt;
&lt;br /&gt;
Visit  &#039;&#039;Site administration &amp;gt; Development &amp;gt; Make JMeter test plan&#039;&#039;. Under Size of course your have six possibilities: XS (1 user, 5 loops and 1 rampup period), S (30 users, 5 loops and 6 rampup period), M (100 users, 5 loops and 40 rampup period), L (1000 users, 6 loops and 100 rampup period), XL (5000 users, 6 loops and 500 rampup period) and XXL (1000 users, 7 loops and 800 rampup period). As target course select one of the courses created above. Also &#039;&#039;Update course users password&#039;&#039; should be ticked. &lt;br /&gt;
&lt;br /&gt;
Once successful you can download a test plan [[File:testplan_timestamp.jmx|testplan_timestamp.jmx]] and a users file [[File:users_timestamp.csv|users_timestamp.csv]] &lt;br /&gt;
&lt;br /&gt;
  $ php admin/tool/generator/cli/maketestplan.php --help&lt;br /&gt;
  Options:&lt;br /&gt;
  -h, --help              Print out this help&lt;br /&gt;
  --shortname             Shortname of the test plan&#039;s target course (required)&lt;br /&gt;
  --size                  Size of the test plan to create XS, S, M, L, XL, or XXL (required)&lt;br /&gt;
  --bypasscheck           Bypasses the developer-mode check (be careful!)&lt;br /&gt;
  --updateuserspassword   Updates the target course users password according to $CFG-&amp;gt;tool_generator_users_password&lt;br /&gt;
  &lt;br /&gt;
  * XS (1 Nutzter, 5 Schleifen und 1 Steigerungsrate)&lt;br /&gt;
  * S (30 Nutzter, 5 Schleifen und 6 Steigerungsrate)&lt;br /&gt;
  * M (100 Nutzter, 5 Schleifen und 40 Steigerungsrate)&lt;br /&gt;
  * L (1000 Nutzter, 6 Schleifen und 100 Steigerungsrate)&lt;br /&gt;
  * XL (5000 Nutzter, 6 Schleifen und 500 Steigerungsrate)&lt;br /&gt;
  * XXL (10000 Nutzter, 7 Schleifen und 800 Steigerungsrate)&lt;br /&gt;
  &lt;br /&gt;
  Consider that, the server resources you will need to run the test plan will be higher as the test plan size is higher.&lt;br /&gt;
  &lt;br /&gt;
  Example from Moodle root directory: &lt;br /&gt;
  $ sudo -u www-data /usr/bin/php admin/tool/generator/cli/maketestplan.php --shortname=&amp;quot;testcourse_12&amp;quot; --size=S&lt;br /&gt;
&lt;br /&gt;
&amp;lt;h2&amp;gt;Running the test plan on JMeter&amp;lt;/h2&amp;gt;&lt;br /&gt;
JMeter is a Java application so it can run on Windows, Mac, or Linux. It can be run on the command line on a server  but you should also install a graphical user interface version on your desktop. You can check if Java is installed by opening a console and entering:&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
java -version&amp;lt;/code&amp;gt;&lt;br /&gt;
If it doesn&#039;t return a version, go to the [https://www.java.com/ Java] site and install.&lt;br /&gt;
&lt;br /&gt;
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.&lt;br /&gt;
&lt;br /&gt;
To run JMeter. open the /bin subdirectory and use either jmeter.bat on Windows or ./jmeter on Linux. This will open the JMeter GUI.&lt;br /&gt;
&lt;br /&gt;
First step is to go to File -&amp;gt; Open and select the testplan.jmx file. This will open a tree on the left hand side of JMeter. &lt;br /&gt;
Open the Warm-up site -&amp;gt; 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. &amp;lt;b&amp;gt;Repeat &amp;lt;/b&amp;gt; this for Moodle Test.&lt;br /&gt;
&lt;br /&gt;
Right mouse click on the Test Plan, then Add -&amp;gt; Listener. I choose Aggregate Report so I can follow the run as it happens. Save the changes in your test plan and run it.&lt;br /&gt;
&lt;br /&gt;
==References==&lt;br /&gt;
* [1] [http://jmeter.apache.org/ Apache JMeter homepage]&lt;br /&gt;
* [2] [https://docs.moodle.org/en/Performance MoodleDocs Performance]&lt;br /&gt;
* [3] [https://moodle.org/mod/forum/discuss.php?d=377231 Jmeter or loading script/app to simulate concurrent users takng quizzes] (October 2018)&lt;br /&gt;
* [4]  [https://moodle.org/mod/forum/discuss.php?d=368620 Has anyone successfully run a jmeter test with 1000 users?] (April 2018)&lt;br /&gt;
&lt;br /&gt;
[[Category:Developer tools]]&lt;/div&gt;</summary>
		<author><name>Ratna</name></author>
	</entry>
	<entry>
		<id>https://docs.moodle.org/dev/index.php?title=Load_testing_Moodle_with_JMeter&amp;diff=59122</id>
		<title>Load testing Moodle with JMeter</title>
		<link rel="alternate" type="text/html" href="https://docs.moodle.org/dev/index.php?title=Load_testing_Moodle_with_JMeter&amp;diff=59122"/>
		<updated>2021-07-03T07:50:36Z</updated>

		<summary type="html">&lt;p&gt;Ratna: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Being the original server load testing tool, introduced in 1998(!), JMeter [1] has always been the number one load testing resp. performance measuring tool for Moodle. Around the release 2.5, Moodle developers made the testing process vastly simpler by adding many scripts. The topic of this page are the two scripts  &#039;&#039;Make test course&#039;&#039;  and &#039;&#039;Make JMeter test plan&#039;&#039;, both available under &#039;&#039;Site administration &amp;gt; Development&#039;&#039;. 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.&lt;br /&gt;
&lt;br /&gt;
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&#039;t even run them on a separate Moodle instance in the production server: their effect on the DBMS is undocumented.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;h2&amp;gt;Make test course&amp;lt;/h2&amp;gt;&lt;br /&gt;
This tool creates sample courses with many sections, files, various activities and also include users. These are intended to provide a standardized measure for checking the reliability and performance of various system components (such as backup and restore).&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Warning: Courses created using this feature can occupy a large amount of database and filesystem space (tens of gigabytes). You will need to delete the courses (and wait for various cleanup runs) to release this space again.&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
To create such a course first you have set the debugging level under &#039;&#039;Site administration &amp;gt; Development &amp;gt; Debugging&#039;&#039; to DEVELOPER. Then go to &#039;&#039;Site administration &amp;gt; Development &amp;gt; Make test course&#039;&#039;. You have a choice amoung sizes XS, S, M, L, XL and XXL:&lt;br /&gt;
&lt;br /&gt;
[[File:make-a-test-course.png|thumb]]&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Size of course&lt;br /&gt;
! Approx. size &lt;br /&gt;
! No. of assignments&lt;br /&gt;
! No. of pages&lt;br /&gt;
! No. of small files&lt;br /&gt;
! No. of big files&lt;br /&gt;
! No. of sections&lt;br /&gt;
! No. of users&lt;br /&gt;
! No. of forum posts&lt;br /&gt;
! Approx. time to create&lt;br /&gt;
|-&lt;br /&gt;
! XS&lt;br /&gt;
| 10 kB&lt;br /&gt;
| 1&lt;br /&gt;
| 1&lt;br /&gt;
| 1&lt;br /&gt;
| 1&lt;br /&gt;
| 1&lt;br /&gt;
| 1&lt;br /&gt;
| 2&lt;br /&gt;
| 1 sec&lt;br /&gt;
|-&lt;br /&gt;
! S&lt;br /&gt;
| 10 MB&lt;br /&gt;
| 10&lt;br /&gt;
| 50&lt;br /&gt;
| 64&lt;br /&gt;
| 2&lt;br /&gt;
| 10&lt;br /&gt;
| 100&lt;br /&gt;
| 20&lt;br /&gt;
| 30 sec&lt;br /&gt;
|-&lt;br /&gt;
! M&lt;br /&gt;
| 100&amp;amp;nbsp;MB&lt;br /&gt;
| 100&lt;br /&gt;
| 200&lt;br /&gt;
| 128&lt;br /&gt;
| 5&lt;br /&gt;
| 100&lt;br /&gt;
| 1,000&lt;br /&gt;
| 500&lt;br /&gt;
| 2 min&lt;br /&gt;
|-&lt;br /&gt;
! L&lt;br /&gt;
| 1 GB&lt;br /&gt;
| 500&lt;br /&gt;
| 1,000&lt;br /&gt;
| 1,024&lt;br /&gt;
| 10&lt;br /&gt;
| 500&lt;br /&gt;
| 10,000&lt;br /&gt;
| 5,000&lt;br /&gt;
| 30 min&lt;br /&gt;
|-&lt;br /&gt;
! XL&lt;br /&gt;
| 10 GB&lt;br /&gt;
| Assignments&lt;br /&gt;
| Pages&lt;br /&gt;
| Small files&lt;br /&gt;
| Big files&lt;br /&gt;
| Sections&lt;br /&gt;
| 100,000&lt;br /&gt;
| Forum posts&lt;br /&gt;
| 2 hours&lt;br /&gt;
|-&lt;br /&gt;
! XXL&lt;br /&gt;
| 20 GB&lt;br /&gt;
| Assignments&lt;br /&gt;
| Pages&lt;br /&gt;
| Small files&lt;br /&gt;
| Big files&lt;br /&gt;
| Sections&lt;br /&gt;
| 1,000,000&lt;br /&gt;
| Forum posts&lt;br /&gt;
| 4 hours&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Sample output (from a course of type M):&lt;br /&gt;
  Creating course&lt;br /&gt;
  Creating [Course name]&lt;br /&gt;
  Creating assignments (100): . . . . . . . . . . . . done (12.7s)&lt;br /&gt;
  Creating pages (200): . . done (1.5s)&lt;br /&gt;
  Creating small files (128): done (0.4s)&lt;br /&gt;
  Creating big files (5): . done (1.3s)&lt;br /&gt;
  Checking user accounts (1000)&lt;br /&gt;
  Creating user accounts (1 - 1000): . . . . . . . . done (8.7s)&lt;br /&gt;
  Enrolling users into course (1000): . . . . . . done (5.7s)&lt;br /&gt;
  Creating forum (500 posts): . . done (1.7s)&lt;br /&gt;
  Course completed (32.2s)&lt;br /&gt;
&lt;br /&gt;
Pl. note that bigger courses take longer to be created - up to 4 hours on a decent server. Your server may time out if it can&#039;t handle the size you selected.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;h2&amp;gt;Make JMeter test plan&amp;lt;/h2&amp;gt;&lt;br /&gt;
This tool creates a JMeter test plan file along with the user credentials file. Here too it is necessary to set &#039;&#039;Site administration &amp;gt; Development &amp;gt; Debugging&#039;&#039; to DEVELOPER. Also note that, unlike making the test course, this is a single script. To the PHP max_execution_time need to be at least as long as the time for the whole script, which could be anything from a minute to hours depending on the size of the course you select.&lt;br /&gt;
&lt;br /&gt;
This test plan is designed to work along with [https://github.com/moodlehq/moodle-performance-comparison Moodle performance comparison], which makes easier to run the test plan in a specific Moodle environment, gathers information about the runs and compares the results, so you will need to download it and use it&#039;s test_runner.sh script or follow the installation and usage instructions.&lt;br /&gt;
&lt;br /&gt;
You need to set the same password for all the test users by adding the linke &#039;&#039;$CFG-&amp;gt;tool_generator_users_password = &#039;moodle&#039;;&#039; to config.php of Moodle. You might want to set &#039;$CFG-&amp;gt;passwordpolicy = 0;&#039; too in case the proposed user password conflicts with the password policy of the site.&lt;br /&gt;
&lt;br /&gt;
There is no default value for this password to prevent unintended usages of the tool. You need to use the update passwords option in case your course users have other passwords or they were generated by tool_generator but without setting a $CFG-&amp;gt;tool_generator_users_password value.&lt;br /&gt;
&lt;br /&gt;
It is part of tool_generator so it works well with the courses generated by the courses and the site generators, it can also be used with any course that contains, at least:&lt;br /&gt;
- Enough enrolled users (depends on the test plan size you select) with the password reset to &#039;moodle&#039;&lt;br /&gt;
- A page module instance&lt;br /&gt;
- A forum module instance with at least one discussion and one reply&lt;br /&gt;
&lt;br /&gt;
You might want to consider your servers capacity when running large test plans as the amount to load generated by JMeter can be specially big. The ramp up period has been adjusted according to the number of threads (users) to reduce this kind of issues but the load is still huge.&lt;br /&gt;
&lt;br /&gt;
Visit  &#039;&#039;Site administration &amp;gt; Development &amp;gt; Make JMeter test plan&#039;&#039;. Under Size of course your have six possibilities: XS (1 user, 5 loops and 1 rampup period), S (30 users, 5 loops and 6 rampup period), M (100 users, 5 loops and 40 rampup period), L (1000 users, 6 loops and 100 rampup period), XL (5000 users, 6 loops and 500 rampup period) and XXL (1000 users, 7 loops and 800 rampup period). As target course select one of the courses created above. Also &#039;&#039;Update course users password&#039;&#039; should be ticked. &lt;br /&gt;
&lt;br /&gt;
Once successful you can download a test plan [[File:testplan_timestamp.jmx|testplan_timestamp.jmx]] and a users file [[File:users_timestamp.csv|users_timestamp.csv]] &lt;br /&gt;
&lt;br /&gt;
  $ php admin/tool/generator/cli/maketestplan.php --help&lt;br /&gt;
  Options:&lt;br /&gt;
  -h, --help              Print out this help&lt;br /&gt;
  --shortname             Shortname of the test plan&#039;s target course (required)&lt;br /&gt;
  --size                  Size of the test plan to create XS, S, M, L, XL, or XXL (required)&lt;br /&gt;
  --bypasscheck           Bypasses the developer-mode check (be careful!)&lt;br /&gt;
  --updateuserspassword   Updates the target course users password according to $CFG-&amp;gt;tool_generator_users_password&lt;br /&gt;
  &lt;br /&gt;
  * XS (1 Nutzter, 5 Schleifen und 1 Steigerungsrate)&lt;br /&gt;
  * S (30 Nutzter, 5 Schleifen und 6 Steigerungsrate)&lt;br /&gt;
  * M (100 Nutzter, 5 Schleifen und 40 Steigerungsrate)&lt;br /&gt;
  * L (1000 Nutzter, 6 Schleifen und 100 Steigerungsrate)&lt;br /&gt;
  * XL (5000 Nutzter, 6 Schleifen und 500 Steigerungsrate)&lt;br /&gt;
  * XXL (10000 Nutzter, 7 Schleifen und 800 Steigerungsrate)&lt;br /&gt;
  &lt;br /&gt;
  Consider that, the server resources you will need to run the test plan will be higher as the test plan size is higher.&lt;br /&gt;
  &lt;br /&gt;
  Example from Moodle root directory: &lt;br /&gt;
  $ sudo -u www-data /usr/bin/php admin/tool/generator/cli/maketestplan.php --shortname=&amp;quot;testcourse_12&amp;quot; --size=S&lt;br /&gt;
&lt;br /&gt;
&amp;lt;h2&amp;gt;Running the test plan on JMeter&amp;lt;/h2&amp;gt;&lt;br /&gt;
JMeter is a Java application so it can run on Windows, Mac, or Linux. It can be run on the command line on a server  but you should also install a graphical user interface version on your desktop. You can check if Java is installed by opening a console and entering:&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
java -version&amp;lt;/code&amp;gt;&lt;br /&gt;
If it doesn&#039;t return a version, go to the [https://www.java.com/ Java] site and install.&lt;br /&gt;
&lt;br /&gt;
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.&lt;br /&gt;
&lt;br /&gt;
To run JMeter. open the /bin subdirectory and use either jmeter.bat on Windows or ./jmeter on Linux. This will open the JMeter GUI.&lt;br /&gt;
&lt;br /&gt;
First step is to go to File -&amp;gt; Open and select the testplan.jmx file. This will open a tree on the left hand side of JMeter. &lt;br /&gt;
Open the Warm-up site -&amp;gt; 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. &amp;lt;b&amp;gt;Repeat &amp;lt;/b&amp;gt; this for Moodle Test.&lt;br /&gt;
&lt;br /&gt;
Right mouse click on the Test Plan, then Add -&amp;gt; Listener. I choose Aggregate Report so I can follow the run as it happens. Save the changes in your test plan and run it.&lt;br /&gt;
&lt;br /&gt;
==References==&lt;br /&gt;
* [1] [http://jmeter.apache.org/ Apache JMeter homepage]&lt;br /&gt;
* [2] [https://docs.moodle.org/en/Performance MoodleDocs Performance]&lt;br /&gt;
* [3] [https://moodle.org/mod/forum/discuss.php?d=377231 Jmeter or loading script/app to simulate concurrent users takng quizzes] (October 2018)&lt;br /&gt;
* [4]  [https://moodle.org/mod/forum/discuss.php?d=368620 Has anyone successfully run a jmeter test with 1000 users?] (April 2018)&lt;br /&gt;
&lt;br /&gt;
[[Category:Developer tools]]&lt;/div&gt;</summary>
		<author><name>Ratna</name></author>
	</entry>
	<entry>
		<id>https://docs.moodle.org/dev/index.php?title=Load_testing_Moodle_with_JMeter&amp;diff=59121</id>
		<title>Load testing Moodle with JMeter</title>
		<link rel="alternate" type="text/html" href="https://docs.moodle.org/dev/index.php?title=Load_testing_Moodle_with_JMeter&amp;diff=59121"/>
		<updated>2021-07-03T07:28:41Z</updated>

		<summary type="html">&lt;p&gt;Ratna: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Being the original server load testing tool, introduced in 1998(!), [http://jmeter.apache.org/ Apache JMeter] has always been the number one load testing resp. performance measuring tool for Moodle. Around the release 2.5, Moodle made the testing process vastly simpler through two built-in scripts,  &#039;&#039;Make test course&#039;&#039;  and &#039;&#039;Make JMeter test plan&#039;&#039;, both available under &#039;&#039;Site administration &amp;gt; Development&#039;&#039;. Together with the set of add-ons [https://github.com/moodlehq/moodle-performance-comparison Moodle performance comparison] they build a full set of load testing tools. This document is about using the aforementioned two built-in scripts.&lt;br /&gt;
&lt;br /&gt;
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&#039;t even run them on a separate Moodle instance in the production server: their effect on the DBMS is undocumented.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;h2&amp;gt;Make test course&amp;lt;/h2&amp;gt;&lt;br /&gt;
This tool creates test courses that include many users, sections, files and various activities. This is intended to provide a standardized measure for checking the reliability and performance of various system components (such as backup and restore).&lt;br /&gt;
&lt;br /&gt;
Warning: Courses created using this feature can occupy a large amount of database and filesystem space (tens of gigabytes). You will need to delete the courses (and wait for various cleanup runs) to release this space again.&lt;br /&gt;
&lt;br /&gt;
Once you have set the debugging level under &#039;&#039;Site administration &amp;gt; Development &amp;gt; Debugging&#039;&#039; to DEVELOPER, visit &#039;&#039;Site administration &amp;gt; Development &amp;gt; Make test course&#039;&#039;. You have the choice between types XS, S, M, L, XL and XXL:&lt;br /&gt;
&lt;br /&gt;
[[File:make-a-test-course.png|thumb]]&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Size of course&lt;br /&gt;
! Approx. size &lt;br /&gt;
! No. of assignments&lt;br /&gt;
! No. of pages&lt;br /&gt;
! No. of small files&lt;br /&gt;
! No. of big files&lt;br /&gt;
! No. of sections&lt;br /&gt;
! No. of users&lt;br /&gt;
! No. of forum posts&lt;br /&gt;
! Approx. time to create&lt;br /&gt;
|-&lt;br /&gt;
! XS&lt;br /&gt;
| 10 kB&lt;br /&gt;
| 1&lt;br /&gt;
| 1&lt;br /&gt;
| 1&lt;br /&gt;
| 1&lt;br /&gt;
| 1&lt;br /&gt;
| 1&lt;br /&gt;
| 2&lt;br /&gt;
| 1 sec&lt;br /&gt;
|-&lt;br /&gt;
! S&lt;br /&gt;
| 10 MB&lt;br /&gt;
| 10&lt;br /&gt;
| 50&lt;br /&gt;
| 64&lt;br /&gt;
| 2&lt;br /&gt;
| 10&lt;br /&gt;
| 100&lt;br /&gt;
| 20&lt;br /&gt;
| 30 sec&lt;br /&gt;
|-&lt;br /&gt;
! M&lt;br /&gt;
| 100&amp;amp;nbsp;MB&lt;br /&gt;
| 100&lt;br /&gt;
| 200&lt;br /&gt;
| 128&lt;br /&gt;
| 5&lt;br /&gt;
| 100&lt;br /&gt;
| 1,000&lt;br /&gt;
| 500&lt;br /&gt;
| 2 min&lt;br /&gt;
|-&lt;br /&gt;
! L&lt;br /&gt;
| 1 GB&lt;br /&gt;
| 500&lt;br /&gt;
| 1,000&lt;br /&gt;
| 1,024&lt;br /&gt;
| 10&lt;br /&gt;
| 500&lt;br /&gt;
| 10,000&lt;br /&gt;
| 5,000&lt;br /&gt;
| 30 min&lt;br /&gt;
|-&lt;br /&gt;
! XL&lt;br /&gt;
| 10 GB&lt;br /&gt;
| Assignments&lt;br /&gt;
| Pages&lt;br /&gt;
| Small files&lt;br /&gt;
| Big files&lt;br /&gt;
| Sections&lt;br /&gt;
| 100,000&lt;br /&gt;
| Forum posts&lt;br /&gt;
| 2 hours&lt;br /&gt;
|-&lt;br /&gt;
! XXL&lt;br /&gt;
| 20 GB&lt;br /&gt;
| Assignments&lt;br /&gt;
| Pages&lt;br /&gt;
| Small files&lt;br /&gt;
| Big files&lt;br /&gt;
| Sections&lt;br /&gt;
| 1,000,000&lt;br /&gt;
| Forum posts&lt;br /&gt;
| 4 hours&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Sample output (from a course of type M):&lt;br /&gt;
  Creating course&lt;br /&gt;
  Creating [Course name]&lt;br /&gt;
  Creating assignments (100): . . . . . . . . . . . . done (12.7s)&lt;br /&gt;
  Creating pages (200): . . done (1.5s)&lt;br /&gt;
  Creating small files (128): done (0.4s)&lt;br /&gt;
  Creating big files (5): . done (1.3s)&lt;br /&gt;
  Checking user accounts (1000)&lt;br /&gt;
  Creating user accounts (1 - 1000): . . . . . . . . done (8.7s)&lt;br /&gt;
  Enrolling users into course (1000): . . . . . . done (5.7s)&lt;br /&gt;
  Creating forum (500 posts): . . done (1.7s)&lt;br /&gt;
  Course completed (32.2s)&lt;br /&gt;
&lt;br /&gt;
Pl. note that bigger courses take longer to be created - up to 4 hours on a decent server. Your server may time out if it can&#039;t handle the size you selected.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;h2&amp;gt;Make JMeter test plan&amp;lt;/h2&amp;gt;&lt;br /&gt;
This tool creates a JMeter test plan file along with the user credentials file. Here too it is necessary to set &#039;&#039;Site administration &amp;gt; Development &amp;gt; Debugging&#039;&#039; to DEVELOPER. Also note that, unlike making the test course, this is a single script. To the PHP max_execution_time need to be at least as long as the time for the whole script, which could be anything from a minute to hours depending on the size of the course you select.&lt;br /&gt;
&lt;br /&gt;
This test plan is designed to work along with [https://github.com/moodlehq/moodle-performance-comparison Moodle performance comparison], which makes easier to run the test plan in a specific Moodle environment, gathers information about the runs and compares the results, so you will need to download it and use it&#039;s test_runner.sh script or follow the installation and usage instructions.&lt;br /&gt;
&lt;br /&gt;
You need to set the same password for all the test users by adding the linke &#039;&#039;$CFG-&amp;gt;tool_generator_users_password = &#039;moodle&#039;;&#039; to config.php of Moodle. You might want to set &#039;$CFG-&amp;gt;passwordpolicy = 0;&#039; too in case the proposed user password conflicts with the password policy of the site.&lt;br /&gt;
&lt;br /&gt;
There is no default value for this password to prevent unintended usages of the tool. You need to use the update passwords option in case your course users have other passwords or they were generated by tool_generator but without setting a $CFG-&amp;gt;tool_generator_users_password value.&lt;br /&gt;
&lt;br /&gt;
It is part of tool_generator so it works well with the courses generated by the courses and the site generators, it can also be used with any course that contains, at least:&lt;br /&gt;
- Enough enrolled users (depends on the test plan size you select) with the password reset to &#039;moodle&#039;&lt;br /&gt;
- A page module instance&lt;br /&gt;
- A forum module instance with at least one discussion and one reply&lt;br /&gt;
&lt;br /&gt;
You might want to consider your servers capacity when running large test plans as the amount to load generated by JMeter can be specially big. The ramp up period has been adjusted according to the number of threads (users) to reduce this kind of issues but the load is still huge.&lt;br /&gt;
&lt;br /&gt;
Visit  &#039;&#039;Site administration &amp;gt; Development &amp;gt; Make JMeter test plan&#039;&#039;. Under Size of course your have six possibilities: XS (1 user, 5 loops and 1 rampup period), S (30 users, 5 loops and 6 rampup period), M (100 users, 5 loops and 40 rampup period), L (1000 users, 6 loops and 100 rampup period), XL (5000 users, 6 loops and 500 rampup period) and XXL (1000 users, 7 loops and 800 rampup period). As target course select one of the courses created above. Also &#039;&#039;Update course users password&#039;&#039; should be ticked. &lt;br /&gt;
&lt;br /&gt;
Once successful you can download a test plan [[File:testplan_timestamp.jmx|testplan_timestamp.jmx]] and a users file [[File:users_timestamp.csv|users_timestamp.csv]] &lt;br /&gt;
&lt;br /&gt;
  $ php admin/tool/generator/cli/maketestplan.php --help&lt;br /&gt;
  Options:&lt;br /&gt;
  -h, --help              Print out this help&lt;br /&gt;
  --shortname             Shortname of the test plan&#039;s target course (required)&lt;br /&gt;
  --size                  Size of the test plan to create XS, S, M, L, XL, or XXL (required)&lt;br /&gt;
  --bypasscheck           Bypasses the developer-mode check (be careful!)&lt;br /&gt;
  --updateuserspassword   Updates the target course users password according to $CFG-&amp;gt;tool_generator_users_password&lt;br /&gt;
  &lt;br /&gt;
  * XS (1 Nutzter, 5 Schleifen und 1 Steigerungsrate)&lt;br /&gt;
  * S (30 Nutzter, 5 Schleifen und 6 Steigerungsrate)&lt;br /&gt;
  * M (100 Nutzter, 5 Schleifen und 40 Steigerungsrate)&lt;br /&gt;
  * L (1000 Nutzter, 6 Schleifen und 100 Steigerungsrate)&lt;br /&gt;
  * XL (5000 Nutzter, 6 Schleifen und 500 Steigerungsrate)&lt;br /&gt;
  * XXL (10000 Nutzter, 7 Schleifen und 800 Steigerungsrate)&lt;br /&gt;
  &lt;br /&gt;
  Consider that, the server resources you will need to run the test plan will be higher as the test plan size is higher.&lt;br /&gt;
  &lt;br /&gt;
  Example from Moodle root directory: &lt;br /&gt;
  $ sudo -u www-data /usr/bin/php admin/tool/generator/cli/maketestplan.php --shortname=&amp;quot;testcourse_12&amp;quot; --size=S&lt;br /&gt;
&lt;br /&gt;
&amp;lt;h2&amp;gt;Running the test plan on JMeter&amp;lt;/h2&amp;gt;&lt;br /&gt;
JMeter is a Java application so it can run on Windows, Mac, or Linux. It can be run on the command line on a server  but you should also install a graphical user interface version on your desktop. You can check if Java is installed by opening a console and entering:&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
java -version&amp;lt;/code&amp;gt;&lt;br /&gt;
If it doesn&#039;t return a version, go to the [https://www.java.com/ Java] site and install.&lt;br /&gt;
&lt;br /&gt;
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.&lt;br /&gt;
&lt;br /&gt;
To run JMeter. open the /bin subdirectory and use either jmeter.bat on Windows or ./jmeter on Linux. This will open the JMeter GUI.&lt;br /&gt;
&lt;br /&gt;
First step is to go to File -&amp;gt; Open and select the testplan.jmx file. This will open a tree on the left hand side of JMeter. &lt;br /&gt;
Open the Warm-up site -&amp;gt; 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. &amp;lt;b&amp;gt;Repeat &amp;lt;/b&amp;gt; this for Moodle Test.&lt;br /&gt;
&lt;br /&gt;
Right mouse click on the Test Plan, then Add -&amp;gt; Listener. I choose Aggregate Report so I can follow the run as it happens. Save the changes in your test plan and run it.&lt;br /&gt;
&lt;br /&gt;
==See also==&lt;br /&gt;
*[http://jmeter.apache.org/ Apache JMeter homepage]&lt;br /&gt;
*[https://moodle.org/mod/forum/discuss.php?d=377231 Jmeter or loading script/app to simulate concurrent users takng quizzes] (October 2018)&lt;br /&gt;
*[https://moodle.org/mod/forum/discuss.php?d=368620 Has anyone successfully run a jmeter test with 1000 users?] (April 2018)&lt;br /&gt;
&lt;br /&gt;
[[Category:Developer tools]]&lt;/div&gt;</summary>
		<author><name>Ratna</name></author>
	</entry>
	<entry>
		<id>https://docs.moodle.org/dev/index.php?title=Load_testing_Moodle_with_JMeter&amp;diff=59112</id>
		<title>Load testing Moodle with JMeter</title>
		<link rel="alternate" type="text/html" href="https://docs.moodle.org/dev/index.php?title=Load_testing_Moodle_with_JMeter&amp;diff=59112"/>
		<updated>2021-07-01T15:30:32Z</updated>

		<summary type="html">&lt;p&gt;Ratna: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Being the original server load testing tool, introduced in 1998(!), [http://jmeter.apache.org/ Apache JMeter] has always been the number one load testing resp. performance measuring tool for Moodle. Around the release 2.5, Moodle made the testing process vastly simpler through two built-in scripts,  &#039;&#039;Make test course&#039;&#039;  and &#039;&#039;Make JMeter test plan&#039;&#039;, both available under &#039;&#039;Site administration &amp;gt; Development&#039;&#039;. Together with the set of add-ons [https://github.com/moodlehq/moodle-performance-comparison Moodle performance comparison] they build a full set of load testing tools. This document is about using the aforementioned two built-in scripts.&lt;br /&gt;
&lt;br /&gt;
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&#039;t even run them on a separate Moodle instance in the production server: their effect on the DBMS is undocumented.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;h2&amp;gt;Make test course&amp;lt;/h2&amp;gt;&lt;br /&gt;
This tool creates test courses that include many users, sections, files and various activities. This is intended to provide a standardized measure for checking the reliability and performance of various system components (such as backup and restore).&lt;br /&gt;
&lt;br /&gt;
Warning: Courses created using this feature can occupy a large amount of database and filesystem space (tens of gigabytes). You will need to delete the courses (and wait for various cleanup runs) to release this space again.&lt;br /&gt;
&lt;br /&gt;
Once you have set the debugging level under &#039;&#039;Site administration &amp;gt; Development &amp;gt; Debugging&#039;&#039; to DEVELOPER, visit &#039;&#039;Site administration &amp;gt; Development &amp;gt; Make test course&#039;&#039;. You have the choice between types XS, S, M, L, XL and XXL:&lt;br /&gt;
&lt;br /&gt;
[[File:make-a-test-course.png|thumb]]&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Type of course&lt;br /&gt;
! ~Size&lt;br /&gt;
! Assignments&lt;br /&gt;
! Pages&lt;br /&gt;
! Small files&lt;br /&gt;
! Big files&lt;br /&gt;
! Sections&lt;br /&gt;
! Users&lt;br /&gt;
! Forum posts&lt;br /&gt;
! ~time to create&lt;br /&gt;
|-&lt;br /&gt;
! XS&lt;br /&gt;
| 10 kB&lt;br /&gt;
| 1&lt;br /&gt;
| 1&lt;br /&gt;
| 1&lt;br /&gt;
| 1&lt;br /&gt;
| 1&lt;br /&gt;
| 1&lt;br /&gt;
| 2&lt;br /&gt;
| 1 second&lt;br /&gt;
|-&lt;br /&gt;
! S&lt;br /&gt;
| 10 MB&lt;br /&gt;
| 10&lt;br /&gt;
| 50&lt;br /&gt;
| 64&lt;br /&gt;
| 2&lt;br /&gt;
| 10&lt;br /&gt;
| 100&lt;br /&gt;
| 20&lt;br /&gt;
| 30 seconds&lt;br /&gt;
|-&lt;br /&gt;
! M&lt;br /&gt;
| 100&amp;amp;nbsp;MB&lt;br /&gt;
| 100&lt;br /&gt;
| 200&lt;br /&gt;
| 128&lt;br /&gt;
| 5&lt;br /&gt;
| 100&lt;br /&gt;
| 1,000&lt;br /&gt;
| 500&lt;br /&gt;
| 2 minutes&lt;br /&gt;
|-&lt;br /&gt;
! L&lt;br /&gt;
| 1 GB&lt;br /&gt;
| 500&lt;br /&gt;
| 1,000&lt;br /&gt;
| 1,024&lt;br /&gt;
| 10&lt;br /&gt;
| 500&lt;br /&gt;
| 10,000&lt;br /&gt;
| 5,000&lt;br /&gt;
| 30 minutes&lt;br /&gt;
|-&lt;br /&gt;
! XL&lt;br /&gt;
| 10 GB&lt;br /&gt;
| Assignments&lt;br /&gt;
| Pages&lt;br /&gt;
| Small files&lt;br /&gt;
| Big files&lt;br /&gt;
| Sections&lt;br /&gt;
| 100,000&lt;br /&gt;
| Forum posts&lt;br /&gt;
| 2 hours&lt;br /&gt;
|-&lt;br /&gt;
! XXL&lt;br /&gt;
| 20 GB&lt;br /&gt;
| Assignments&lt;br /&gt;
| Pages&lt;br /&gt;
| Small files&lt;br /&gt;
| Big files&lt;br /&gt;
| Sections&lt;br /&gt;
| 1,000,000&lt;br /&gt;
| Forum posts&lt;br /&gt;
| 4 hours&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Sample output (from a course of type M):&lt;br /&gt;
  Creating course&lt;br /&gt;
  Creating [Course name]&lt;br /&gt;
  Creating assignments (100): . . . . . . . . . . . . done (12.7s)&lt;br /&gt;
  Creating pages (200): . . done (1.5s)&lt;br /&gt;
  Creating small files (128): done (0.4s)&lt;br /&gt;
  Creating big files (5): . done (1.3s)&lt;br /&gt;
  Checking user accounts (1000)&lt;br /&gt;
  Creating user accounts (1 - 1000): . . . . . . . . done (8.7s)&lt;br /&gt;
  Enrolling users into course (1000): . . . . . . done (5.7s)&lt;br /&gt;
  Creating forum (500 posts): . . done (1.7s)&lt;br /&gt;
  Course completed (32.2s)&lt;br /&gt;
&lt;br /&gt;
Pl. note that the biggest course needs 4 hours to create on a decent server. Your server may time out if you try to created too big courses your server can handle.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;h2&amp;gt;Make JMeter test plan&amp;lt;/h2&amp;gt;&lt;br /&gt;
This tool creates a JMeter test plan file along with the user credentials file. Here too it is necessary to set &#039;&#039;Site administration &amp;gt; Development &amp;gt; Debugging&#039;&#039; to DEVELOPER. Also note that, unlike making the test course, this is a single script. To the PHP max_execution_time need to be at least as long as the time for the whole script, which could be anything from a minute to hours depending on the size of the course you select.&lt;br /&gt;
&lt;br /&gt;
This test plan is designed to work along with [https://github.com/moodlehq/moodle-performance-comparison Moodle performance comparison], which makes easier to run the test plan in a specific Moodle environment, gathers information about the runs and compares the results, so you will need to download it and use it&#039;s test_runner.sh script or follow the installation and usage instructions.&lt;br /&gt;
&lt;br /&gt;
You need to set the same password for all the test users by adding the linke &#039;&#039;$CFG-&amp;gt;tool_generator_users_password = &#039;moodle&#039;;&#039; to config.php of Moodle. You might want to set &#039;$CFG-&amp;gt;passwordpolicy = 0;&#039; too in case the proposed user password conflicts with the password policy of the site.&lt;br /&gt;
&lt;br /&gt;
There is no default value for this password to prevent unintended usages of the tool. You need to use the update passwords option in case your course users have other passwords or they were generated by tool_generator but without setting a $CFG-&amp;gt;tool_generator_users_password value.&lt;br /&gt;
&lt;br /&gt;
It is part of tool_generator so it works well with the courses generated by the courses and the site generators, it can also be used with any course that contains, at least:&lt;br /&gt;
- Enough enrolled users (depends on the test plan size you select) with the password reset to &#039;moodle&#039;&lt;br /&gt;
- A page module instance&lt;br /&gt;
- A forum module instance with at least one discussion and one reply&lt;br /&gt;
&lt;br /&gt;
You might want to consider your servers capacity when running large test plans as the amount to load generated by JMeter can be specially big. The ramp up period has been adjusted according to the number of threads (users) to reduce this kind of issues but the load is still huge.&lt;br /&gt;
&lt;br /&gt;
Visit  &#039;&#039;Site administration &amp;gt; Development &amp;gt; Make JMeter test plan&#039;&#039;. Under Size of course your have six possibilities: XS (1 user, 5 loops and 1 rampup period), S (30 users, 5 loops and 6 rampup period), M (100 users, 5 loops and 40 rampup period), L (1000 users, 6 loops and 100 rampup period), XL (5000 users, 6 loops and 500 rampup period) and XXL (1000 users, 7 loops and 800 rampup period). As target course select one of the courses created above. Also &#039;&#039;Update course users password&#039;&#039; should be ticked. &lt;br /&gt;
&lt;br /&gt;
Once successful you can download a test plan [[File:testplan_timestamp.jmx|testplan_timestamp.jmx]] and a users file [[File:users_timestamp.csv|users_timestamp.csv]] &lt;br /&gt;
&lt;br /&gt;
  $ php admin/tool/generator/cli/maketestplan.php --help&lt;br /&gt;
  Options:&lt;br /&gt;
  -h, --help              Print out this help&lt;br /&gt;
  --shortname             Shortname of the test plan&#039;s target course (required)&lt;br /&gt;
  --size                  Size of the test plan to create XS, S, M, L, XL, or XXL (required)&lt;br /&gt;
  --bypasscheck           Bypasses the developer-mode check (be careful!)&lt;br /&gt;
  --updateuserspassword   Updates the target course users password according to $CFG-&amp;gt;tool_generator_users_password&lt;br /&gt;
  &lt;br /&gt;
  * XS (1 Nutzter, 5 Schleifen und 1 Steigerungsrate)&lt;br /&gt;
  * S (30 Nutzter, 5 Schleifen und 6 Steigerungsrate)&lt;br /&gt;
  * M (100 Nutzter, 5 Schleifen und 40 Steigerungsrate)&lt;br /&gt;
  * L (1000 Nutzter, 6 Schleifen und 100 Steigerungsrate)&lt;br /&gt;
  * XL (5000 Nutzter, 6 Schleifen und 500 Steigerungsrate)&lt;br /&gt;
  * XXL (10000 Nutzter, 7 Schleifen und 800 Steigerungsrate)&lt;br /&gt;
  &lt;br /&gt;
  Consider that, the server resources you will need to run the test plan will be higher as the test plan size is higher.&lt;br /&gt;
  &lt;br /&gt;
  Example from Moodle root directory: &lt;br /&gt;
  $ sudo -u www-data /usr/bin/php admin/tool/generator/cli/maketestplan.php --shortname=&amp;quot;testcourse_12&amp;quot; --size=S&lt;br /&gt;
&lt;br /&gt;
&amp;lt;h2&amp;gt;Running the test plan on JMeter&amp;lt;/h2&amp;gt;&lt;br /&gt;
JMeter is a Java application so it can run on Windows, Mac, or Linux. It can be run on the command line on a server  but you should also install a graphical user interface version on your desktop. You can check if Java is installed by opening a console and entering:&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
java -version&amp;lt;/code&amp;gt;&lt;br /&gt;
If it doesn&#039;t return a version, go to the [https://www.java.com/ Java] site and install.&lt;br /&gt;
&lt;br /&gt;
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.&lt;br /&gt;
&lt;br /&gt;
To run JMeter. open the /bin subdirectory and use either jmeter.bat on Windows or ./jmeter on Linux. This will open the JMeter GUI.&lt;br /&gt;
&lt;br /&gt;
First step is to go to File -&amp;gt; Open and select the testplan.jmx file. This will open a tree on the left hand side of JMeter. &lt;br /&gt;
Open the Warm-up site -&amp;gt; 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. &amp;lt;b&amp;gt;Repeat &amp;lt;/b&amp;gt; this for Moodle Test.&lt;br /&gt;
&lt;br /&gt;
Right mouse click on the Test Plan, then Add -&amp;gt; Listener. I choose Aggregate Report so I can follow the run as it happens. Save the changes in your test plan and run it.&lt;br /&gt;
&lt;br /&gt;
==See also==&lt;br /&gt;
*[http://jmeter.apache.org/ Apache JMeter homepage]&lt;br /&gt;
*[https://moodle.org/mod/forum/discuss.php?d=377231 Jmeter or loading script/app to simulate concurrent users takng quizzes] (October 2018)&lt;br /&gt;
*[https://moodle.org/mod/forum/discuss.php?d=368620 Has anyone successfully run a jmeter test with 1000 users?] (April 2018)&lt;br /&gt;
&lt;br /&gt;
[[Category:Developer tools]]&lt;/div&gt;</summary>
		<author><name>Ratna</name></author>
	</entry>
	<entry>
		<id>https://docs.moodle.org/dev/index.php?title=Load_testing_Moodle_with_JMeter&amp;diff=59023</id>
		<title>Load testing Moodle with JMeter</title>
		<link rel="alternate" type="text/html" href="https://docs.moodle.org/dev/index.php?title=Load_testing_Moodle_with_JMeter&amp;diff=59023"/>
		<updated>2021-06-29T12:45:01Z</updated>

		<summary type="html">&lt;p&gt;Ratna: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Being the original server load testing tool, introduced in 1998(!), [http://jmeter.apache.org/ Apache JMeter] has always been the number one load testing resp. performance measuring tool for Moodle. Around the release 2.5, Moodle made the testing process vastly simpler through two built-in scripts,  &#039;&#039;Make test course&#039;&#039;&#039;  and &#039;&#039;Make JMeter test plan&#039;&#039;, both under &#039;&#039;Site administration &amp;gt; Development&#039;&#039;, augmented by a set of add-ons [https://github.com/moodlehq/moodle-performance-comparison Moodle performance comparison]. This document is about using the aforementioned two built-in scripts.&lt;br /&gt;
&lt;br /&gt;
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&#039;t even run them on a separate Moodle instance in the production server: their effect on the DBMS is undocumented.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;h2&amp;gt;Make test course&amp;lt;/h2&amp;gt;&lt;br /&gt;
This tool creates test courses that include many users, sections, files and various activities. This is intended to provide a standardized measure for checking the reliability and performance of various system components (such as backup and restore).&lt;br /&gt;
&lt;br /&gt;
Warning: Courses created using this feature can occupy a large amount of database and filesystem space (tens of gigabytes). You will need to delete the courses (and wait for various cleanup runs) to release this space again.&lt;br /&gt;
&lt;br /&gt;
Once you have set the debugging level under &#039;&#039;Site administration &amp;gt; Development &amp;gt; Debugging&#039;&#039; to DEVELOPER, visit &#039;&#039;Site administration &amp;gt; Development &amp;gt; Make test course&#039;&#039;. You have the choice between types XS, S, M, L, XL and XXL:&lt;br /&gt;
&lt;br /&gt;
[[File:make-a-test-course.png|thumb]]&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Type of course&lt;br /&gt;
! ~Size&lt;br /&gt;
! Assignments&lt;br /&gt;
! Pages&lt;br /&gt;
! Small files&lt;br /&gt;
! Big files&lt;br /&gt;
! Sections&lt;br /&gt;
! Users&lt;br /&gt;
! Forum posts&lt;br /&gt;
|-&lt;br /&gt;
! XS&lt;br /&gt;
| 10 kB&lt;br /&gt;
| 1&lt;br /&gt;
| 1&lt;br /&gt;
| 1&lt;br /&gt;
| 1&lt;br /&gt;
| 1&lt;br /&gt;
| 1&lt;br /&gt;
| 2&lt;br /&gt;
|-&lt;br /&gt;
! S&lt;br /&gt;
| 10 MB&lt;br /&gt;
| 10&lt;br /&gt;
| 50&lt;br /&gt;
| 64&lt;br /&gt;
| 2&lt;br /&gt;
| 10&lt;br /&gt;
| 100&lt;br /&gt;
| 20&lt;br /&gt;
|-&lt;br /&gt;
! M&lt;br /&gt;
| 100 MB&lt;br /&gt;
| 100&lt;br /&gt;
| 200&lt;br /&gt;
| 128&lt;br /&gt;
| 5&lt;br /&gt;
| 100&lt;br /&gt;
| 1,000&lt;br /&gt;
| 500&lt;br /&gt;
|-&lt;br /&gt;
! L&lt;br /&gt;
| 1 GB&lt;br /&gt;
| 500&lt;br /&gt;
| 1,000&lt;br /&gt;
| 1,024&lt;br /&gt;
| 10&lt;br /&gt;
| 500&lt;br /&gt;
| 10,000&lt;br /&gt;
| 5,000&lt;br /&gt;
|-&lt;br /&gt;
! XL&lt;br /&gt;
| 10 GB&lt;br /&gt;
| Assignments&lt;br /&gt;
| Pages&lt;br /&gt;
| Small files&lt;br /&gt;
| Big files&lt;br /&gt;
| Sections&lt;br /&gt;
| 100,000&lt;br /&gt;
| Forum posts&lt;br /&gt;
|-&lt;br /&gt;
! XXL&lt;br /&gt;
| 20 GB&lt;br /&gt;
| Assignments&lt;br /&gt;
| Pages&lt;br /&gt;
| Small files&lt;br /&gt;
| Big files&lt;br /&gt;
| Sections&lt;br /&gt;
| 1,000,000&lt;br /&gt;
| Forum posts&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Sample output:&lt;br /&gt;
  Creating course&lt;br /&gt;
  Creating [Course name]&lt;br /&gt;
  Creating assignments (100): . . . . . . . . . . . . done (12.7s)&lt;br /&gt;
  Creating pages (200): . . done (1.5s)&lt;br /&gt;
  Creating small files (128): done (0.4s)&lt;br /&gt;
  Creating big files (5): . done (1.3s)&lt;br /&gt;
  Checking user accounts (1000)&lt;br /&gt;
  Creating user accounts (1 - 1000): . . . . . . . . done (8.7s)&lt;br /&gt;
  Enrolling users into course (1000): . . . . . . done (5.7s)&lt;br /&gt;
  Creating forum (500 posts): . . done (1.7s)&lt;br /&gt;
  Course completed (32.2s)&lt;br /&gt;
&lt;br /&gt;
Pl. note that the expected time to create the biggest course on a decent server is 4 hours. Your server may time out if you select too big courses for your server.&lt;br /&gt;
&lt;br /&gt;
The final Continue will give you a view of the course thus created.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;h2&amp;gt;Make JMeter test plan&amp;lt;/h2&amp;gt;&lt;br /&gt;
This tool creates a JMeter test plan file along with the user credentials file. Here too it is necessary to set &#039;&#039;Site administration &amp;gt; Development &amp;gt; Debugging&#039;&#039; to DEVELOPER. Also note that, unlike making the test course, this is a single script. To the PHP max_execution_time need to be at least as long as the time for the whole script, which could be anything from a minute to hours depending on the size of the course you select.&lt;br /&gt;
&lt;br /&gt;
This test plan is designed to work along with [https://github.com/moodlehq/moodle-performance-comparison Moodle performance comparison], which makes easier to run the test plan in a specific Moodle environment, gathers information about the runs and compares the results, so you will need to download it and use it&#039;s test_runner.sh script or follow the installation and usage instructions.&lt;br /&gt;
&lt;br /&gt;
You need to set the same password for all the test users by adding the linke &#039;&#039;$CFG-&amp;gt;tool_generator_users_password = &#039;moodle&#039;;&#039; to config.php of Moodle. You might want to set &#039;$CFG-&amp;gt;passwordpolicy = 0;&#039; too in case the proposed user password conflicts with the password policy of the site.&lt;br /&gt;
&lt;br /&gt;
There is no default value for this password to prevent unintended usages of the tool. You need to use the update passwords option in case your course users have other passwords or they were generated by tool_generator but without setting a $CFG-&amp;gt;tool_generator_users_password value.&lt;br /&gt;
&lt;br /&gt;
It is part of tool_generator so it works well with the courses generated by the courses and the site generators, it can also be used with any course that contains, at least:&lt;br /&gt;
- Enough enrolled users (depends on the test plan size you select) with the password reset to &#039;moodle&#039;&lt;br /&gt;
- A page module instance&lt;br /&gt;
- A forum module instance with at least one discussion and one reply&lt;br /&gt;
&lt;br /&gt;
You might want to consider your servers capacity when running large test plans as the amount to load generated by JMeter can be specially big. The ramp up period has been adjusted according to the number of threads (users) to reduce this kind of issues but the load is still huge.&lt;br /&gt;
&lt;br /&gt;
Visit  &#039;&#039;Site administration &amp;gt; Development &amp;gt; Make JMeter test plan&#039;&#039;. Under Size of course your have six possibilities: XS (1 user, 5 loops and 1 rampup period), S (30 users, 5 loops and 6 rampup period), M (100 users, 5 loops and 40 rampup period), L (1000 users, 6 loops and 100 rampup period), XL (5000 users, 6 loops and 500 rampup period) and XXL (1000 users, 7 loops and 800 rampup period). As target course select one of the courses created above. Also &#039;&#039;Update course users password&#039;&#039; should be ticked. &lt;br /&gt;
&lt;br /&gt;
Once successful you can download a test plan [[File:testplan_timestamp.jmx|testplan_timestamp.jmx]] and a users file [[File:users_timestamp.csv|users_timestamp.csv]] &lt;br /&gt;
&lt;br /&gt;
  $ php admin/tool/generator/cli/maketestplan.php --help&lt;br /&gt;
  Options:&lt;br /&gt;
  -h, --help              Print out this help&lt;br /&gt;
  --shortname             Shortname of the test plan&#039;s target course (required)&lt;br /&gt;
  --size                  Size of the test plan to create XS, S, M, L, XL, or XXL (required)&lt;br /&gt;
  --bypasscheck           Bypasses the developer-mode check (be careful!)&lt;br /&gt;
  --updateuserspassword   Updates the target course users password according to $CFG-&amp;gt;tool_generator_users_password&lt;br /&gt;
  &lt;br /&gt;
  * XS (1 Nutzter, 5 Schleifen und 1 Steigerungsrate)&lt;br /&gt;
  * S (30 Nutzter, 5 Schleifen und 6 Steigerungsrate)&lt;br /&gt;
  * M (100 Nutzter, 5 Schleifen und 40 Steigerungsrate)&lt;br /&gt;
  * L (1000 Nutzter, 6 Schleifen und 100 Steigerungsrate)&lt;br /&gt;
  * XL (5000 Nutzter, 6 Schleifen und 500 Steigerungsrate)&lt;br /&gt;
  * XXL (10000 Nutzter, 7 Schleifen und 800 Steigerungsrate)&lt;br /&gt;
  &lt;br /&gt;
  Consider that, the server resources you will need to run the test plan will be higher as the test plan size is higher.&lt;br /&gt;
  &lt;br /&gt;
  Example from Moodle root directory: &lt;br /&gt;
  $ sudo -u www-data /usr/bin/php admin/tool/generator/cli/maketestplan.php --shortname=&amp;quot;testcourse_12&amp;quot; --size=S&lt;br /&gt;
&lt;br /&gt;
&amp;lt;h2&amp;gt;Running the test plan on JMeter&amp;lt;/h2&amp;gt;&lt;br /&gt;
JMeter is a Java application so it can run on Windows, Mac, or Linux. It can be run on the command line on a server  but you should also install a graphical user interface version on your desktop. You can check if Java is installed by opening a console and entering:&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
java -version&amp;lt;/code&amp;gt;&lt;br /&gt;
If it doesn&#039;t return a version, go to the [https://www.java.com/ Java] site and install.&lt;br /&gt;
&lt;br /&gt;
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.&lt;br /&gt;
&lt;br /&gt;
To run JMeter. open the /bin subdirectory and use either jmeter.bat on Windows or ./jmeter on Linux. This will open the JMeter GUI.&lt;br /&gt;
&lt;br /&gt;
First step is to go to File -&amp;gt; Open and select the testplan.jmx file. This will open a tree on the left hand side of JMeter. &lt;br /&gt;
Open the Warm-up site -&amp;gt; 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. &amp;lt;b&amp;gt;Repeat &amp;lt;/b&amp;gt; this for Moodle Test.&lt;br /&gt;
&lt;br /&gt;
Right mouse click on the Test Plan, then Add -&amp;gt; Listener. I choose Aggregate Report so I can follow the run as it happens. Save the changes in your test plan and run it.&lt;br /&gt;
&lt;br /&gt;
==See also==&lt;br /&gt;
*[http://jmeter.apache.org/ Apache JMeter homepage]&lt;br /&gt;
*[https://moodle.org/mod/forum/discuss.php?d=377231 Jmeter or loading script/app to simulate concurrent users takng quizzes] (October 2018)&lt;br /&gt;
*[https://moodle.org/mod/forum/discuss.php?d=368620 Has anyone successfully run a jmeter test with 1000 users?] (April 2018)&lt;br /&gt;
&lt;br /&gt;
[[Category:Developer tools]]&lt;/div&gt;</summary>
		<author><name>Ratna</name></author>
	</entry>
	<entry>
		<id>https://docs.moodle.org/dev/index.php?title=Load_testing_Moodle_with_JMeter&amp;diff=59014</id>
		<title>Load testing Moodle with JMeter</title>
		<link rel="alternate" type="text/html" href="https://docs.moodle.org/dev/index.php?title=Load_testing_Moodle_with_JMeter&amp;diff=59014"/>
		<updated>2021-06-29T09:16:08Z</updated>

		<summary type="html">&lt;p&gt;Ratna: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Being the original server load testing tool, introduced in 1998(!), [http://jmeter.apache.org/ Apache JMeter] has always been the number one load testing resp. performance measuring tool for Moodle. Around the release 2.5, Moodle made the testing process vastly simpler through two built-in scripts,  &#039;&#039;Make test course&#039;&#039;&#039;  and &#039;&#039;Make JMeter test plan&#039;&#039;, both under &#039;&#039;Site administration &amp;gt; Development&#039;&#039;, augmented by a set of add-ons [https://github.com/moodlehq/moodle-performance-comparison Moodle performance comparison]. This document is about using the aforementioned two built-in scripts.&lt;br /&gt;
&lt;br /&gt;
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&#039;t even run them on a separate Moodle instance in the production server: their effect on the DBMS is undocumented.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;h2&amp;gt;Make test course&amp;lt;/h2&amp;gt;&lt;br /&gt;
This tool creates test courses that include many users, sections, files and various activities. This is intended to provide a standardized measure for checking the reliability and performance of various system components (such as backup and restore).&lt;br /&gt;
&lt;br /&gt;
Warning: Courses created using this feature can occupy a large amount of database and filesystem space (tens of gigabytes). You will need to delete the courses (and wait for various cleanup runs) to release this space again.&lt;br /&gt;
&lt;br /&gt;
Once you have set the debugging level under &#039;&#039;Site administration &amp;gt; Development &amp;gt; Debugging&#039;&#039; to DEVELOPER, visit &#039;&#039;Site administration &amp;gt; Development &amp;gt; Make test course&#039;&#039;. You have the choice between types XS, S, M, L, XL and XXL:&lt;br /&gt;
&lt;br /&gt;
[[File:make-a-test-course.png|thumb]]&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Type of course&lt;br /&gt;
! ~Size&lt;br /&gt;
! Assignments&lt;br /&gt;
! Pages&lt;br /&gt;
! Small files&lt;br /&gt;
! Big files&lt;br /&gt;
! Sections&lt;br /&gt;
! Users&lt;br /&gt;
! Forum posts&lt;br /&gt;
|-&lt;br /&gt;
! XS&lt;br /&gt;
| 10 kB&lt;br /&gt;
| 1&lt;br /&gt;
| row 1, cell 3&lt;br /&gt;
|-&lt;br /&gt;
! S&lt;br /&gt;
| 10 MB&lt;br /&gt;
| 100&lt;br /&gt;
| row 2, cell 3&lt;br /&gt;
|-&lt;br /&gt;
! M&lt;br /&gt;
| 100 MB&lt;br /&gt;
| 1,000&lt;br /&gt;
| row 2, cell 3&lt;br /&gt;
|-&lt;br /&gt;
! L&lt;br /&gt;
| 1 GB&lt;br /&gt;
| 10,000&lt;br /&gt;
| row 2, cell 3&lt;br /&gt;
|-&lt;br /&gt;
! XL&lt;br /&gt;
| 10 GB&lt;br /&gt;
| 100,000&lt;br /&gt;
| row 2, cell 3&lt;br /&gt;
|-&lt;br /&gt;
! XXL&lt;br /&gt;
| 20 GB&lt;br /&gt;
| 1,000,000&lt;br /&gt;
| row 2, cell 3&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Sample output:&lt;br /&gt;
  Creating course&lt;br /&gt;
  Creating [Course name]&lt;br /&gt;
  Creating assignments (100): . . . . . . . . . . . . done (12.7s)&lt;br /&gt;
  Creating pages (200): . . done (1.5s)&lt;br /&gt;
  Creating small files (128): done (0.4s)&lt;br /&gt;
  Creating big files (5): . done (1.3s)&lt;br /&gt;
  Checking user accounts (1000)&lt;br /&gt;
  Creating user accounts (1 - 1000): . . . . . . . . done (8.7s)&lt;br /&gt;
  Enrolling users into course (1000): . . . . . . done (5.7s)&lt;br /&gt;
  Creating forum (500 posts): . . done (1.7s)&lt;br /&gt;
  Course completed (32.2s)&lt;br /&gt;
&lt;br /&gt;
Pl. note that the expected time to create the biggest course on a decent server is 4 hours. Your server may time out if you select too big courses for your server.&lt;br /&gt;
&lt;br /&gt;
The final Continue will give you a view of the course thus created.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;h2&amp;gt;Make JMeter test plan&amp;lt;/h2&amp;gt;&lt;br /&gt;
This tool creates a JMeter test plan file along with the user credentials file. Here too it is necessary to set &#039;&#039;Site administration &amp;gt; Development &amp;gt; Debugging&#039;&#039; to DEVELOPER. Also note that, unlike making the test course, this is a single script. To the PHP max_execution_time need to be at least as long as the time for the whole script, which could be anything from a minute to hours depending on the size of the course you select.&lt;br /&gt;
&lt;br /&gt;
This test plan is designed to work along with [https://github.com/moodlehq/moodle-performance-comparison Moodle performance comparison], which makes easier to run the test plan in a specific Moodle environment, gathers information about the runs and compares the results, so you will need to download it and use it&#039;s test_runner.sh script or follow the installation and usage instructions.&lt;br /&gt;
&lt;br /&gt;
You need to set the same password for all the test users by adding the linke &#039;&#039;$CFG-&amp;gt;tool_generator_users_password = &#039;moodle&#039;;&#039; to config.php of Moodle. You might want to set &#039;$CFG-&amp;gt;passwordpolicy = 0;&#039; too in case the proposed user password conflicts with the password policy of the site.&lt;br /&gt;
&lt;br /&gt;
There is no default value for this password to prevent unintended usages of the tool. You need to use the update passwords option in case your course users have other passwords or they were generated by tool_generator but without setting a $CFG-&amp;gt;tool_generator_users_password value.&lt;br /&gt;
&lt;br /&gt;
It is part of tool_generator so it works well with the courses generated by the courses and the site generators, it can also be used with any course that contains, at least:&lt;br /&gt;
- Enough enrolled users (depends on the test plan size you select) with the password reset to &#039;moodle&#039;&lt;br /&gt;
- A page module instance&lt;br /&gt;
- A forum module instance with at least one discussion and one reply&lt;br /&gt;
&lt;br /&gt;
You might want to consider your servers capacity when running large test plans as the amount to load generated by JMeter can be specially big. The ramp up period has been adjusted according to the number of threads (users) to reduce this kind of issues but the load is still huge.&lt;br /&gt;
&lt;br /&gt;
Visit  &#039;&#039;Site administration &amp;gt; Development &amp;gt; Make JMeter test plan&#039;&#039;. Under Size of course your have six possibilities: XS (1 user, 5 loops and 1 rampup period), S (30 users, 5 loops and 6 rampup period), M (100 users, 5 loops and 40 rampup period), L (1000 users, 6 loops and 100 rampup period), XL (5000 users, 6 loops and 500 rampup period) and XXL (1000 users, 7 loops and 800 rampup period). As target course select one of the courses created above. Also &#039;&#039;Update course users password&#039;&#039; should be ticked. &lt;br /&gt;
&lt;br /&gt;
Once successful you can download a test plan [[File:testplan_timestamp.jmx|testplan_timestamp.jmx]] and a users file [[File:users_timestamp.csv|users_timestamp.csv]] &lt;br /&gt;
&lt;br /&gt;
  $ php admin/tool/generator/cli/maketestplan.php --help&lt;br /&gt;
  Options:&lt;br /&gt;
  -h, --help              Print out this help&lt;br /&gt;
  --shortname             Shortname of the test plan&#039;s target course (required)&lt;br /&gt;
  --size                  Size of the test plan to create XS, S, M, L, XL, or XXL (required)&lt;br /&gt;
  --bypasscheck           Bypasses the developer-mode check (be careful!)&lt;br /&gt;
  --updateuserspassword   Updates the target course users password according to $CFG-&amp;gt;tool_generator_users_password&lt;br /&gt;
  &lt;br /&gt;
  * XS (1 Nutzter, 5 Schleifen und 1 Steigerungsrate)&lt;br /&gt;
  * S (30 Nutzter, 5 Schleifen und 6 Steigerungsrate)&lt;br /&gt;
  * M (100 Nutzter, 5 Schleifen und 40 Steigerungsrate)&lt;br /&gt;
  * L (1000 Nutzter, 6 Schleifen und 100 Steigerungsrate)&lt;br /&gt;
  * XL (5000 Nutzter, 6 Schleifen und 500 Steigerungsrate)&lt;br /&gt;
  * XXL (10000 Nutzter, 7 Schleifen und 800 Steigerungsrate)&lt;br /&gt;
  &lt;br /&gt;
  Consider that, the server resources you will need to run the test plan will be higher as the test plan size is higher.&lt;br /&gt;
  &lt;br /&gt;
  Example from Moodle root directory: &lt;br /&gt;
  $ sudo -u www-data /usr/bin/php admin/tool/generator/cli/maketestplan.php --shortname=&amp;quot;testcourse_12&amp;quot; --size=S&lt;br /&gt;
&lt;br /&gt;
&amp;lt;h2&amp;gt;Running the test plan on JMeter&amp;lt;/h2&amp;gt;&lt;br /&gt;
JMeter is a Java application so it can run on Windows, Mac, or Linux. It can be run on the command line on a server  but you should also install a graphical user interface version on your desktop. You can check if Java is installed by opening a console and entering:&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
java -version&amp;lt;/code&amp;gt;&lt;br /&gt;
If it doesn&#039;t return a version, go to the [https://www.java.com/ Java] site and install.&lt;br /&gt;
&lt;br /&gt;
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.&lt;br /&gt;
&lt;br /&gt;
To run JMeter. open the /bin subdirectory and use either jmeter.bat on Windows or ./jmeter on Linux. This will open the JMeter GUI.&lt;br /&gt;
&lt;br /&gt;
First step is to go to File -&amp;gt; Open and select the testplan.jmx file. This will open a tree on the left hand side of JMeter. &lt;br /&gt;
Open the Warm-up site -&amp;gt; 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. &amp;lt;b&amp;gt;Repeat &amp;lt;/b&amp;gt; this for Moodle Test.&lt;br /&gt;
&lt;br /&gt;
Right mouse click on the Test Plan, then Add -&amp;gt; Listener. I choose Aggregate Report so I can follow the run as it happens. Save the changes in your test plan and run it.&lt;br /&gt;
&lt;br /&gt;
==See also==&lt;br /&gt;
*[http://jmeter.apache.org/ Apache JMeter homepage]&lt;br /&gt;
*[https://moodle.org/mod/forum/discuss.php?d=377231 Jmeter or loading script/app to simulate concurrent users takng quizzes] (October 2018)&lt;br /&gt;
*[https://moodle.org/mod/forum/discuss.php?d=368620 Has anyone successfully run a jmeter test with 1000 users?] (April 2018)&lt;br /&gt;
&lt;br /&gt;
[[Category:Developer tools]]&lt;/div&gt;</summary>
		<author><name>Ratna</name></author>
	</entry>
	<entry>
		<id>https://docs.moodle.org/dev/index.php?title=Load_testing_Moodle_with_JMeter&amp;diff=59013</id>
		<title>Load testing Moodle with JMeter</title>
		<link rel="alternate" type="text/html" href="https://docs.moodle.org/dev/index.php?title=Load_testing_Moodle_with_JMeter&amp;diff=59013"/>
		<updated>2021-06-29T09:05:56Z</updated>

		<summary type="html">&lt;p&gt;Ratna: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Being the original server load testing tool, introduced in 1998(!), [http://jmeter.apache.org/ Apache JMeter] has always been the number one load testing resp. performance measuring tool for Moodle. Around the release 2.5, Moodle made the testing process vastly simpler through two built-in scripts,  &#039;&#039;Make test course&#039;&#039;&#039;  and &#039;&#039;Make JMeter test plan&#039;&#039;, both under &#039;&#039;Site administration &amp;gt; Development&#039;&#039;, augmented by a set of add-ons [https://github.com/moodlehq/moodle-performance-comparison Moodle performance comparison]. This document is about using the aforementioned two built-in scripts.&lt;br /&gt;
&lt;br /&gt;
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&#039;t even run them on a separate Moodle instance in the production server: their effect on the DBMS is undocumented.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;h2&amp;gt;Make test course&amp;lt;/h2&amp;gt;&lt;br /&gt;
This tool creates test courses that include many users, sections, files and various activities. This is intended to provide a standardized measure for checking the reliability and performance of various system components (such as backup and restore).&lt;br /&gt;
&lt;br /&gt;
Warning: Courses created using this feature can occupy a large amount of database and filesystem space (tens of gigabytes). You will need to delete the courses (and wait for various cleanup runs) to release this space again.&lt;br /&gt;
&lt;br /&gt;
Once you have set the debugging level under &#039;&#039;Site administration &amp;gt; Development &amp;gt; Debugging&#039;&#039; to DEVELOPER, visit &#039;&#039;Site administration &amp;gt; Development &amp;gt; Make test course&#039;&#039;. &lt;br /&gt;
[[File:make-a-test-course.png|thumb]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
You have the choice between types XS, S, M, L, XL and XXL:&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Type of course&lt;br /&gt;
! Size&lt;br /&gt;
! users&lt;br /&gt;
! sections&lt;br /&gt;
|-&lt;br /&gt;
! XS&lt;br /&gt;
| ~10 kB&lt;br /&gt;
| 1&lt;br /&gt;
| row 1, cell 3&lt;br /&gt;
|-&lt;br /&gt;
! S&lt;br /&gt;
| ~10 MB&lt;br /&gt;
| 100&lt;br /&gt;
| row 2, cell 3&lt;br /&gt;
|-&lt;br /&gt;
! M&lt;br /&gt;
| ~100 MB&lt;br /&gt;
| 1,000&lt;br /&gt;
| row 2, cell 3&lt;br /&gt;
|-&lt;br /&gt;
! L&lt;br /&gt;
| ~1 GB&lt;br /&gt;
| 10,000&lt;br /&gt;
| row 2, cell 3&lt;br /&gt;
|-&lt;br /&gt;
! XL&lt;br /&gt;
| ~10 GB&lt;br /&gt;
| 100,000&lt;br /&gt;
| row 2, cell 3&lt;br /&gt;
|-&lt;br /&gt;
! XXL&lt;br /&gt;
| ~20 GB&lt;br /&gt;
| 1,000,000&lt;br /&gt;
| row 2, cell 3&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Sample output:&lt;br /&gt;
  Creating course&lt;br /&gt;
  Creating [Course name]&lt;br /&gt;
  Creating assignments (100): . . . . . . . . . . . . done (12.7s)&lt;br /&gt;
  Creating pages (200): . . done (1.5s)&lt;br /&gt;
  Creating small files (128): done (0.4s)&lt;br /&gt;
  Creating big files (5): . done (1.3s)&lt;br /&gt;
  Checking user accounts (1000)&lt;br /&gt;
  Creating user accounts (1 - 1000): . . . . . . . . done (8.7s)&lt;br /&gt;
  Enrolling users into course (1000): . . . . . . done (5.7s)&lt;br /&gt;
  Creating forum (500 posts): . . done (1.7s)&lt;br /&gt;
  Course completed (32.2s)&lt;br /&gt;
&lt;br /&gt;
The final Continue will give you a view of the course thus created.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;h2&amp;gt;Make JMeter test plan&amp;lt;/h2&amp;gt;&lt;br /&gt;
This tool creates a JMeter test plan file along with the user credentials file. Here too it is necessary to set &#039;&#039;Site administration &amp;gt; Development &amp;gt; Debugging&#039;&#039; to DEVELOPER. Also note that, unlike making the test course, this is a single script. To the PHP max_execution_time need to be at least as long as the time for the whole script, which could be anything from a minute to hours depending on the size of the course you select.&lt;br /&gt;
&lt;br /&gt;
This test plan is designed to work along with [https://github.com/moodlehq/moodle-performance-comparison Moodle performance comparison], which makes easier to run the test plan in a specific Moodle environment, gathers information about the runs and compares the results, so you will need to download it and use it&#039;s test_runner.sh script or follow the installation and usage instructions.&lt;br /&gt;
&lt;br /&gt;
You need to set the same password for all the test users by adding the linke &#039;&#039;$CFG-&amp;gt;tool_generator_users_password = &#039;moodle&#039;;&#039; to config.php of Moodle. You might want to set &#039;$CFG-&amp;gt;passwordpolicy = 0;&#039; too in case the proposed user password conflicts with the password policy of the site.&lt;br /&gt;
&lt;br /&gt;
There is no default value for this password to prevent unintended usages of the tool. You need to use the update passwords option in case your course users have other passwords or they were generated by tool_generator but without setting a $CFG-&amp;gt;tool_generator_users_password value.&lt;br /&gt;
&lt;br /&gt;
It is part of tool_generator so it works well with the courses generated by the courses and the site generators, it can also be used with any course that contains, at least:&lt;br /&gt;
- Enough enrolled users (depends on the test plan size you select) with the password reset to &#039;moodle&#039;&lt;br /&gt;
- A page module instance&lt;br /&gt;
- A forum module instance with at least one discussion and one reply&lt;br /&gt;
&lt;br /&gt;
You might want to consider your servers capacity when running large test plans as the amount to load generated by JMeter can be specially big. The ramp up period has been adjusted according to the number of threads (users) to reduce this kind of issues but the load is still huge.&lt;br /&gt;
&lt;br /&gt;
Visit  &#039;&#039;Site administration &amp;gt; Development &amp;gt; Make JMeter test plan&#039;&#039;. Under Size of course your have six possibilities: XS (1 user, 5 loops and 1 rampup period), S (30 users, 5 loops and 6 rampup period), M (100 users, 5 loops and 40 rampup period), L (1000 users, 6 loops and 100 rampup period), XL (5000 users, 6 loops and 500 rampup period) and XXL (1000 users, 7 loops and 800 rampup period). As target course select one of the courses created above. Also &#039;&#039;Update course users password&#039;&#039; should be ticked. &lt;br /&gt;
&lt;br /&gt;
Once successful you can download a test plan [[File:testplan_timestamp.jmx|testplan_timestamp.jmx]] and a users file [[File:users_timestamp.csv|users_timestamp.csv]] &lt;br /&gt;
&lt;br /&gt;
  $ php admin/tool/generator/cli/maketestplan.php --help&lt;br /&gt;
  Options:&lt;br /&gt;
  -h, --help              Print out this help&lt;br /&gt;
  --shortname             Shortname of the test plan&#039;s target course (required)&lt;br /&gt;
  --size                  Size of the test plan to create XS, S, M, L, XL, or XXL (required)&lt;br /&gt;
  --bypasscheck           Bypasses the developer-mode check (be careful!)&lt;br /&gt;
  --updateuserspassword   Updates the target course users password according to $CFG-&amp;gt;tool_generator_users_password&lt;br /&gt;
  &lt;br /&gt;
  * XS (1 Nutzter, 5 Schleifen und 1 Steigerungsrate)&lt;br /&gt;
  * S (30 Nutzter, 5 Schleifen und 6 Steigerungsrate)&lt;br /&gt;
  * M (100 Nutzter, 5 Schleifen und 40 Steigerungsrate)&lt;br /&gt;
  * L (1000 Nutzter, 6 Schleifen und 100 Steigerungsrate)&lt;br /&gt;
  * XL (5000 Nutzter, 6 Schleifen und 500 Steigerungsrate)&lt;br /&gt;
  * XXL (10000 Nutzter, 7 Schleifen und 800 Steigerungsrate)&lt;br /&gt;
  &lt;br /&gt;
  Consider that, the server resources you will need to run the test plan will be higher as the test plan size is higher.&lt;br /&gt;
  &lt;br /&gt;
  Example from Moodle root directory: &lt;br /&gt;
  $ sudo -u www-data /usr/bin/php admin/tool/generator/cli/maketestplan.php --shortname=&amp;quot;testcourse_12&amp;quot; --size=S&lt;br /&gt;
&lt;br /&gt;
&amp;lt;h2&amp;gt;Running the test plan on JMeter&amp;lt;/h2&amp;gt;&lt;br /&gt;
JMeter is a Java application so it can run on Windows, Mac, or Linux. It can be run on the command line on a server  but you should also install a graphical user interface version on your desktop. You can check if Java is installed by opening a console and entering:&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
java -version&amp;lt;/code&amp;gt;&lt;br /&gt;
If it doesn&#039;t return a version, go to the [https://www.java.com/ Java] site and install.&lt;br /&gt;
&lt;br /&gt;
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.&lt;br /&gt;
&lt;br /&gt;
To run JMeter. open the /bin subdirectory and use either jmeter.bat on Windows or ./jmeter on Linux. This will open the JMeter GUI.&lt;br /&gt;
&lt;br /&gt;
First step is to go to File -&amp;gt; Open and select the testplan.jmx file. This will open a tree on the left hand side of JMeter. &lt;br /&gt;
Open the Warm-up site -&amp;gt; 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. &amp;lt;b&amp;gt;Repeat &amp;lt;/b&amp;gt; this for Moodle Test.&lt;br /&gt;
&lt;br /&gt;
Right mouse click on the Test Plan, then Add -&amp;gt; Listener. I choose Aggregate Report so I can follow the run as it happens. Save the changes in your test plan and run it.&lt;br /&gt;
&lt;br /&gt;
==See also==&lt;br /&gt;
*[http://jmeter.apache.org/ Apache JMeter homepage]&lt;br /&gt;
*[https://moodle.org/mod/forum/discuss.php?d=377231 Jmeter or loading script/app to simulate concurrent users takng quizzes] (October 2018)&lt;br /&gt;
*[https://moodle.org/mod/forum/discuss.php?d=368620 Has anyone successfully run a jmeter test with 1000 users?] (April 2018)&lt;br /&gt;
&lt;br /&gt;
[[Category:Developer tools]]&lt;/div&gt;</summary>
		<author><name>Ratna</name></author>
	</entry>
	<entry>
		<id>https://docs.moodle.org/dev/index.php?title=File:make-a-test-course.png&amp;diff=59012</id>
		<title>File:make-a-test-course.png</title>
		<link rel="alternate" type="text/html" href="https://docs.moodle.org/dev/index.php?title=File:make-a-test-course.png&amp;diff=59012"/>
		<updated>2021-06-29T08:55:03Z</updated>

		<summary type="html">&lt;p&gt;Ratna: Make a test course, choice for its size&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Make a test course, choice for its size&lt;/div&gt;</summary>
		<author><name>Ratna</name></author>
	</entry>
	<entry>
		<id>https://docs.moodle.org/dev/index.php?title=Load_testing_Moodle_with_JMeter&amp;diff=59011</id>
		<title>Load testing Moodle with JMeter</title>
		<link rel="alternate" type="text/html" href="https://docs.moodle.org/dev/index.php?title=Load_testing_Moodle_with_JMeter&amp;diff=59011"/>
		<updated>2021-06-29T08:52:26Z</updated>

		<summary type="html">&lt;p&gt;Ratna: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Being the original server load testing tool, introduced in 1998(!), [http://jmeter.apache.org/ Apache JMeter] has always been the number one load testing resp. performance measuring tool for Moodle. Around the release 2.5, Moodle made the testing process vastly simpler through two built-in scripts,  &#039;&#039;Make test course&#039;&#039;&#039;  and &#039;&#039;Make JMeter test plan&#039;&#039;, both under &#039;&#039;Site administration &amp;gt; Development&#039;&#039;, augmented by a set of add-ons [https://github.com/moodlehq/moodle-performance-comparison Moodle performance comparison]. This document is about using the aforementioned two built-in scripts.&lt;br /&gt;
&lt;br /&gt;
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&#039;t even run them on a separate Moodle instance in the production server: their effect on the DBMS is undocumented.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;h2&amp;gt;Make test course&amp;lt;/h2&amp;gt;&lt;br /&gt;
This tool creates test courses that include many users, sections, files and various activities. This is intended to provide a standardized measure for checking the reliability and performance of various system components (such as backup and restore).&lt;br /&gt;
&lt;br /&gt;
Warning: Courses created using this feature can occupy a large amount of database and filesystem space (tens of gigabytes). You will need to delete the courses (and wait for various cleanup runs) to release this space again.&lt;br /&gt;
&lt;br /&gt;
Once you have set the debugging level under &#039;&#039;Site administration &amp;gt; Development &amp;gt; Debugging&#039;&#039; to DEVELOPER, visit &#039;&#039;Site administration &amp;gt; Development &amp;gt; Make test course&#039;&#039;. You have the choice between XS (~10 KB; create in ~1 second), S (~10 KB, create in ~30 seconds), M (~100 KB, create in ~2 minutes), L (~1 GB, create in ~30 minutes), XL (~10 GB, create in ~2 hours) and XXL (~20 GB, created in ~4 hours).&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Size of course&lt;br /&gt;
! users&lt;br /&gt;
! sections&lt;br /&gt;
|-&lt;br /&gt;
! XS&lt;br /&gt;
| 1&lt;br /&gt;
| row 1, cell 3&lt;br /&gt;
|-&lt;br /&gt;
! S&lt;br /&gt;
| 100&lt;br /&gt;
| row 2, cell 3&lt;br /&gt;
|-&lt;br /&gt;
! M&lt;br /&gt;
| 1,000&lt;br /&gt;
| row 2, cell 3&lt;br /&gt;
|-&lt;br /&gt;
! L&lt;br /&gt;
| 10,000&lt;br /&gt;
| row 2, cell 3&lt;br /&gt;
|-&lt;br /&gt;
! XL&lt;br /&gt;
| 100,000&lt;br /&gt;
| row 2, cell 3&lt;br /&gt;
|-&lt;br /&gt;
! XXL&lt;br /&gt;
| 1,000,000&lt;br /&gt;
| row 2, cell 3&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Sample output:&lt;br /&gt;
  Creating course&lt;br /&gt;
  Creating [Course name]&lt;br /&gt;
  Creating assignments (100): . . . . . . . . . . . . done (12.7s)&lt;br /&gt;
  Creating pages (200): . . done (1.5s)&lt;br /&gt;
  Creating small files (128): done (0.4s)&lt;br /&gt;
  Creating big files (5): . done (1.3s)&lt;br /&gt;
  Checking user accounts (1000)&lt;br /&gt;
  Creating user accounts (1 - 1000): . . . . . . . . done (8.7s)&lt;br /&gt;
  Enrolling users into course (1000): . . . . . . done (5.7s)&lt;br /&gt;
  Creating forum (500 posts): . . done (1.7s)&lt;br /&gt;
  Course completed (32.2s)&lt;br /&gt;
&lt;br /&gt;
The final Continue will give you a view of the course thus created.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;h2&amp;gt;Make JMeter test plan&amp;lt;/h2&amp;gt;&lt;br /&gt;
This tool creates a JMeter test plan file along with the user credentials file. Here too it is necessary to set &#039;&#039;Site administration &amp;gt; Development &amp;gt; Debugging&#039;&#039; to DEVELOPER. Also note that, unlike making the test course, this is a single script. To the PHP max_execution_time need to be at least as long as the time for the whole script, which could be anything from a minute to hours depending on the size of the course you select.&lt;br /&gt;
&lt;br /&gt;
This test plan is designed to work along with [https://github.com/moodlehq/moodle-performance-comparison Moodle performance comparison], which makes easier to run the test plan in a specific Moodle environment, gathers information about the runs and compares the results, so you will need to download it and use it&#039;s test_runner.sh script or follow the installation and usage instructions.&lt;br /&gt;
&lt;br /&gt;
You need to set the same password for all the test users by adding the linke &#039;&#039;$CFG-&amp;gt;tool_generator_users_password = &#039;moodle&#039;;&#039; to config.php of Moodle. You might want to set &#039;$CFG-&amp;gt;passwordpolicy = 0;&#039; too in case the proposed user password conflicts with the password policy of the site.&lt;br /&gt;
&lt;br /&gt;
There is no default value for this password to prevent unintended usages of the tool. You need to use the update passwords option in case your course users have other passwords or they were generated by tool_generator but without setting a $CFG-&amp;gt;tool_generator_users_password value.&lt;br /&gt;
&lt;br /&gt;
It is part of tool_generator so it works well with the courses generated by the courses and the site generators, it can also be used with any course that contains, at least:&lt;br /&gt;
- Enough enrolled users (depends on the test plan size you select) with the password reset to &#039;moodle&#039;&lt;br /&gt;
- A page module instance&lt;br /&gt;
- A forum module instance with at least one discussion and one reply&lt;br /&gt;
&lt;br /&gt;
You might want to consider your servers capacity when running large test plans as the amount to load generated by JMeter can be specially big. The ramp up period has been adjusted according to the number of threads (users) to reduce this kind of issues but the load is still huge.&lt;br /&gt;
&lt;br /&gt;
Visit  &#039;&#039;Site administration &amp;gt; Development &amp;gt; Make JMeter test plan&#039;&#039;. Under Size of course your have six possibilities: XS (1 user, 5 loops and 1 rampup period), S (30 users, 5 loops and 6 rampup period), M (100 users, 5 loops and 40 rampup period), L (1000 users, 6 loops and 100 rampup period), XL (5000 users, 6 loops and 500 rampup period) and XXL (1000 users, 7 loops and 800 rampup period). As target course select one of the courses created above. Also &#039;&#039;Update course users password&#039;&#039; should be ticked. &lt;br /&gt;
&lt;br /&gt;
Once successful you can download a test plan [[File:testplan_timestamp.jmx|testplan_timestamp.jmx]] and a users file [[File:users_timestamp.csv|users_timestamp.csv]] &lt;br /&gt;
&lt;br /&gt;
  $ php admin/tool/generator/cli/maketestplan.php --help&lt;br /&gt;
  Options:&lt;br /&gt;
  -h, --help              Print out this help&lt;br /&gt;
  --shortname             Shortname of the test plan&#039;s target course (required)&lt;br /&gt;
  --size                  Size of the test plan to create XS, S, M, L, XL, or XXL (required)&lt;br /&gt;
  --bypasscheck           Bypasses the developer-mode check (be careful!)&lt;br /&gt;
  --updateuserspassword   Updates the target course users password according to $CFG-&amp;gt;tool_generator_users_password&lt;br /&gt;
  &lt;br /&gt;
  * XS (1 Nutzter, 5 Schleifen und 1 Steigerungsrate)&lt;br /&gt;
  * S (30 Nutzter, 5 Schleifen und 6 Steigerungsrate)&lt;br /&gt;
  * M (100 Nutzter, 5 Schleifen und 40 Steigerungsrate)&lt;br /&gt;
  * L (1000 Nutzter, 6 Schleifen und 100 Steigerungsrate)&lt;br /&gt;
  * XL (5000 Nutzter, 6 Schleifen und 500 Steigerungsrate)&lt;br /&gt;
  * XXL (10000 Nutzter, 7 Schleifen und 800 Steigerungsrate)&lt;br /&gt;
  &lt;br /&gt;
  Consider that, the server resources you will need to run the test plan will be higher as the test plan size is higher.&lt;br /&gt;
  &lt;br /&gt;
  Example from Moodle root directory: &lt;br /&gt;
  $ sudo -u www-data /usr/bin/php admin/tool/generator/cli/maketestplan.php --shortname=&amp;quot;testcourse_12&amp;quot; --size=S&lt;br /&gt;
&lt;br /&gt;
&amp;lt;h2&amp;gt;Running the test plan on JMeter&amp;lt;/h2&amp;gt;&lt;br /&gt;
JMeter is a Java application so it can run on Windows, Mac, or Linux. It can be run on the command line on a server  but you should also install a graphical user interface version on your desktop. You can check if Java is installed by opening a console and entering:&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
java -version&amp;lt;/code&amp;gt;&lt;br /&gt;
If it doesn&#039;t return a version, go to the [https://www.java.com/ Java] site and install.&lt;br /&gt;
&lt;br /&gt;
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.&lt;br /&gt;
&lt;br /&gt;
To run JMeter. open the /bin subdirectory and use either jmeter.bat on Windows or ./jmeter on Linux. This will open the JMeter GUI.&lt;br /&gt;
&lt;br /&gt;
First step is to go to File -&amp;gt; Open and select the testplan.jmx file. This will open a tree on the left hand side of JMeter. &lt;br /&gt;
Open the Warm-up site -&amp;gt; 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. &amp;lt;b&amp;gt;Repeat &amp;lt;/b&amp;gt; this for Moodle Test.&lt;br /&gt;
&lt;br /&gt;
Right mouse click on the Test Plan, then Add -&amp;gt; Listener. I choose Aggregate Report so I can follow the run as it happens. Save the changes in your test plan and run it.&lt;br /&gt;
&lt;br /&gt;
==See also==&lt;br /&gt;
*[http://jmeter.apache.org/ Apache JMeter homepage]&lt;br /&gt;
*[https://moodle.org/mod/forum/discuss.php?d=377231 Jmeter or loading script/app to simulate concurrent users takng quizzes] (October 2018)&lt;br /&gt;
*[https://moodle.org/mod/forum/discuss.php?d=368620 Has anyone successfully run a jmeter test with 1000 users?] (April 2018)&lt;br /&gt;
&lt;br /&gt;
[[Category:Developer tools]]&lt;/div&gt;</summary>
		<author><name>Ratna</name></author>
	</entry>
	<entry>
		<id>https://docs.moodle.org/dev/index.php?title=Load_testing_Moodle_with_JMeter&amp;diff=59001</id>
		<title>Load testing Moodle with JMeter</title>
		<link rel="alternate" type="text/html" href="https://docs.moodle.org/dev/index.php?title=Load_testing_Moodle_with_JMeter&amp;diff=59001"/>
		<updated>2021-06-25T20:44:37Z</updated>

		<summary type="html">&lt;p&gt;Ratna: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;br /&gt;
This article is a stub until we collect enough information about the developments since [https://docs.moodle.org/dev/index.php?title=JMeter&amp;amp;oldid=35771 previous update in 2012]. All improvements are welcome!&lt;br /&gt;
&lt;br /&gt;
You can also add your comments to the [https://docs.moodle.org/dev/index.php?title=Talk:JMeter&amp;amp;action=edit&amp;amp;redlink=1 discussion page] or to the the [https://moodle.org/mod/forum/discuss.php?d=395002 discussion in the General developer forum].&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr/ &amp;gt;&lt;br /&gt;
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,  &#039;&#039;Make test course&#039;&#039;&#039;  and &#039;&#039;Make JMeter test plan&#039;&#039;, both under &#039;&#039;Site administration &amp;gt; Development&#039;&#039;, augmented by a set of add-ons [https://github.com/moodlehq/moodle-performance-comparison Moodle performance comparison]. This document is about using the two built-in scripts with JMeter.&lt;br /&gt;
&lt;br /&gt;
Warning:  Do not run these scripts on a production system! These scripts generate data and load the server to its limit and beyond, making it to bloat and become non-responsive. Don&#039;t even run them on a separate Moodle instance in the production server: their effect on the DBMS is undocumented.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;h2&amp;gt;Make test course&amp;lt;/h2&amp;gt;&lt;br /&gt;
This tool creates standard test courses that include many sections, activities, and files. This is intended to provide a standardized measure for checking the reliability and performance of various system components (such as backup and restore). This test is important because there have been many cases previously where, faced with real-life use cases (e.g. a course with 1,000 activities), the system does not work.&lt;br /&gt;
&lt;br /&gt;
Courses created using this feature can occupy a large amount of database and filesystem space (tens of gigabytes). You will need to delete the courses (and wait for various cleanup runs) to release this space again.&lt;br /&gt;
&lt;br /&gt;
Once you have set the debugging level under &#039;&#039;Site administration &amp;gt; Development &amp;gt; Debugging&#039;&#039; to DEVELOPER, visit &#039;&#039;Site administration &amp;gt; Development &amp;gt; Make test course&#039;&#039;. You have the choice between XS (~10 KB; create in ~1 second), S (~10 KB, create in ~30 secends), M (~100 KB, create in ~2 minutes), L (~1 GB, create in ~30 minutes), XL (~10 GB, create in ~2 hours) and XXL (~20 GB, created in ~4 hours).&lt;br /&gt;
&lt;br /&gt;
Output:&lt;br /&gt;
  Creating course&lt;br /&gt;
  Creating [Course name]&lt;br /&gt;
  Creating assignments (100): . . . . . . . . . . . . done (12.7s)&lt;br /&gt;
  Creating pages (200): . . done (1.5s)&lt;br /&gt;
  Creating small files (128): done (0.4s)&lt;br /&gt;
  Creating big files (5): . done (1.3s)&lt;br /&gt;
  Checking user accounts (1000)&lt;br /&gt;
  Creating user accounts (1 - 1000): . . . . . . . . done (8.7s)&lt;br /&gt;
  Enrolling users into course (1000): . . . . . . done (5.7s)&lt;br /&gt;
  Creating forum (500 posts): . . done (1.7s)&lt;br /&gt;
  Course completed (32.2s)&lt;br /&gt;
&lt;br /&gt;
The final Continue will give you a view of the course thus created.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;h2&amp;gt;Make JMeter test plan&amp;lt;/h2&amp;gt;&lt;br /&gt;
This tool creates a JMeter test plan file along with the user credentials file. Here too it is necessary to set &#039;&#039;Site administration &amp;gt; Development &amp;gt; Debugging&#039;&#039; to DEVELOPER. Also note that, unlike making the test course, this is a single script. To the PHP max_execution_time need to be at least as long as the time for the whole script, which could be anything from a minute to hours depending on the size of the course you select.&lt;br /&gt;
&lt;br /&gt;
This test plan is designed to work along with [https://github.com/moodlehq/moodle-performance-comparison Moodle performance comparison], which makes easier to run the test plan in a specific Moodle environment, gathers information about the runs and compares the results, so you will need to download it and use it&#039;s test_runner.sh script or follow the installation and usage instructions.&lt;br /&gt;
&lt;br /&gt;
You need to set the same password for all the test users by adding the linke &#039;&#039;$CFG-&amp;gt;tool_generator_users_password = &#039;moodle&#039;;&#039; to config.php of Moodle. You might want to set &#039;$CFG-&amp;gt;passwordpolicy = 0;&#039; too in case the proposed user password conflicts with the password policy of the site.&lt;br /&gt;
&lt;br /&gt;
There is no default value for this password to prevent unintended usages of the tool. You need to use the update passwords option in case your course users have other passwords or they were generated by tool_generator but without setting a $CFG-&amp;gt;tool_generator_users_password value.&lt;br /&gt;
&lt;br /&gt;
It is part of tool_generator so it works well with the courses generated by the courses and the site generators, it can also be used with any course that contains, at least:&lt;br /&gt;
- Enough enrolled users (depends on the test plan size you select) with the password reset to &#039;moodle&#039;&lt;br /&gt;
- A page module instance&lt;br /&gt;
- A forum module instance with at least one discussion and one reply&lt;br /&gt;
&lt;br /&gt;
You might want to consider your servers capacity when running large test plans as the amount to load generated by JMeter can be specially big. The ramp up period has been adjusted according to the number of threads (users) to reduce this kind of issues but the load is still huge.&lt;br /&gt;
&lt;br /&gt;
Visit  &#039;&#039;Site administration &amp;gt; Development &amp;gt; Make JMeter test plan&#039;&#039;. Under Size of course your have six possibilities: XS (1 user, 5 loops and 1 rampup period), S (30 users, 5 loops and 6 rampup period), M (100 users, 5 loops and 40 rampup period), L (1000 users, 6 loops and 100 rampup period), XL (5000 users, 6 loops and 500 rampup period) and XXL (1000 users, 7 loops and 800 rampup period). As target course select one of the courses created above. Also &#039;&#039;Update course users password&#039;&#039; should be ticked. &lt;br /&gt;
&lt;br /&gt;
Once successful you can download a test plan [[File:testplan_timestamp.jmx|testplan_timestamp.jmx]] and a users file [[File:users_timestamp.csv|users_timestamp.csv]] &lt;br /&gt;
&lt;br /&gt;
  $ php admin/tool/generator/cli/maketestplan.php --help&lt;br /&gt;
  Options:&lt;br /&gt;
  -h, --help              Print out this help&lt;br /&gt;
  --shortname             Shortname of the test plan&#039;s target course (required)&lt;br /&gt;
  --size                  Size of the test plan to create XS, S, M, L, XL, or XXL (required)&lt;br /&gt;
  --bypasscheck           Bypasses the developer-mode check (be careful!)&lt;br /&gt;
  --updateuserspassword   Updates the target course users password according to $CFG-&amp;gt;tool_generator_users_password&lt;br /&gt;
  &lt;br /&gt;
  * XS (1 Nutzter, 5 Schleifen und 1 Steigerungsrate)&lt;br /&gt;
  * S (30 Nutzter, 5 Schleifen und 6 Steigerungsrate)&lt;br /&gt;
  * M (100 Nutzter, 5 Schleifen und 40 Steigerungsrate)&lt;br /&gt;
  * L (1000 Nutzter, 6 Schleifen und 100 Steigerungsrate)&lt;br /&gt;
  * XL (5000 Nutzter, 6 Schleifen und 500 Steigerungsrate)&lt;br /&gt;
  * XXL (10000 Nutzter, 7 Schleifen und 800 Steigerungsrate)&lt;br /&gt;
  &lt;br /&gt;
  Consider that, the server resources you will need to run the test plan will be higher as the test plan size is higher.&lt;br /&gt;
  &lt;br /&gt;
  Example from Moodle root directory: &lt;br /&gt;
  $ sudo -u www-data /usr/bin/php admin/tool/generator/cli/maketestplan.php --shortname=&amp;quot;testcourse_12&amp;quot; --size=S&lt;br /&gt;
&lt;br /&gt;
&amp;lt;h2&amp;gt;Running the test plan on JMeter&amp;lt;/h2&amp;gt;&lt;br /&gt;
JMeter is a Java application so it can run on Windows, Mac, or Linux. It can be run on the command line on a server  but you should also install a graphical user interface version on your desktop. You can check if Java is installed by opening a console and entering:&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
java -version&amp;lt;/code&amp;gt;&lt;br /&gt;
If it doesn&#039;t return a version, go to the [https://www.java.com/ Java] site and install.&lt;br /&gt;
&lt;br /&gt;
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.&lt;br /&gt;
&lt;br /&gt;
To run JMeter. open the /bin subdirectory and use either jmeter.bat on Windows or ./jmeter on Linux. This will open the JMeter GUI.&lt;br /&gt;
&lt;br /&gt;
First step is to go to File -&amp;gt; Open and select the testplan.jmx file. This will open a tree on the left hand side of JMeter. &lt;br /&gt;
Open the Warm-up site -&amp;gt; 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. &amp;lt;b&amp;gt;Repeat &amp;lt;/b&amp;gt; this for Moodle Test.&lt;br /&gt;
&lt;br /&gt;
Right mouse click on the Test Plan, then Add -&amp;gt; Listener. I choose Aggregate Report so I can follow the run as it happens. Save the changes in your test plan and run it.&lt;br /&gt;
&lt;br /&gt;
==See also==&lt;br /&gt;
*[http://jmeter.apache.org/ Apache JMeter homepage]&lt;br /&gt;
*[https://moodle.org/mod/forum/discuss.php?d=377231 Jmeter or loading script/app to simulate concurrent users takng quizzes] (October 2018)&lt;br /&gt;
*[https://moodle.org/mod/forum/discuss.php?d=368620 Has anyone successfully run a jmeter test with 1000 users?] (April 2018)&lt;br /&gt;
&lt;br /&gt;
[[Category:Developer tools]]&lt;/div&gt;</summary>
		<author><name>Ratna</name></author>
	</entry>
	<entry>
		<id>https://docs.moodle.org/dev/index.php?title=Load_testing_Moodle_with_JMeter&amp;diff=58161</id>
		<title>Load testing Moodle with JMeter</title>
		<link rel="alternate" type="text/html" href="https://docs.moodle.org/dev/index.php?title=Load_testing_Moodle_with_JMeter&amp;diff=58161"/>
		<updated>2020-12-08T18:17:20Z</updated>

		<summary type="html">&lt;p&gt;Ratna: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;br /&gt;
This article is a stub until we collect enough information about the developments since [https://docs.moodle.org/dev/index.php?title=JMeter&amp;amp;oldid=35771 previous update in 2012]. All improvements are welcome!&lt;br /&gt;
&lt;br /&gt;
You can also add your comments to the [https://docs.moodle.org/dev/index.php?title=Talk:JMeter&amp;amp;action=edit&amp;amp;redlink=1 discussion page] or to the the [https://moodle.org/mod/forum/discuss.php?d=395002 discussion in the General developer forum].&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr/ &amp;gt;&lt;br /&gt;
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,  &#039;&#039;Make test course&#039;&#039;&#039;  and &#039;&#039;Make JMeter test plan&#039;&#039;, both under &#039;&#039;Site administration &amp;gt; Development&#039;&#039;, augmented by a set of add-ons [https://github.com/moodlehq/moodle-performance-comparison Moodle performance comparison]. This document is about using the two built-in scripts with JMeter.&lt;br /&gt;
&lt;br /&gt;
Warning:  Do not run these scripts on a production system! These scripts generate data and load the server to its limit and beyond, making it to bloat and become non-responsive. Don&#039;t even run them on a separate Moodle instance in the production server: their effect on the DBMS is undocumented.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;h2&amp;gt;Make test course&amp;lt;/h2&amp;gt;&lt;br /&gt;
This tool creates standard test courses that include many sections, activities, and files. This is intended to provide a standardized measure for checking the reliability and performance of various system components (such as backup and restore). This test is important because there have been many cases previously where, faced with real-life use cases (e.g. a course with 1,000 activities), the system does not work.&lt;br /&gt;
&lt;br /&gt;
Courses created using this feature can occupy a large amount of database and filesystem space (tens of gigabytes). You will need to delete the courses (and wait for various cleanup runs) to release this space again.&lt;br /&gt;
&lt;br /&gt;
Once you have set the debugging level under &#039;&#039;Site administration &amp;gt; Development &amp;gt; Debugging&#039;&#039; to DEVELOPER, visit &#039;&#039;Site administration &amp;gt; Development &amp;gt; Make test course&#039;&#039;. You have the choice between XS (~10 KB; create in ~1 second), S (~10 KB, create in ~30 secends), M (~100 KB, create in ~2 minutes), L (~1 GB, create in ~30 minutes), XL (~10 GB, create in ~2 hours) and XXL (~20 GB, created in ~4 hours).&lt;br /&gt;
&lt;br /&gt;
Output:&lt;br /&gt;
  Creating course&lt;br /&gt;
  Creating [Course name]&lt;br /&gt;
  Creating assignments (100): . . . . . . . . . . . . done (12.7s)&lt;br /&gt;
  Creating pages (200): . . done (1.5s)&lt;br /&gt;
  Creating small files (128): done (0.4s)&lt;br /&gt;
  Creating big files (5): . done (1.3s)&lt;br /&gt;
  Checking user accounts (1000)&lt;br /&gt;
  Creating user accounts (1 - 1000): . . . . . . . . done (8.7s)&lt;br /&gt;
  Enrolling users into course (1000): . . . . . . done (5.7s)&lt;br /&gt;
  Creating forum (500 posts): . . done (1.7s)&lt;br /&gt;
  Course completed (32.2s)&lt;br /&gt;
&lt;br /&gt;
The final Continue will give you a view of the course thus created.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;h2&amp;gt;Make JMeter test plan&amp;lt;/h2&amp;gt;&lt;br /&gt;
This tool creates a JMeter test plan file along with the user credentials file. Here too it is necessary to set &#039;&#039;Site administration &amp;gt; Development &amp;gt; Debugging&#039;&#039; to DEVELOPER. Also note that, unlike making the test course, this is a single script. To the PHP max_execution_time need to be at least as long as the time for the whole script, which could be anything from a minute to hours depending on the size of the course you select.&lt;br /&gt;
&lt;br /&gt;
This test plan is designed to work along with [https://github.com/moodlehq/moodle-performance-comparison Moodle performance comparison], which makes easier to run the test plan in a specific Moodle environment, gathers information about the runs and compares the results, so you will need to download it and use it&#039;s test_runner.sh script or follow the installation and usage instructions.&lt;br /&gt;
&lt;br /&gt;
You need to set the same password for all the test users by adding the linke &#039;&#039;$CFG-&amp;gt;tool_generator_users_password = &#039;moodle&#039;;&#039; to config.php of Moodle. You might want to set &#039;$CFG-&amp;gt;passwordpolicy = 0;&#039; too in case the proposed user password conflicts with the password policy of the site.&lt;br /&gt;
&lt;br /&gt;
There is no default value for this password to prevent unintended usages of the tool. You need to use the update passwords option in case your course users have other passwords or they were generated by tool_generator but without setting a $CFG-&amp;gt;tool_generator_users_password value.&lt;br /&gt;
&lt;br /&gt;
It is part of tool_generator so it works well with the courses generated by the courses and the site generators, it can also be used with any course that contains, at least:&lt;br /&gt;
- Enough enrolled users (depends on the test plan size you select) with the password reset to &#039;moodle&#039;&lt;br /&gt;
- A page module instance&lt;br /&gt;
- A forum module instance with at least one discussion and one reply&lt;br /&gt;
&lt;br /&gt;
You might want to consider your servers capacity when running large test plans as the amount to load generated by JMeter can be specially big. The ramp up period has been adjusted according to the number of threads (users) to reduce this kind of issues but the load is still huge.&lt;br /&gt;
&lt;br /&gt;
Visit  &#039;&#039;Site administration &amp;gt; Development &amp;gt; Make JMeter test plan&#039;&#039;. Under Size of course your have six possibilities: XS (1 user, 5 loops and 1 rampup period), S (30 users, 5 loops and 6 rampup period), M (100 users, 5 loops and 40 rampup period), L (1000 users, 6 loops and 100 rampup period), XL (5000 users, 6 loops and 500 rampup period) and XXL (1000 users, 7 loops and 800 rampup period). As target course select one of the courses created above. Also &#039;&#039;Update course users password&#039;&#039; should be ticked. &lt;br /&gt;
&lt;br /&gt;
Once successful you can download a test plan [[File:testplan_timestamp.jmx|testplan_timestamp.jmx]] and a users file [[File:users_timestamp.csv|users_timestamp.csv]] &lt;br /&gt;
&lt;br /&gt;
  $ php admin/tool/generator/cli/maketestplan.php --help&lt;br /&gt;
  Options:&lt;br /&gt;
  -h, --help              Print out this help&lt;br /&gt;
  --shortname             Shortname of the test plan&#039;s target course (required)&lt;br /&gt;
  --size                  Size of the test plan to create XS, S, M, L, XL, or XXL (required)&lt;br /&gt;
  --bypasscheck           Bypasses the developer-mode check (be careful!)&lt;br /&gt;
  --updateuserspassword   Updates the target course users password according to $CFG-&amp;gt;tool_generator_users_password&lt;br /&gt;
  &lt;br /&gt;
  * XS (1 Nutzter, 5 Schleifen und 1 Steigerungsrate)&lt;br /&gt;
  * S (30 Nutzter, 5 Schleifen und 6 Steigerungsrate)&lt;br /&gt;
  * M (100 Nutzter, 5 Schleifen und 40 Steigerungsrate)&lt;br /&gt;
  * L (1000 Nutzter, 6 Schleifen und 100 Steigerungsrate)&lt;br /&gt;
  * XL (5000 Nutzter, 6 Schleifen und 500 Steigerungsrate)&lt;br /&gt;
  * XXL (10000 Nutzter, 7 Schleifen und 800 Steigerungsrate)&lt;br /&gt;
  &lt;br /&gt;
  Consider that, the server resources you will need to run the test plan will be higher as the test plan size is higher.&lt;br /&gt;
  &lt;br /&gt;
  Example from Moodle root directory: &lt;br /&gt;
  $ sudo -u www-data /usr/bin/php admin/tool/generator/cli/maketestplan.php --shortname=&amp;quot;testcourse_12&amp;quot; --size=S&lt;br /&gt;
&lt;br /&gt;
&amp;lt;h2&amp;gt;Running the test plan on JMeter&amp;lt;/h2&amp;gt;&lt;br /&gt;
JMeter is a Java application so it can run on Windows, Mac, or Linux. It can be run on the command line on a server  but you should also install a graphical user interface version on your desktop. You can check if Java is installed by opening a console and entering:&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
java -version&amp;lt;/code&amp;gt;&lt;br /&gt;
If it doesn&#039;t return a version, go to the [https://www.java.com/ Java] site and install.&lt;br /&gt;
&lt;br /&gt;
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.&lt;br /&gt;
&lt;br /&gt;
To run JMeter. open the /bin subdirectory and use either jmeter.bat on Windows or ./jmeter on Linux. This will open the JMeter GUI.&lt;br /&gt;
&lt;br /&gt;
First step is to go to File -&amp;gt; Open and select the testplan.jmx file. This will open a tree on the left hand side of JMeter. &lt;br /&gt;
Open the Warm-up site -&amp;gt; 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. &amp;lt;b&amp;gt;Repeat &amp;lt;/b&amp;gt; this for Moodle Test.&lt;br /&gt;
&lt;br /&gt;
Right mouse click on the Test Plan, then Add -&amp;gt; Listener. I choose Aggregate Report so I can follow the run as it happens. Save the changes in your test plan and run it.&lt;br /&gt;
&lt;br /&gt;
==See also==&lt;br /&gt;
*[http://jmeter.apache.org/jmeter/ Apache JMeter homepage]&lt;br /&gt;
*[https://moodle.org/mod/forum/discuss.php?d=377231 Jmeter or loading script/app to simulate concurrent users takng quizzes] (October 2018)&lt;br /&gt;
*[https://moodle.org/mod/forum/discuss.php?d=368620 Has anyone successfully run a jmeter test with 1000 users?] (April 2018)&lt;br /&gt;
&lt;br /&gt;
[[Category:Developer tools]]&lt;/div&gt;</summary>
		<author><name>Ratna</name></author>
	</entry>
	<entry>
		<id>https://docs.moodle.org/dev/index.php?title=Load_testing_Moodle_with_JMeter&amp;diff=57531</id>
		<title>Load testing Moodle with JMeter</title>
		<link rel="alternate" type="text/html" href="https://docs.moodle.org/dev/index.php?title=Load_testing_Moodle_with_JMeter&amp;diff=57531"/>
		<updated>2020-05-23T08:41:57Z</updated>

		<summary type="html">&lt;p&gt;Ratna: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;br /&gt;
This article is a stub until we collect enough information about the developments since [https://docs.moodle.org/dev/index.php?title=JMeter&amp;amp;oldid=35771 previous update in 2012]. All improvements are welcome!&lt;br /&gt;
&lt;br /&gt;
You can also add your comments to the [https://docs.moodle.org/dev/index.php?title=Talk:JMeter&amp;amp;action=edit&amp;amp;redlink=1 discussion page] or to the the [https://moodle.org/mod/forum/discuss.php?d=395002 discussion in the General developer forum].&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr/ &amp;gt;&lt;br /&gt;
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,  &amp;quot;&amp;quot;Make test course&#039;&#039;&#039;  and &#039;&#039;&#039;Make JMeter test plan&#039;&#039;&#039;, both under Site administration &amp;gt; Development, augmented by a set of add-ons [https://github.com/moodlehq/moodle-performance-comparison Moodle performance comparison]. This document is about using the two built-in scripts with JMeter.&lt;br /&gt;
&lt;br /&gt;
Warning:  &#039;&#039;&#039;Do not run these scripts on a production system!&#039;&#039;&#039; These scripts generate data and load the server to its limit and beyond, making it to bloat and become non-reponsive. Don&#039;t even run them on a separate Moodle instance in the production server: their effect on the DBMS is undocumented.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;h2&amp;gt;Make test course&amp;lt;/h2&amp;gt;&lt;br /&gt;
This tool creates standard test courses that include many sections, activities, and files. This is intended to provide a standardised measure for checking the reliability and performance of various system components (such as backup and restore). This test is important because there have been many cases previously where, faced with real-life use cases (e.g. a course with 1,000 activities), the system does not work.&lt;br /&gt;
&lt;br /&gt;
Courses created using this feature can occupy a large amount of database and filesystem space (tens of gigabytes). You will need to delete the courses (and wait for various cleanup runs) to release this space again.&lt;br /&gt;
&lt;br /&gt;
Once you have set the debugging level Site administration &amp;gt; Development &amp;gt; Debugging: Debug messages = DEVELOPER: extra Moodle debug messages for developers, visit Site administration &amp;gt; Development &amp;gt; Make test course. You have the choice between XS (~10 KB; create in ~1 second), S (~10 KB, create in ~30 secends), M (~100 KB, create in ~2 minutes), L (~1 GB, create in ~30 minutes), XL (~10 GB, create in ~2 hours) and XXL (~20 GB, created in ~4 hours).&lt;br /&gt;
&lt;br /&gt;
Output:&lt;br /&gt;
  Creating course&lt;br /&gt;
  Creating [Course name]&lt;br /&gt;
  Creating assignments (100): . . . . . . . . . . . . done (12.7s)&lt;br /&gt;
  Creating pages (200): . . done (1.5s)&lt;br /&gt;
  Creating small files (128): done (0.4s)&lt;br /&gt;
  Creating big files (5): . done (1.3s)&lt;br /&gt;
  Checking user accounts (1000)&lt;br /&gt;
  Creating user accounts (1 - 1000): . . . . . . . . done (8.7s)&lt;br /&gt;
  Enrolling users into course (1000): . . . . . . done (5.7s)&lt;br /&gt;
  Creating forum (500 posts): . . done (1.7s)&lt;br /&gt;
  Course completed (32.2s)&lt;br /&gt;
&lt;br /&gt;
The final Continue will give you a view of the course thus created.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;h2&amp;gt;Make JMeter test plan&amp;lt;/h2&amp;gt;&lt;br /&gt;
This tool creates a JMeter test plan file along with the user credentials file.&lt;br /&gt;
&lt;br /&gt;
This test plan is designed to work along with [https://github.com/moodlehq/moodle-performance-comparison Moodle performance comparison], which makes easier to run the test plan in a specific Moodle environment, gathers information about the runs and compares the results, so you will need to download it and use it&#039;s test_runner.sh script or follow the installation and usage instructions.&lt;br /&gt;
&lt;br /&gt;
You need to set a password for the course users in config.php (e.g. $CFG-&amp;gt;tool_generator_users_password = &#039;moodle&#039;;). You might want to set $CFG-&amp;gt;passwordpolicy = 0; in your config.php if the proposed user password conflicts with the password policy of the site.&lt;br /&gt;
&lt;br /&gt;
There is no default value for this password to prevent unintended usages of the tool. You need to use the update passwords option in case your course users have other passwords or they were generated by tool_generator but without setting a $CFG-&amp;gt;tool_generator_users_password value.&lt;br /&gt;
&lt;br /&gt;
It is part of tool_generator so it works well with the courses generated by the courses and the site generators, it can also be used with any course that contains, at least:&lt;br /&gt;
- Enough enrolled users (depends on the test plan size you select) with the password reset to &#039;moodle&#039;&lt;br /&gt;
- A page module instance&lt;br /&gt;
- A forum module instance with at least one discussion and one reply&lt;br /&gt;
&lt;br /&gt;
You might want to consider your servers capacity when running large test plans as the amount to load generated by JMeter can be specially big. The ramp up period has been adjusted according to the number of threads (users) to reduce this kind of issues but the load is still huge.&lt;br /&gt;
&lt;br /&gt;
Visit  Site administration &amp;gt; Development &amp;gt; Make JMeter test plan. Under Size of course your have six possibilities: XS (1 user, 5 loops and 1 rampup period), S (30 users, 5 loops and 6 rampup period), M (100 users, 5 loops and 40 rampup period), L (1000 users, 6 loops and 100 rampup period), XL (5000 users, 6 loops and 500 rampup period) and XXL (1000 users, 7 loops and 800 rampup period). As target course select one of the courses created above.&lt;br /&gt;
Update course users password: ticked. &lt;br /&gt;
&lt;br /&gt;
Once successful you can download a test plan [[File:testplan_timestamp.jmx|testplan_timestamp.jmx]] and a users file [[File:users_timestamp.csv|users_timestamp.csv]] &lt;br /&gt;
&lt;br /&gt;
  $ php admin/tool/generator/cli/maketestplan.php --help&lt;br /&gt;
  Options:&lt;br /&gt;
  -h, --help              Print out this help&lt;br /&gt;
  --shortname             Shortname of the test plan&#039;s target course (required)&lt;br /&gt;
  --size                  Size of the test plan to create XS, S, M, L, XL, or XXL (required)&lt;br /&gt;
  --bypasscheck           Bypasses the developer-mode check (be careful!)&lt;br /&gt;
  --updateuserspassword   Updates the target course users password according to $CFG-&amp;gt;tool_generator_users_password&lt;br /&gt;
  &lt;br /&gt;
  * XS (1 Nutzter, 5 Schleifen und 1 Steigerungsrate)&lt;br /&gt;
  * S (30 Nutzter, 5 Schleifen und 6 Steigerungsrate)&lt;br /&gt;
  * M (100 Nutzter, 5 Schleifen und 40 Steigerungsrate)&lt;br /&gt;
  * L (1000 Nutzter, 6 Schleifen und 100 Steigerungsrate)&lt;br /&gt;
  * XL (5000 Nutzter, 6 Schleifen und 500 Steigerungsrate)&lt;br /&gt;
  * XXL (10000 Nutzter, 7 Schleifen und 800 Steigerungsrate)&lt;br /&gt;
  &lt;br /&gt;
  Consider that, the server resources you will need to run the test plan will be higher as the test plan size is higher.&lt;br /&gt;
  &lt;br /&gt;
  Example from Moodle root directory: &lt;br /&gt;
  $ sudo -u www-data /usr/bin/php admin/tool/generator/cli/maketestplan.php --shortname=&amp;quot;testcourse_12&amp;quot; --size=S&lt;br /&gt;
&lt;br /&gt;
&amp;lt;h2&amp;gt;Running the test plan on JMeter&amp;lt;/h2&amp;gt;&lt;br /&gt;
(to be filled)&lt;br /&gt;
&lt;br /&gt;
==See also==&lt;br /&gt;
*[http://jmeter.apache.org/jmeter/ Apache JMeter homepage]&lt;br /&gt;
*[https://moodle.org/mod/forum/discuss.php?d=377231 Jmeter or loading script/app to simulate concurrent users takng quizzes] (October 2018)&lt;br /&gt;
*[https://moodle.org/mod/forum/discuss.php?d=368620 Has anyone successfully run a jmeter test with 1000 users?] (April 2018)&lt;br /&gt;
&lt;br /&gt;
[[Category:Developer tools]]&lt;/div&gt;</summary>
		<author><name>Ratna</name></author>
	</entry>
	<entry>
		<id>https://docs.moodle.org/dev/index.php?title=Load_testing_Moodle_with_JMeter&amp;diff=57485</id>
		<title>Load testing Moodle with JMeter</title>
		<link rel="alternate" type="text/html" href="https://docs.moodle.org/dev/index.php?title=Load_testing_Moodle_with_JMeter&amp;diff=57485"/>
		<updated>2020-05-18T22:03:46Z</updated>

		<summary type="html">&lt;p&gt;Ratna: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;br /&gt;
This article is a stub until we collect enough information about the developments since [https://docs.moodle.org/dev/index.php?title=JMeter&amp;amp;oldid=35771 previous update in 2012]. All improvements are welcome!&lt;br /&gt;
&lt;br /&gt;
You can also add your comments to the [https://docs.moodle.org/dev/index.php?title=Talk:JMeter&amp;amp;action=edit&amp;amp;redlink=1 discussion page] or to the the [https://moodle.org/mod/forum/discuss.php?d=395002 discussion in the General developer forum].&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr/ &amp;gt;&lt;br /&gt;
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,  &amp;quot;&amp;quot;Make test course&#039;&#039;&#039;  and &#039;&#039;&#039;Make JMeter test plan&#039;&#039;&#039;, both under Site administration &amp;gt; Development, augmented by a set of add-ons [https://github.com/moodlehq/moodle-performance-comparison Moodle performance comparison]. This document is about using the two built-in scripts with JMeter.&lt;br /&gt;
&lt;br /&gt;
Warning:  &#039;&#039;&#039;Do not run these scripts on a production system!&#039;&#039;&#039; These scripts generate data and load the server to its limit and beyond, making it to bloat and become non-reponsive. Don&#039;t even run them on a separate Moodle instance in the production server: their effect on the DBMS is undocumented.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;h2&amp;gt;Make test course&amp;lt;/h2&amp;gt;&lt;br /&gt;
This tool creates standard test courses that include many sections, activities, and files. This is intended to provide a standardised measure for checking the reliability and performance of various system components (such as backup and restore). This test is important because there have been many cases previously where, faced with real-life use cases (e.g. a course with 1,000 activities), the system does not work.&lt;br /&gt;
&lt;br /&gt;
Courses created using this feature can occupy a large amount of database and filesystem space (tens of gigabytes). You will need to delete the courses (and wait for various cleanup runs) to release this space again.&lt;br /&gt;
&lt;br /&gt;
Once you have set the debugging level Site administration &amp;gt; Development &amp;gt; Debugging: Debug messages = DEVELOPER: extra Moodle debug messages for developers, visit Site administration &amp;gt; Development &amp;gt; Make test course. You have the choice between XS (~10 KB; create in ~1 second), S (~10 KB, create in ~30 secends), M (~100 KB, create in ~2 minutes), L (~1 GB, create in ~30 minutes), XL (~10 GB, create in ~2 hours) and XXL (~20 GB, created in ~4 hours).&lt;br /&gt;
&lt;br /&gt;
Output:&lt;br /&gt;
Creating course&lt;br /&gt;
    Creating [Course name]&lt;br /&gt;
    Creating assignments (100): . . . . . . . . . . . . done (12.7s)&lt;br /&gt;
    Creating pages (200): . . done (1.5s)&lt;br /&gt;
    Creating small files (128): done (0.4s)&lt;br /&gt;
    Creating big files (5): . done (1.3s)&lt;br /&gt;
    Checking user accounts (1000)&lt;br /&gt;
    Creating user accounts (1 - 1000): . . . . . . . . done (8.7s)&lt;br /&gt;
    Enrolling users into course (1000): . . . . . . done (5.7s)&lt;br /&gt;
    Creating forum (500 posts): . . done (1.7s)&lt;br /&gt;
    Course completed (32.2s)&lt;br /&gt;
&lt;br /&gt;
The final Continue will give you a view of the course thus created.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;h2&amp;gt;Make JMeter test plan&amp;lt;/h2&amp;gt;&lt;br /&gt;
This tool creates a JMeter test plan file along with the user credentials file.&lt;br /&gt;
&lt;br /&gt;
This test plan is designed to work along with [https://github.com/moodlehq/moodle-performance-comparison Moodle performance comparison], which makes easier to run the test plan in a specific Moodle environment, gathers information about the runs and compares the results, so you will need to download it and use it&#039;s test_runner.sh script or follow the installation and usage instructions.&lt;br /&gt;
&lt;br /&gt;
You need to set a password for the course users in config.php (e.g. $CFG-&amp;gt;tool_generator_users_password = &#039;moodle&#039;;). You might want to set $CFG-&amp;gt;passwordpolicy = 0; in your config.php if the proposed user password conflicts with the password policy of the site.&lt;br /&gt;
&lt;br /&gt;
There is no default value for this password to prevent unintended usages of the tool. You need to use the update passwords option in case your course users have other passwords or they were generated by tool_generator but without setting a $CFG-&amp;gt;tool_generator_users_password value.&lt;br /&gt;
&lt;br /&gt;
It is part of tool_generator so it works well with the courses generated by the courses and the site generators, it can also be used with any course that contains, at least:&lt;br /&gt;
&lt;br /&gt;
    Enough enrolled users (depends on the test plan size you select) with the password reset to &#039;moodle&#039;&lt;br /&gt;
    A page module instance&lt;br /&gt;
    A forum module instance with at least one discussion and one reply&lt;br /&gt;
&lt;br /&gt;
You might want to consider your servers capacity when running large test plans as the amount to load generated by JMeter can be specially big. The ramp up period has been adjusted according to the number of threads (users) to reduce this kind of issues but the load is still huge.&lt;br /&gt;
&lt;br /&gt;
Visit  Site administration &amp;gt; Development &amp;gt; Make JMeter test plan. Under Size of course your have six possibilities: XS (1 user, 5 loops and 1 rampup period), S (30 users, 5 loops and 6 rampup period), M (100 users, 5 loops and 40 rampup period), L (1000 users, 6 loops and 100 rampup period), XL (5000 users, 6 loops and 500 rampup period) and XXL (1000 users, 7 loops and 800 rampup period). As target course select one of the courses created above.&lt;br /&gt;
Update course users password: ticked. &lt;br /&gt;
&lt;br /&gt;
Once successful you can download a test plan [[File:testplan_timestamp.jmx|testplan_timestamp.jmx]] and a users file [[File:users_timestamp.csv|users_timestamp.csv]] &lt;br /&gt;
&lt;br /&gt;
&amp;lt;h2&amp;gt;Running the test plan on JMeter&amp;lt;/h2&amp;gt;&lt;br /&gt;
(to be filled)&lt;br /&gt;
&lt;br /&gt;
==See also==&lt;br /&gt;
*[http://jmeter.apache.org/jmeter/ Apache JMeter homepage]&lt;br /&gt;
*[https://moodle.org/mod/forum/discuss.php?d=377231 Jmeter or loading script/app to simulate concurrent users takng quizzes] (October 2018)&lt;br /&gt;
*[https://moodle.org/mod/forum/discuss.php?d=368620 Has anyone successfully run a jmeter test with 1000 users?] (April 2018)&lt;br /&gt;
&lt;br /&gt;
[[Category:Developer tools]]&lt;/div&gt;</summary>
		<author><name>Ratna</name></author>
	</entry>
	<entry>
		<id>https://docs.moodle.org/dev/index.php?title=Load_testing_Moodle_with_JMeter&amp;diff=56973</id>
		<title>Load testing Moodle with JMeter</title>
		<link rel="alternate" type="text/html" href="https://docs.moodle.org/dev/index.php?title=Load_testing_Moodle_with_JMeter&amp;diff=56973"/>
		<updated>2020-03-03T20:55:34Z</updated>

		<summary type="html">&lt;p&gt;Ratna: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;br /&gt;
This article is a stub until we collect enough information about the developments since [https://docs.moodle.org/dev/index.php?title=JMeter&amp;amp;oldid=35771 previous update in 2012]. All improvements are welcome!&lt;br /&gt;
&lt;br /&gt;
You can also add your comments to the [https://docs.moodle.org/dev/index.php?title=Talk:JMeter&amp;amp;action=edit&amp;amp;redlink=1 discussion page] or to the the [https://moodle.org/mod/forum/discuss.php?d=395002 discussion in the General developer forum].&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr/ &amp;gt;&lt;br /&gt;
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, (Site administration &amp;gt; Development &amp;gt;) &amp;quot;&amp;quot;Make test course&#039;&#039;&#039;  and (dito &amp;gt;) &#039;&#039;&#039;Make JMeter test plan&#039;&#039;&#039;, 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.&lt;br /&gt;
&lt;br /&gt;
Warning:  &#039;&#039;&#039;Do not run these scripts on a production system!&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
These scripts generate data and load the server to its limit and beyond, making it to bloat and become nonreponsive. Don&#039;t even run them on a separate Moodle instance in the production server: their effect on the DBMS is undocumented.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;h2&amp;gt;Make test course&amp;lt;/h2&amp;gt;&lt;br /&gt;
This tool creates standard test courses that include many sections, activities, and files. This is intended to provide a standardised measure for checking the reliability and performance of various system components (such as backup and restore). This test is important because there have been many cases previously where, faced with real-life use cases (e.g. a course with 1,000 activities), the system does not work. Courses created using this feature can occupy a large amount of database and filesystem space (tens of gigabytes). You will need to delete the courses (and wait for various cleanup runs) to release this space again.&lt;br /&gt;
&lt;br /&gt;
Do not use this feature on a live system. Use only on a developer server. (To avoid accidental use, this feature is disabled unless you have also selected DEVELOPER debugging level.)&lt;br /&gt;
&lt;br /&gt;
Once you have set the debugging level Site administration &amp;gt; Development &amp;gt; Debugging: Debug messages = DEVELOPER: extra Moodle debug messages for developers, visit Site administration &amp;gt; Development &amp;gt; Make test course. You have the choice between XS (~10 KB; create in ~1 second), S (~10 KB, create in ~30 secends), M (~100 KB, create in ~2 minutes), L (~1 GB, create in ~30 minutes), XL (~10 GB, create in ~2 hours) and XXL (~20 GB, created in ~4 hours).&lt;br /&gt;
&lt;br /&gt;
Output:&lt;br /&gt;
Creating course&lt;br /&gt;
    Creating course [short name]&lt;br /&gt;
    Creating assignments (1): done (0.1s)&lt;br /&gt;
    Creating pages (1): done (0s)&lt;br /&gt;
    Creating small files (1): done (0s)&lt;br /&gt;
    Creating big files (1): done (0s)&lt;br /&gt;
    Checking user accounts (1)&lt;br /&gt;
    Creating user accounts (1 - 1): done (0s)&lt;br /&gt;
    Enrolling users into course (1): done (0s)&lt;br /&gt;
    Creating forum (2 posts): done (0s)&lt;br /&gt;
    Course completed (0.3s)&lt;br /&gt;
&lt;br /&gt;
&amp;lt;h2&amp;gt;Make JMeter test plan&amp;lt;/h2&amp;gt;&lt;br /&gt;
This tool creates a JMeter test plan file along with the user credentials file. This test plan is designed to work along with https://github.com/moodlehq/moodle-performance-comparison, which makes easier to run the test plan in a specific Moodle environment, gathers information about the runs and compares the results, so you will need to download it and use it&#039;s test_runner.sh script or follow the installation and usage instructions.&lt;br /&gt;
&lt;br /&gt;
You need to set a password for the course users in config.php (e.g. $CFG-&amp;gt;tool_generator_users_password = &#039;moodle&#039;;). There is no default value for this password to prevent unintended usages of the tool. You need to use the update passwords option in case your course users have other passwords or they were generated by tool_generator but without setting a $CFG-&amp;gt;tool_generator_users_password value.&lt;br /&gt;
&lt;br /&gt;
It is part of tool_generator so it works well with the courses generated by the courses and the site generators, it can also be used with any course that contains, at least:&lt;br /&gt;
&lt;br /&gt;
    Enough enrolled users (depends on the test plan size you select) with the password reset to &#039;moodle&#039;&lt;br /&gt;
    A page module instance&lt;br /&gt;
    A forum module instance with at least one discussion and one reply&lt;br /&gt;
&lt;br /&gt;
You might want to consider your servers capacity when running large test plans as the amount to load generated by JMeter can be specially big. The ramp up period has been adjusted according to the number of threads (users) to reduce this kind of issues but the load is still huge.&lt;br /&gt;
&lt;br /&gt;
Do not run the test plan on a live system. This feature only creates the files to feed JMeter so is not dangerous by itself, but you should NEVER run this test plan in a production site.&lt;br /&gt;
&lt;br /&gt;
Visit  Site administration &amp;gt; Development &amp;gt; Make JMeter test plan. Under Size of course your have six possibilities: XS (1 user, 5 loops and 1 rampup period), S (30 users, 5 loops and 6 rampup period), M (100 users, 5 loops and 40 rampup period), L (1000 users, 6 loops and 100 rampup period), XL (5000 users, 6 loops and 500 rampup period) and XXL (1000 users, 7 loops and 800 rampup period). As target course select one of the courses created above.&lt;br /&gt;
Update course users password: ticked. &lt;br /&gt;
&lt;br /&gt;
Now set $CFG-&amp;gt;tool_generator_users_password in config.php to generate the test plan. Once successful you can download a test plan (jmx file) [[File:users_timestamp.csv|users_timestamp.csv]] and a users file (csv)&lt;br /&gt;
&amp;lt;h2&amp;gt;Running the test plan on JMeter&amp;lt;/h2&amp;gt;&lt;br /&gt;
(to be filled)&lt;br /&gt;
&lt;br /&gt;
==See also==&lt;br /&gt;
*[http://jmeter.apache.org/jmeter/ Apache JMeter homepage]&lt;br /&gt;
*[https://moodle.org/mod/forum/discuss.php?d=377231 Jmeter or loading script/app to simulate concurrent users takng quizzes] (October 2018)&lt;br /&gt;
*[https://moodle.org/mod/forum/discuss.php?d=368620 Has anyone successfully run a jmeter test with 1000 users?] (April 2018)&lt;br /&gt;
&lt;br /&gt;
[[Category:Developer tools]]&lt;/div&gt;</summary>
		<author><name>Ratna</name></author>
	</entry>
	<entry>
		<id>https://docs.moodle.org/dev/index.php?title=Load_testing_Moodle_with_JMeter&amp;diff=56933</id>
		<title>Load testing Moodle with JMeter</title>
		<link rel="alternate" type="text/html" href="https://docs.moodle.org/dev/index.php?title=Load_testing_Moodle_with_JMeter&amp;diff=56933"/>
		<updated>2020-02-19T15:25:18Z</updated>

		<summary type="html">&lt;p&gt;Ratna: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;br /&gt;
This article is a stub until we collect enough information about the developments since [https://docs.moodle.org/dev/index.php?title=JMeter&amp;amp;oldid=35771 previous update in 2012]. All improvements are welcome!&lt;br /&gt;
&lt;br /&gt;
You can also add your comments to the [https://docs.moodle.org/dev/index.php?title=Talk:JMeter&amp;amp;action=edit&amp;amp;redlink=1 discussion page] or to the the [https://moodle.org/mod/forum/discuss.php?d=395002 discussion in the General developer forum].&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr/ &amp;gt;&lt;br /&gt;
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 &#039;&#039;&#039;Make test course&#039;&#039;&#039; (Site administration &amp;gt; Development &amp;gt; Make test course) and &#039;&#039;&#039;Make JMeter test plan&#039;&#039;&#039; (dito &amp;gt; 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.&lt;br /&gt;
&lt;br /&gt;
Warning:  &#039;&#039;&#039;Do not run these scripts on a production system!&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
These scripts generate data and load the server to its limit and beyond, making it to bloat and become nonreponsive. Don&#039;t even run them on a separate Moodle instance in the production server: their effect on the DBMS is undocumented.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;h2&amp;gt;Make test course&amp;lt;/h2&amp;gt;&lt;br /&gt;
This tool creates standard test courses that include many sections, activities, and files. This is intended to provide a standardised measure for checking the reliability and performance of various system components (such as backup and restore). This test is important because there have been many cases previously where, faced with real-life use cases (e.g. a course with 1,000 activities), the system does not work. Courses created using this feature can occupy a large amount of database and filesystem space (tens of gigabytes). You will need to delete the courses (and wait for various cleanup runs) to release this space again.&lt;br /&gt;
&lt;br /&gt;
Do not use this feature on a live system. Use only on a developer server. (To avoid accidental use, this feature is disabled unless you have also selected DEVELOPER debugging level.)&lt;br /&gt;
&lt;br /&gt;
Once you have set the debugging level Site administration &amp;gt; Development &amp;gt; Debugging: Debug messages = DEVELOPER: extra Moodle debug messages for developers, visit Site administration &amp;gt; Development &amp;gt; Make test course. You have the choice between XS (~10 KB; create in ~1 second), S (~10 KB, create in ~30 secends), M (~100 KB, create in ~2 minutes), L (~1 GB, create in ~30 minutes), XL (~10 GB, create in ~2 hours) and XXL (~20 GB, created in ~4 hours).&lt;br /&gt;
&lt;br /&gt;
Output:&lt;br /&gt;
Creating course&lt;br /&gt;
    Creating course [short name]&lt;br /&gt;
    Creating assignments (1): done (0.1s)&lt;br /&gt;
    Creating pages (1): done (0s)&lt;br /&gt;
    Creating small files (1): done (0s)&lt;br /&gt;
    Creating big files (1): done (0s)&lt;br /&gt;
    Checking user accounts (1)&lt;br /&gt;
    Creating user accounts (1 - 1): done (0s)&lt;br /&gt;
    Enrolling users into course (1): done (0s)&lt;br /&gt;
    Creating forum (2 posts): done (0s)&lt;br /&gt;
    Course completed (0.3s)&lt;br /&gt;
&lt;br /&gt;
&amp;lt;h2&amp;gt;Make JMeter test plan&amp;lt;/h2&amp;gt;&lt;br /&gt;
This tool creates a JMeter test plan file along with the user credentials file. This test plan is designed to work along with https://github.com/moodlehq/moodle-performance-comparison, which makes easier to run the test plan in a specific Moodle environment, gathers information about the runs and compares the results, so you will need to download it and use it&#039;s test_runner.sh script or follow the installation and usage instructions.&lt;br /&gt;
&lt;br /&gt;
You need to set a password for the course users in config.php (e.g. $CFG-&amp;gt;tool_generator_users_password = &#039;moodle&#039;;). There is no default value for this password to prevent unintended usages of the tool. You need to use the update passwords option in case your course users have other passwords or they were generated by tool_generator but without setting a $CFG-&amp;gt;tool_generator_users_password value.&lt;br /&gt;
&lt;br /&gt;
It is part of tool_generator so it works well with the courses generated by the courses and the site generators, it can also be used with any course that contains, at least:&lt;br /&gt;
&lt;br /&gt;
    Enough enrolled users (depends on the test plan size you select) with the password reset to &#039;moodle&#039;&lt;br /&gt;
    A page module instance&lt;br /&gt;
    A forum module instance with at least one discussion and one reply&lt;br /&gt;
&lt;br /&gt;
You might want to consider your servers capacity when running large test plans as the amount to load generated by JMeter can be specially big. The ramp up period has been adjusted according to the number of threads (users) to reduce this kind of issues but the load is still huge.&lt;br /&gt;
&lt;br /&gt;
Do not run the test plan on a live system. This feature only creates the files to feed JMeter so is not dangerous by itself, but you should NEVER run this test plan in a production site.&lt;br /&gt;
&lt;br /&gt;
Visit  Site administration &amp;gt; Development &amp;gt; Make JMeter test plan. Under Size of course your have six possibilities: XS (1 user, 5 loops and 1 rampup period), S (30 users, 5 loops and 6 rampup period), M (100 users, 5 loops and 40 rampup period), L (1000 users, 6 loops and 100 rampup period), XL (5000 users, 6 loops and 500 rampup period) and XXL (1000 users, 7 loops and 800 rampup period). As target course select one of the courses created above.&lt;br /&gt;
Update course users password: ticked. &lt;br /&gt;
&lt;br /&gt;
Now set $CFG-&amp;gt;tool_generator_users_password in config.php to generate the test plan. Once successful you can download a test plan (jmx file) [[File:users_timestamp.csv|users_timestamp.csv]] and a users file (csv)&lt;br /&gt;
&amp;lt;h2&amp;gt;Running the test plan on JMeter&amp;lt;/h2&amp;gt;&lt;br /&gt;
(to be filled)&lt;br /&gt;
&lt;br /&gt;
==See also==&lt;br /&gt;
*[http://jmeter.apache.org/jmeter/ Apache JMeter homepage]&lt;br /&gt;
*[https://moodle.org/mod/forum/discuss.php?d=377231 Jmeter or loading script/app to simulate concurrent users takng quizzes] (October 2018)&lt;br /&gt;
*[https://moodle.org/mod/forum/discuss.php?d=368620 Has anyone successfully run a jmeter test with 1000 users?] (April 2018)&lt;br /&gt;
&lt;br /&gt;
[[Category:Developer tools]]&lt;/div&gt;</summary>
		<author><name>Ratna</name></author>
	</entry>
	<entry>
		<id>https://docs.moodle.org/dev/index.php?title=Load_testing_Moodle_with_JMeter&amp;diff=56932</id>
		<title>Load testing Moodle with JMeter</title>
		<link rel="alternate" type="text/html" href="https://docs.moodle.org/dev/index.php?title=Load_testing_Moodle_with_JMeter&amp;diff=56932"/>
		<updated>2020-02-18T15:31:34Z</updated>

		<summary type="html">&lt;p&gt;Ratna: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;br /&gt;
This article is a stub until we collect enough information about the developments since [https://docs.moodle.org/dev/index.php?title=JMeter&amp;amp;oldid=35771 previous update in 2012]. All improvements are welcome!&lt;br /&gt;
&lt;br /&gt;
You can also add your comments to the [https://docs.moodle.org/dev/index.php?title=Talk:JMeter&amp;amp;action=edit&amp;amp;redlink=1 discussion page] or to the the [https://moodle.org/mod/forum/discuss.php?d=395002 discussion in the General developer forum].&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr/ &amp;gt;&lt;br /&gt;
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 &#039;&#039;&#039;Make test course&#039;&#039;&#039; (Site administration &amp;gt; Development &amp;gt; Make test course) and &#039;&#039;&#039;Make JMeter test plan&#039;&#039;&#039; (dito &amp;gt; 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.&lt;br /&gt;
&lt;br /&gt;
Warning:  &#039;&#039;&#039;Do not run these scripts on a production system!&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
These scripts generate data and load the server to its limit and beyond, making it to bloat and become nonreponsive. Don&#039;t even run them on a separate Moodle instance in the production server: their effect on the DBMS is undocumented.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;h2&amp;gt;Make test course&amp;lt;/h2&amp;gt;&lt;br /&gt;
This tool creates standard test courses that include many sections, activities, and files. This is intended to provide a standardised measure for checking the reliability and performance of various system components (such as backup and restore). This test is important because there have been many cases previously where, faced with real-life use cases (e.g. a course with 1,000 activities), the system does not work. Courses created using this feature can occupy a large amount of database and filesystem space (tens of gigabytes). You will need to delete the courses (and wait for various cleanup runs) to release this space again.&lt;br /&gt;
&lt;br /&gt;
Do not use this feature on a live system. Use only on a developer server. (To avoid accidental use, this feature is disabled unless you have also selected DEVELOPER debugging level.)&lt;br /&gt;
&lt;br /&gt;
Once you have set the debugging level Site administration &amp;gt; Development &amp;gt; Debugging: Debug messages = DEVELOPER: extra Moodle debug messages for developers, visit Site administration &amp;gt; Development &amp;gt; Make test course. You have the choice between XS (~10 KB; create in ~1 second), S (~10 KB, create in ~30 secends), M (~100 KB, create in ~2 minutes), L (~1 GB, create in ~30 minutes), XL (~10 GB, create in ~2 hours) and XXL (~20 GB, created in ~4 hours).&lt;br /&gt;
&lt;br /&gt;
Output:&lt;br /&gt;
Creating course&lt;br /&gt;
    Creating course [short name]&lt;br /&gt;
    Creating assignments (1): done (0.1s)&lt;br /&gt;
    Creating pages (1): done (0s)&lt;br /&gt;
    Creating small files (1): done (0s)&lt;br /&gt;
    Creating big files (1): done (0s)&lt;br /&gt;
    Checking user accounts (1)&lt;br /&gt;
    Creating user accounts (1 - 1): done (0s)&lt;br /&gt;
    Enrolling users into course (1): done (0s)&lt;br /&gt;
    Creating forum (2 posts): done (0s)&lt;br /&gt;
    Course completed (0.3s)&lt;br /&gt;
&lt;br /&gt;
&amp;lt;h2&amp;gt;Make JMeter test plan&amp;lt;/h2&amp;gt;&lt;br /&gt;
This tool creates a JMeter test plan file along with the user credentials file. This test plan is designed to work along with https://github.com/moodlehq/moodle-performance-comparison, which makes easier to run the test plan in a specific Moodle environment, gathers information about the runs and compares the results, so you will need to download it and use it&#039;s test_runner.sh script or follow the installation and usage instructions.&lt;br /&gt;
&lt;br /&gt;
You need to set a password for the course users in config.php (e.g. $CFG-&amp;gt;tool_generator_users_password = &#039;moodle&#039;;). There is no default value for this password to prevent unintended usages of the tool. You need to use the update passwords option in case your course users have other passwords or they were generated by tool_generator but without setting a $CFG-&amp;gt;tool_generator_users_password value.&lt;br /&gt;
&lt;br /&gt;
It is part of tool_generator so it works well with the courses generated by the courses and the site generators, it can also be used with any course that contains, at least:&lt;br /&gt;
&lt;br /&gt;
    Enough enrolled users (depends on the test plan size you select) with the password reset to &#039;moodle&#039;&lt;br /&gt;
    A page module instance&lt;br /&gt;
    A forum module instance with at least one discussion and one reply&lt;br /&gt;
&lt;br /&gt;
You might want to consider your servers capacity when running large test plans as the amount to load generated by JMeter can be specially big. The ramp up period has been adjusted according to the number of threads (users) to reduce this kind of issues but the load is still huge.&lt;br /&gt;
&lt;br /&gt;
Do not run the test plan on a live system. This feature only creates the files to feed JMeter so is not dangerous by itself, but you should NEVER run this test plan in a production site.&lt;br /&gt;
&lt;br /&gt;
Visit  Site administration &amp;gt; Development &amp;gt; Make JMeter test plan. Under Size of course your have six possibilities: XS (1 user, 5 loops and 1 rampup period), S (30 users, 5 loops and 6 rampup period), M (100 users, 5 loops and 40 rampup period), L (1000 users, 6 loops and 100 rampup period), XL (5000 users, 6 loops and 500 rampup period) and XXL (1000 users, 7 loops and 800 rampup period). As target course select one of the courses created above.&lt;br /&gt;
Update course users password: ticked. &lt;br /&gt;
&lt;br /&gt;
Now set $CFG-&amp;gt;tool_generator_users_password in config.php to generate the test plan. Once successfull you can download a test plan (jmx file) [[File:users_timestamp.csv|thumb]] and a users file (csv)&lt;br /&gt;
&amp;lt;h2&amp;gt;Running the test plan on JMeter&amp;lt;/h2&amp;gt;&lt;br /&gt;
(to be filled)&lt;br /&gt;
&lt;br /&gt;
==See also==&lt;br /&gt;
*[http://jmeter.apache.org/jmeter/ Apache JMeter homepage]&lt;br /&gt;
*[https://moodle.org/mod/forum/discuss.php?d=377231 Jmeter or loading script/app to simulate concurrent users takng quizzes] (October 2018)&lt;br /&gt;
*[https://moodle.org/mod/forum/discuss.php?d=368620 Has anyone successfully run a jmeter test with 1000 users?] (April 2018)&lt;br /&gt;
&lt;br /&gt;
[[Category:Developer tools]]&lt;/div&gt;</summary>
		<author><name>Ratna</name></author>
	</entry>
	<entry>
		<id>https://docs.moodle.org/dev/index.php?title=Load_testing_Moodle_with_JMeter&amp;diff=56931</id>
		<title>Load testing Moodle with JMeter</title>
		<link rel="alternate" type="text/html" href="https://docs.moodle.org/dev/index.php?title=Load_testing_Moodle_with_JMeter&amp;diff=56931"/>
		<updated>2020-02-18T15:15:34Z</updated>

		<summary type="html">&lt;p&gt;Ratna: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;br /&gt;
This article is a stub until we collect enough information about the developments since [https://docs.moodle.org/dev/index.php?title=JMeter&amp;amp;oldid=35771 previous update in 2012]. All improvements are welcome!&lt;br /&gt;
&lt;br /&gt;
You can also add your comments to the [https://docs.moodle.org/dev/index.php?title=Talk:JMeter&amp;amp;action=edit&amp;amp;redlink=1 discussion page] or to the the [https://moodle.org/mod/forum/discuss.php?d=395002 discussion in the General developer forum].&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr/ &amp;gt;&lt;br /&gt;
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 &#039;&#039;&#039;Make test course&#039;&#039;&#039; (Site administration &amp;gt; Development &amp;gt; Make test course) and &#039;&#039;&#039;Make JMeter test plan&#039;&#039;&#039; (dito &amp;gt; 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.&lt;br /&gt;
&lt;br /&gt;
Warning:  &#039;&#039;&#039;Do not run these scripts on a production system!&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
These scripts generate data and load the server to its limit and beyond, making it to bloat and become nonreponsive. Don&#039;t even run them on a separate Moodle instance in the production server: their effect on the DBMS is undocumented.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;h2&amp;gt;Make test course&amp;lt;/h2&amp;gt;&lt;br /&gt;
This tool creates standard test courses that include many sections, activities, and files. This is intended to provide a standardised measure for checking the reliability and performance of various system components (such as backup and restore). This test is important because there have been many cases previously where, faced with real-life use cases (e.g. a course with 1,000 activities), the system does not work. Courses created using this feature can occupy a large amount of database and filesystem space (tens of gigabytes). You will need to delete the courses (and wait for various cleanup runs) to release this space again.&lt;br /&gt;
&lt;br /&gt;
Do not use this feature on a live system. Use only on a developer server. (To avoid accidental use, this feature is disabled unless you have also selected DEVELOPER debugging level.)&lt;br /&gt;
&lt;br /&gt;
Once you have set the debugging level Site administration &amp;gt; Development &amp;gt; Debugging: Debug messages = DEVELOPER: extra Moodle debug messages for developers, visit Site administration &amp;gt; Development &amp;gt; Make test course. You have the choice between XS (~10 KB; create in ~1 second), S (~10 KB, create in ~30 secends), M (~100 KB, create in ~2 minutes), L (~1 GB, create in ~30 minutes), XL (~10 GB, create in ~2 hours) and XXL (~20 GB, created in ~4 hours).&lt;br /&gt;
&lt;br /&gt;
Output:&lt;br /&gt;
Creating course&lt;br /&gt;
    Creating course [short name]&lt;br /&gt;
    Creating assignments (1): done (0.1s)&lt;br /&gt;
    Creating pages (1): done (0s)&lt;br /&gt;
    Creating small files (1): done (0s)&lt;br /&gt;
    Creating big files (1): done (0s)&lt;br /&gt;
    Checking user accounts (1)&lt;br /&gt;
    Creating user accounts (1 - 1): done (0s)&lt;br /&gt;
    Enrolling users into course (1): done (0s)&lt;br /&gt;
    Creating forum (2 posts): done (0s)&lt;br /&gt;
    Course completed (0.3s)&lt;br /&gt;
&lt;br /&gt;
&amp;lt;h2&amp;gt;Make JMeter test plan&amp;lt;/h2&amp;gt;&lt;br /&gt;
This tool creates a JMeter test plan file along with the user credentials file. This test plan is designed to work along with https://github.com/moodlehq/moodle-performance-comparison, which makes easier to run the test plan in a specific Moodle environment, gathers information about the runs and compares the results, so you will need to download it and use it&#039;s test_runner.sh script or follow the installation and usage instructions.&lt;br /&gt;
&lt;br /&gt;
You need to set a password for the course users in config.php (e.g. $CFG-&amp;gt;tool_generator_users_password = &#039;moodle&#039;;). There is no default value for this password to prevent unintended usages of the tool. You need to use the update passwords option in case your course users have other passwords or they were generated by tool_generator but without setting a $CFG-&amp;gt;tool_generator_users_password value.&lt;br /&gt;
&lt;br /&gt;
It is part of tool_generator so it works well with the courses generated by the courses and the site generators, it can also be used with any course that contains, at least:&lt;br /&gt;
&lt;br /&gt;
    Enough enrolled users (depends on the test plan size you select) with the password reset to &#039;moodle&#039;&lt;br /&gt;
    A page module instance&lt;br /&gt;
    A forum module instance with at least one discussion and one reply&lt;br /&gt;
&lt;br /&gt;
You might want to consider your servers capacity when running large test plans as the amount to load generated by JMeter can be specially big. The ramp up period has been adjusted according to the number of threads (users) to reduce this kind of issues but the load is still huge.&lt;br /&gt;
&lt;br /&gt;
Do not run the test plan on a live system. This feature only creates the files to feed JMeter so is not dangerous by itself, but you should NEVER run this test plan in a production site.&lt;br /&gt;
&lt;br /&gt;
Visit  Site administration &amp;gt; Development &amp;gt; Make JMeter test plan. Under Size of course your have six possibilities: XS (1 user, 5 loops and 1 rampup period), S (30 users, 5 loops and 6 rampup period), M (100 users, 5 loops and 40 rampup period), L (1000 users, 6 loops and 100 rampup period), XL (5000 users, 6 loops and 500 rampup period) and XXL (1000 users, 7 loops and 800 rampup period). As target course select one of the courses created above.&lt;br /&gt;
Update course users password: ticked. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;h2&amp;gt;Running the test plan on JMeter&amp;lt;/h2&amp;gt;&lt;br /&gt;
(to be filled)&lt;br /&gt;
&lt;br /&gt;
==See also==&lt;br /&gt;
*[http://jmeter.apache.org/jmeter/ Apache JMeter homepage]&lt;br /&gt;
*[https://moodle.org/mod/forum/discuss.php?d=377231 Jmeter or loading script/app to simulate concurrent users takng quizzes] (October 2018)&lt;br /&gt;
*[https://moodle.org/mod/forum/discuss.php?d=368620 Has anyone successfully run a jmeter test with 1000 users?] (April 2018)&lt;br /&gt;
&lt;br /&gt;
[[Category:Developer tools]]&lt;/div&gt;</summary>
		<author><name>Ratna</name></author>
	</entry>
	<entry>
		<id>https://docs.moodle.org/dev/index.php?title=Load_testing_Moodle_with_JMeter&amp;diff=56770</id>
		<title>Load testing Moodle with JMeter</title>
		<link rel="alternate" type="text/html" href="https://docs.moodle.org/dev/index.php?title=Load_testing_Moodle_with_JMeter&amp;diff=56770"/>
		<updated>2019-12-29T09:34:22Z</updated>

		<summary type="html">&lt;p&gt;Ratna: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;br /&gt;
This article is a stub until we collect enough information about the developments since [https://docs.moodle.org/dev/index.php?title=JMeter&amp;amp;oldid=35771 previous update in 2012]. All improvements are welcome!&lt;br /&gt;
&lt;br /&gt;
You can also add your comments to the [https://docs.moodle.org/dev/index.php?title=Talk:JMeter&amp;amp;action=edit&amp;amp;redlink=1 discussion page] or to the the [https://moodle.org/mod/forum/discuss.php?d=395002 discussion in the General developer forum].&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr/ &amp;gt;&lt;br /&gt;
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 &#039;&#039;&#039;Make test course&#039;&#039;&#039; (Site administration &amp;gt; Development &amp;gt; Make test course) and &#039;&#039;&#039;Make JMeter test plan&#039;&#039;&#039; (dito &amp;gt; 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.&lt;br /&gt;
&lt;br /&gt;
Warning:  &#039;&#039;&#039;Do not run these scripts on a production system!&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
These scripts generate data and load the server to its limit and beyond, making it to bloat and become nonreponsive. Don&#039;t even run them on a separate Moodle instance in the production server: their effect on the DBMS is undocumented.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;h2&amp;gt;Make test course&amp;lt;/h2&amp;gt;&lt;br /&gt;
(to be filled)&lt;br /&gt;
&lt;br /&gt;
&amp;lt;h2&amp;gt;Make JMeter test plan&amp;lt;/h2&amp;gt;&lt;br /&gt;
(to be filled)&lt;br /&gt;
&lt;br /&gt;
&amp;lt;h2&amp;gt;Running the test plan on JMeter&amp;lt;/h2&amp;gt;&lt;br /&gt;
(to be filled)&lt;br /&gt;
&lt;br /&gt;
==See also==&lt;br /&gt;
*[http://jmeter.apache.org/jmeter/ Apache JMeter homepage]&lt;br /&gt;
*[https://moodle.org/mod/forum/discuss.php?d=377231 Jmeter or loading script/app to simulate concurrent users takng quizzes] (October 2018)&lt;br /&gt;
*[https://moodle.org/mod/forum/discuss.php?d=368620 Has anyone successfully run a jmeter test with 1000 users?] (April 2018)&lt;br /&gt;
&lt;br /&gt;
[[Category:Developer tools]]&lt;/div&gt;</summary>
		<author><name>Ratna</name></author>
	</entry>
	<entry>
		<id>https://docs.moodle.org/dev/index.php?title=Load_testing_Moodle_with_JMeter&amp;diff=56769</id>
		<title>Load testing Moodle with JMeter</title>
		<link rel="alternate" type="text/html" href="https://docs.moodle.org/dev/index.php?title=Load_testing_Moodle_with_JMeter&amp;diff=56769"/>
		<updated>2019-12-28T16:20:31Z</updated>

		<summary type="html">&lt;p&gt;Ratna: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;br /&gt;
This article is a stub until we collect enough information about the developments since [https://docs.moodle.org/dev/index.php?title=JMeter&amp;amp;oldid=35771 previous update in 2012]. All improvements are welcome!&lt;br /&gt;
&lt;br /&gt;
You can also add your comments to the [https://docs.moodle.org/dev/index.php?title=Talk:JMeter&amp;amp;action=edit&amp;amp;redlink=1 discussion page] or to the the [https://moodle.org/mod/forum/discuss.php?d=395002 discussion in the General developer forum].&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr/ &amp;gt;&lt;br /&gt;
The Apace JMeter has always been the most common load testing resp. performance measurement tool for Moodle. Since release 2.5, Moodle makes the process vastly simpler through two built-in scripts &#039;&#039;&#039;Make test course&#039;&#039;&#039; (Site administration &amp;gt; Development &amp;gt; Make test course) and &#039;&#039;&#039;Make JMeter test plan&#039;&#039;&#039; (Site administration &amp;gt; Development &amp;gt; Make JMeter test plan) augmented by the add-ons [https://github.com/moodlehq/moodle-performance-comparison Moodle performance comparison]. This document is about the two built-in scripts.&lt;br /&gt;
&lt;br /&gt;
Warning:  &#039;&#039;&#039;Do not run these scripts on a production system!&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
These tests load the server to its limits and beyond, making it nonreponsive. Even if you can afford down-times don&#039;t run them on a separate Moodle instance on the production server: their effect on the DBMS is undocumented.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;h2&amp;gt;Make test course&amp;lt;/h2&amp;gt;&lt;br /&gt;
(to be filled)&lt;br /&gt;
&lt;br /&gt;
&amp;lt;h2&amp;gt;Make JMeter test plan&amp;lt;/h2&amp;gt;&lt;br /&gt;
(to be filled)&lt;br /&gt;
&lt;br /&gt;
&amp;lt;h2&amp;gt;Running the test plan on JMeter&amp;lt;/h2&amp;gt;&lt;br /&gt;
(to be filled)&lt;br /&gt;
&lt;br /&gt;
==See also==&lt;br /&gt;
*[http://jmeter.apache.org/jmeter/ Apache JMeter homepage]&lt;br /&gt;
*[https://moodle.org/mod/forum/discuss.php?d=377231 Jmeter or loading script/app to simulate concurrent users takng quizzes] (October 2018)&lt;br /&gt;
*[https://moodle.org/mod/forum/discuss.php?d=368620 Has anyone successfully run a jmeter test with 1000 users?] (April 2018)&lt;br /&gt;
&lt;br /&gt;
[[Category:Developer tools]]&lt;/div&gt;</summary>
		<author><name>Ratna</name></author>
	</entry>
	<entry>
		<id>https://docs.moodle.org/dev/index.php?title=Load_testing_Moodle_with_JMeter&amp;diff=56768</id>
		<title>Load testing Moodle with JMeter</title>
		<link rel="alternate" type="text/html" href="https://docs.moodle.org/dev/index.php?title=Load_testing_Moodle_with_JMeter&amp;diff=56768"/>
		<updated>2019-12-28T10:36:53Z</updated>

		<summary type="html">&lt;p&gt;Ratna: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;br /&gt;
This article is a stub until we collect enough information about the developments since [https://docs.moodle.org/dev/index.php?title=JMeter&amp;amp;oldid=35771 previous update in 2012]. All improvements are welcome!&lt;br /&gt;
&lt;br /&gt;
You can also add your comments to the [https://docs.moodle.org/dev/index.php?title=Talk:JMeter&amp;amp;action=edit&amp;amp;redlink=1 discussion page] or to the the [https://moodle.org/mod/forum/discuss.php?d=395002 discussion in the General developer forum].&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr/ &amp;gt;&lt;br /&gt;
The Apace JMeter has always been the most common load testing resp. performance measurement tool for Moodle. Since release 2.5, Moodle makes the process vastly simpler through two built-in scripts &#039;&#039;&#039;Make test course&#039;&#039;&#039; (Site administration &amp;gt; Development &amp;gt; Make test course) and &#039;&#039;&#039;Make JMeter test plan&#039;&#039;&#039; (Site administration &amp;gt; Development &amp;gt; Make JMeter test plan) augmented by the add-ons [https://github.com/moodlehq/moodle-performance-comparison Moodle performance comparison]. This document is about the two built-in scripts.&lt;br /&gt;
&lt;br /&gt;
Warning:  &#039;&#039;&#039;Do not run these scripts on a production system!&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
These tests load the server to its limits and beyond, making it nonreponsive. Even if you can afford down-times don&#039;t run them on a separate Moodle instance on the production server: their effect on the DBMS is undocumented.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;h2&amp;gt;Make test course&amp;lt;/h2&amp;gt;&lt;br /&gt;
(to be filled)&lt;br /&gt;
&lt;br /&gt;
&amp;lt;h2&amp;gt;Make JMeter test plan&amp;lt;/h2&amp;gt;&lt;br /&gt;
(to be filled)&lt;br /&gt;
&lt;br /&gt;
&amp;lt;h2&amp;gt;Running the test plan on JMeter&amp;lt;/h2&amp;gt;&lt;br /&gt;
(to be filled)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==See also==&lt;br /&gt;
*[http://jmeter.apache.org/jmeter/ Apache JMeter homepage]&lt;br /&gt;
&lt;br /&gt;
[[Category:Developer tools]]&lt;/div&gt;</summary>
		<author><name>Ratna</name></author>
	</entry>
	<entry>
		<id>https://docs.moodle.org/dev/index.php?title=User_talk:Visvanath_Ratnaweera&amp;diff=24091</id>
		<title>User talk:Visvanath Ratnaweera</title>
		<link rel="alternate" type="text/html" href="https://docs.moodle.org/dev/index.php?title=User_talk:Visvanath_Ratnaweera&amp;diff=24091"/>
		<updated>2009-10-10T08:21:25Z</updated>

		<summary type="html">&lt;p&gt;Ratna: /* new section  */ new section&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;2009-10-10 Talk back viz&lt;br /&gt;
&lt;br /&gt;
== new section  ==&lt;br /&gt;
&lt;br /&gt;
xxxx&lt;/div&gt;</summary>
		<author><name>Ratna</name></author>
	</entry>
	<entry>
		<id>https://docs.moodle.org/dev/index.php?title=User_talk:Visvanath_Ratnaweera&amp;diff=24090</id>
		<title>User talk:Visvanath Ratnaweera</title>
		<link rel="alternate" type="text/html" href="https://docs.moodle.org/dev/index.php?title=User_talk:Visvanath_Ratnaweera&amp;diff=24090"/>
		<updated>2009-10-10T08:20:04Z</updated>

		<summary type="html">&lt;p&gt;Ratna: New page: 2009-10-10 Talk back viz&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;2009-10-10 Talk back viz&lt;/div&gt;</summary>
		<author><name>Ratna</name></author>
	</entry>
</feed>