Running a Jmeter testplan

Running a Jmeter testplan

by James Steerpike -
Number of replies: 8

From https://docs.moodle.org/dev/JMeter
"Once successful you can download a test plan testplan_timestamp.jmx and a users file users_timestamp.csv"
So what comes next?
I have loaded Jmeter on to my server and run:
  jmeter -n -t testplan_202009120804_3683-1.jmx -p users_202009120804_9662.csv
(n for a non gui run, t for the test plan)
But it tells me
File YOU_FORGOT_TO_SPECIFY_USERS_CSV_FILE.csv must exist and be readable
I thought the -p flag might help but no such luck. I do get a jlt file but not sure what I am doing here.

So how to run the test plan?


Average of ratings: -
In reply to James Steerpike

Re: Running a Jmeter testplan

by James Steerpike -
I have worked out how to run a test plan and updated Moodle docs. Not sure how to interpret it yet.
I am wondering though - am I off on a weird tangent? Is JMeter something only for developers?
I would have thought any performance tuning at server setup would need a standard Moodle course and the ability to simulate multiple users. Or perhaps a recommendation for the many inquiries on "how much server do I need" on the lines of being able to run a certain sized  JMeter plan with x concurrent users and no errors?
In reply to James Steerpike

Re: Running a Jmeter testplan

by Ken Task -
Picture of Particularly helpful Moodlers

Many years ago did a jmeter test with a 'customer' needing assistance.

It is meant to run on a test machine (s) ... not production server (s).   Did you step through all the links ... creating a course, deciding on how many users, etc. prior to the plan?

The end result of helping this 'customer' was really none conclusive ... we did find that 2000 users was max for the servers (they had true commercial Red Hat web and dedicated DB server).   'Customer' would not allow any tweaking ... like MySQLTuner ... nor any known apache tweaks prior to using.  Gentleman that was my contact specialized in 'quality assurance testing' and insisted on doing things the QA' way.

It did not finish with nor make any recommendations like Tuner or Apache2Buddy ... but you knew "max numbers" or when things failed.   The QA guy was kinda disappointed and we sorta waisted about a weeks time.

Sooooo .... that's my experience with it ...

I guess someone that knows more about it can jump in here and give their 2 cents!   Hope they do ... curious minds want to know!

'SoS', Ken

In reply to Ken Task

Re: Running a Jmeter testplan

by James Steerpike -
Looks like I am off on my own then. Never mind, an interesting project and more challenging than watching Tiktok.
I am running it on a cheap VPS which I can easily trash by a reinstall. Test course creation is a Moodle menu item and I am using the XS option of 1 user, 5 loops and 1 rampup. Running that takes about a minute and shows no problems and I have played with increasing users and adding swap space. I am not sure what constitutes a failure - a slowdown or error rate in areas like login and forum posting. Once I have a baseline I can tweak.
I have also been diverted with the Moodle Performance Comparison Scripts  described on the JMeter Test Plan creation page with mixed success. These run on a LAMP stack and install their own copy of Moodle complete with a test course of varying size. I have used it to create a test course but am stymied with the last parameter of the test_runner script. Very cool to be able to script the install, course creation, testing and deleting of a Moodle installation.
What was that saying about the curious cat?
In reply to James Steerpike

Re: Running a Jmeter testplan

by Ken Task -
Picture of Particularly helpful Moodlers

jmeter runs from a workstation ... not on server.  From what I re-call one would choose number of anticipated users ... accounts created for them ... and a course with a variety if mods - since Quiz is a heavy hitter (that much I knew at the time) a number of quizzes were created by script in that jmeter course.   One then downloaded the .jsk (whatever that file was called) and ran jmeter app using that file.

That QnA setup I mentioned.   My part was watcing realtime logs with multitail ... access log/error log ... which was difficult to do ... not running but watching it went so fast ... until the point of failure ... where apache would start to complain and halt.   Looking back, should have also watched mysql logs ... cause I think that's where the bottle neck was ... no tweaks prior to running jmeter ... defaults for MySQL/MariaDB have never really been good ... or none exisitent now with innoDB.   Tuner, for example, looks at overall memory of server and calculates % the DB would take up and also inform if that was ok with the memory required to run the rest of the operarting system ...

 Example: from a sandbox server running multiple versions of Moodle ... 3.5 -> 3.9

[OK] Maximum reached memory usage: 2.0G (26.84% of installed RAM)
[OK] Maximum possible memory usage: 2.2G (28.90% of installed RAM)
[OK] Overall possible memory usage with other process is compatible with memory available

Among others, one variable always tweaked upwards after just one days usage (or sooner if one is monitoring realtime):

[OK] InnoDB buffer pool / data size: 2.0G/153.5M

which also requires tweaking of the following:

[OK] InnoDB buffer pool instances: 2

True 9-12 production server:

KiB Mem : 32780628 total,   242132 free,  5176176 used, 27362320 buff/cache
KiB Swap: 16515068 total, 16508660 free,     6408 used. 26877612 avail Mem

9429 users.txt

[--] Physical Memory     : 31.3G
[--] Max MySQL memory    : 7.9G

[OK] Maximum reached memory usage: 4.0G (12.83% of installed RAM)
[OK] Maximum possible memory usage: 7.9G (25.35% of installed RAM)
[OK] Overall possible memory usage with other process is compatible with memory available

[OK] Slow queries: 0% (0/91M)
[OK] Highest usage of available connections: 19% (30/151)

[OK] Aborted connections: 0.00%  (4/1773479)

So far ... no crashes ... nor MySQL has gone away or ... issues.

Today was a quiz day from what I could tell of realtime logs ... no one complained ... didn't see anything in error logs.

I, personally, find better info for action from MySQLTuner and Apache2Buddy.

Sooooooo ... ????? ... comment: just because something comes with Moodle doesn't mean there isn't better tools else where - outside of Moodle admin! smile   My 2 cents, of course.

'SoS', Ken

In reply to Ken Task

Re: Running a Jmeter testplan

by James Steerpike -
Yes, running JMeter on a desktop in a graphical environment but since it is a cloud server it introduces delays for http requests. Once the jmx file that is the testplan is edited, it can run in the CLI on the server using jmeter -n -t testplan.jmx to produce a jlt file which can be downloaded back to the GUI and read using a Listener. Mine balked on running on the server without a swap file set up so jmeter must put a fair load on the server.
Looking at MySQLTuner and ApacheBuddy as well but still keen on getting that benchmark.
The Moodle instructions on the JMeter test plan creation are hard to follow and probably wrong. The test courses also seem to focus on forums, not the quizzes.
Average of ratings: Useful (1)
In reply to James Steerpike

Re: Running a Jmeter testplan

by Visvanath Ratnaweera -
Picture of Particularly helpful Moodlers Picture of Translators
Hi

Thanks for extending the documentation https://docs.moodle.org/dev/JMeter. It was hopelessly outdated. I revised it partly and then got diverted.

Yes, to eliminate as many factors as possible, one should load the server progressively from other computers in the same LAN monitoring their effect on server - analogue to a fitness test on the treadmill. So, it won't answer the question "how much server do I need" but the reverse, "how much a given server can deliver". Even then the "how much" is not measured "how many simultaneous Moodle users" what the Moodlers like to hear. ;-(

No, the "user" in Moodle is not standardized. With JMeter it has to be some artificial load.
In reply to Visvanath Ratnaweera

Re: Running a Jmeter testplan

by James Steerpike -
After playing around a little more, I am thinking running the Moodle page JMeter test plan and a JMeter GUI is not the best way to do it. The JMeter results are quite hard to understand.
Instead you can use the Moodle Performance Scripts. You start with a standard LAMP stack, install JMeter, a privileged MySql user and the readable moodledata file. The scripts then do all the hard work of installing Moodle, running the tests, cleaning up and displaying graphs. From a cleanl LAMP install it took me about 30 minutes to a result.
I have documented what I have done here.  The picture shows the end result of a comparison between 2 runs, and the results web page is here.
Performance Comparison Run

Average of ratings: Useful (1)