Hi,
I've created a plugin to check performance about your Moodle.
The plugin is actually in beta, so we need your feedback
Thanks !
Hi,
I've created a plugin to check performance about your Moodle.
The plugin is actually in beta, so we need your feedback
Thanks !
Go on then... this is 3.1 on my development machine
Standard LAMP setup, with no performance tweaks at all. Moodle3.1, Clean theme.
Switched to my flexibase theme and ran several times to see about the need for multiple runs mentioned in another post - got scores of 80, 85, 79, 88, 77, so some differences but not major, but would appear to be some benefit to running several times to get consistency.
Will be using this when I move to my new uni in July Thank you
Thanks Sergio ! i can add 2.7 in tested platform.
Hummm the score is better when is little you know
This is my production host (half of the cluster) with Moodle 2.7.14.
The last two items could be negatively impacted by many auth plugins enabled on site?
This is the last post... My first clustered Moodle platform, running since 2009 on SUN x4150 hardware in bare metal mode: do really we need new servers? After these runs, i'm dubious on the acceptable limit for the item 2 set to 0.5: this platform gives moodle everyday to 19.000 users with 730 university courses with great performances. Maybe a 0.55 or 0.6 could be equally acceptable.
Funny and useful plugin!
Yes, i know, but this is a VM for development only, so performance is not an issue.
When i'll find some time, i'll take a look at some too high values.
I could not install on 3.0. Error about backup report in wrong location...
Hello Emma,
It's a GitHub problem.
If you download the plugin from GitHub, you must open the Zip and rename the folder "benchmark-master" to "benchmark". Please, follow the complete process in the file README.md.
To correct this, you must rename the folder "/report/benchmark" folder to "/report/backups". I don't know why Moodle don't do the rename correctly
Vote for Tracker issue MDL-55020
Nice plugin Mickaël!
It does seem to be a little inconsistent.. perhaps when you click 'start the test' it should run itself a few times and show the average score for the 3 runs? In my tests, it went inbetween 130 and 246 as a score, with the "2 Function called many times" step being the biggest variant. This is on a staging virtual machine running on VMware.
-Mathew
Indeed.
This could be added in a future release.
Thanks for your contribution Mathew, i've merge your pullrequest
Moodle 3.0.1
Time to put plug-in into production now!
btw, why is that only NGinx is in recommendation?
also, in Sergio's test, this temp folder is of operating system or referring to moodle's temp folder?
Great score ! Only 93, you've got the best score and a really good Moodle.
NGinx isn't the only recommendation, the BenchMark tips also show Apache MPM.
About temp directory, it's $CFG->tempdir. I see a lot of problem with this test result.
Mickaēl, This tempdir is from moodledata folder? just wanted to know if it can bring some changes in terms of Moodle's performance, if setup independently or on separate / faster drive?
BTW, my Moodle is running on Windows Server 2012 R2 and IIS as web server. That is why I asked why just Apache/NGinx and why not IIS too adding LiteSpeed as a recommended server is another good option.
On IIS, ok ! It's good to know it .
The temps directory is the /moodledata/temp.
Please, can you write your hardware/software configuration ? It can help some people i mean.
Of course yes, why not!
This tested Moodle is on a development machine running on Core i3 6th generation 3.6Ghz CPU, Dual core- hyper threaded, with 8GB RAM, and combination of 3 drives, where OS and Web Server on one, moodle and moodledata on second whilst keeping Database alone on SSD drive for maximum throughput.
O/S: Windows Server 2012 R2
Web Server IIS 8.5
PHP 7.0.5 64-bits, with OpCache and WinCache enabled though yet not optimized for performance.
Putting everything on SSD drive may will bring the score even lower.
Luis, I haven't personally but did gave a thought about it once, considering that third party application may not be stable on server O/S so never tested it, and on top NVMe drives on PCIe 4 bus have similar latency and transfer speeds so waiting on hardware upgrade to test those.
Interesting - some issues going on with my Debian server on HyperV with a SAN drive.
Ha ha!! Yes, this was on my production server!
20 sec.; not 2 or 3, 20 for the creating files test, it isn't normal.
Maybe, move your /moodledata/temp in another harddrive. I dont know why, but some VM don't like this directory...
I've got a couple of fixes for you.
The SQL queries in the code should use the standard Moodle functionality for appending the table prefix; I've not run the plugin (and probably won't in the short term) but I can see it won't work in our environment as we don't use the standard 'mdl_' table prefix - the SQL requires it.
I've made these changes and submitted a pull request: https://github.com/mikasmart/benchmark/pull/5
Otherwise, nice work. Good way of comparing different Moodle environments with real data.
Thanks James,
I really happy to share this plugin. It's a good reference to check some parts in Moodle and out of Moodle.
I've accepted your pullrequest but it was a little problem with SQL, so i rewrite it (just a little bit).
I think distributing the first production release (v1.0.0) in 2 or 3 days.
BenchMark Game pre-release
I invite you to get the lowest score ! (screenshoot needed, fake not accepted )
The winner will be mentioned in the 1.0.0 release. Moodlers; ready ? Go !
How about the highest score - I have a good shot at that one!!
Again, just for trying to go to the limit, after some minutes spent enabling memcache and some other performance refinements to opcache and mariadb i got this - in battery mode :
Perhaps 2 categories needed - standalone development setups and live servers
Can't come close to Sergio's 60 (mine is consistently 85-95 - screenshot showing 90 above) But very useful and learned something I probably knew in the back of my mind but had forgotten - when its on battery my laptop throttles the processor to conserve power: The scores drop from around 90 to around 130, with the difference (highlighted by this plugin) being the test2 around processor speed Very useful!
716 was my best... but that is on a Raspberry PI 2 (https://moopi.uk)
As you would imagine it complains about a slow processor, which also impacts the complex DB queries, But all in all not too shabby I think.
Great idea ... good plugin ... will share back results when I find time to run them on production server (yes, I know not meant for production). As I was looking at some of those that shared back results, a couple of thoughts came to mind. First ... networking comes before application .. one can test on a localhost development and the numbers will be amazing ... but not so much so from on a true production server. Second ... saw something for Joomla that would test a site remotely ... server admin had to accept a disclaimer and give permissions to run it, but the results were worth it. Am wondering if this plugin could also be made available as a service ... from the server acting as a service to another Moodle located on internet (server admin would have to grant permissions to do so)? Would be a lesser jmeter test in a way.
'spirit of sharing', Ken
Why am I always the one to break things... I tested it out on two different of Moodle 3.1 instances that run on completely different servers and I a message of a different reporting plugin is missing! I never seen this kind of thing occur before. I was installing version $plugin->version = 2016062800;
and I did check to make sure that the backup reports were there before I attempted the install. Oddly enough i had to completely delete and reload my moodle directory in order for the backup reports to show up again. I guess your plugin may be touching another plugin's dependencies?
Update: I just checked the moodle/report directory between a fresh install of Moodle and the instance that tried to install the BenchMark plugin and the backups folder was deleted!
Hi Jeff,
It's a bug on Moodle 3.x, we have open a ticket for this https://tracker.moodle.org/browse/MDL-55020; many report plugin have the problem.
For the moment, the BenchMark plugin isn't in official list; so it's more complicated to approuve the bug
You can help us with vote system in the bug tracker.
Thanks.
Ah. I learned something new then . I will keep this in mind when I start having to install new report plugins.
After following the directions and cause in the tracker I did install the plugin without issue on Moodle31.
I was surprised that the "Creating files" was getting dinged as this server is 100% local. I went ahead and made a tmpfs RAM disk mount and update the config.php to point to it.
$CFG->tempdir = '/mnt/ramdisk/moodle/temp'; // Directory MUST BE SHARED by all clsuter nodes.
I highly recommend including the settings in config.php, php.ini, or the MUC settings on what to look at just to make it easier
And boom, I went down from 436 to a 105. This is a pretty darn helpful plugin with building environments! I cant wait to try it out when building a new LAMP cluster! Though I do not think my solution for the ramdisk is a good one for lamp clusters as we need that directory needs to be shared across all the clusters.
Without Custom tempdir
With Custom tempdir
Hi Mickael,
your plugin is great. It's an excelent tool to optimize moodle. Congratulations!
I'm attaching my school's moodle benchmark to this post and I'd like your help with the following: my server has two Xeon 5606 cpus, each a quad-core processor, but my benchmark results say my processor is slow. Is this normal? my OS is ubuntu 12.04lts x64 and I have three pairs of raid1 disks, one with os and database, the other with html and the third with moodledata. I'm using memcached and a tmpfs for cachedir and tempdir. As you can see from the munin graph attached, my cpus aren't heavily used, but I can see from htop that all 8 cores are used.
What can be causing this? from my benchmark, can you understand the problem?
Thanks in advance for your help. Best regards,
Rui
I ran this test on my production server and had some disturbing results.
I'm running VMware with 2 VM's - 1 for the web server, 1 for the database server. Because of CPU core limitations in the version of VMware we are using I can't utilize all my CPU cores with just one VM.
The server has 2 Intel E-5 2620v2 chips - each has 6 cores, + hyperthreading @ 2.1ghz
It has a total of 128 gigs of ram.
Each VM has roughly half of the available resources (i.e. 12 virtual cpu's & 60ish gigs of ram)
Hard drives - webserver is on a SAS @ 7200 rpm enterprise server drive and the SQL server is on a 12000RPM SAS drive. I currently have a RAID 1 setup for both drives.
MoodleData is on the webserver drive.
Last year I only had 1 physical CPU and everything was on the same VM, but I've since added a second CPU, added the 12,000 RPM SAS drive, and doubled the ram, but it "feels" "slower". The write speed is what is killing me here. Authentication isn't something I'm super concerned with because we authenticate through Google anyway. The CPU's aren't the newest or fastest and I know that.
I'm at a loss to how to improve this though. I feel like I should get better results. I have Zend OPCache enabled. Should I take some ram and turn it into a RAMdisk for moodledata/temp?
Danny, your setup is certainly more powerful than any of the members on this post at least, have you been using VMWare Workstation or vSphere?
If you thought separating physical box into VM's would benefit in terms of performance, then this unfortunately not the case unless you are using a true hypervisor like vSphere or Microsoft Hyper-V. You could have been much better if putting all things on one box and setting up drives as RAID, as you have multiple of drives, so keep DB on fastest drives.
your setup could have easy scored 60-70ish.
btw what setup you have? in terms of O/S, Web Server, and DB?
I'm using vSphere Hypervisor 6. Running Ubuntu 14.04 LTS, Apache & mySQL. This test was done on Moodle 2.9.5 (I'm gonna push it up to 2.9.7 today.)
I'm a teacher who moved into IT last year so I'm learning as I go, especially on the hardware side of things. I've used Moodle for the past 5 years, but always had offsite hosting so I didn't have to worry about most of the hardware stuff.
I had a feeling that the score should be MUCH lower, but I wasn't sure how low it could go.
I'll post this over in the hardware forums along with the info from Unixbench that Visvanath mentions.
The only thing lagging in your test is drive throughputs, but those who have taken tests with lower scores, most have used PHP 7 and version 7 does improves over time and memory taken to load page, but as you are on moodle 2.9.x so using PHP 7 to re-do test is not feasible, but lets see what unix bench brings your performance to.
https://moodle.org/mod/forum/discuss.php?d=337281#p1359507
Made a new post here to stop the hijack of this thread.
I want to thank Mickaël PANNEQUIN for writing this addon. Without it I would have just had that sinking suspicion that something was wrong but been unable to identify it.
Usman,
Thank you for replying to my post and working with me.
Thank you.
I'll do a bit more digging today and run the UnixBench and then post over in the Hardware and Performance Forum.
Hi Daniel,
Your situation isn't that complex here. You have an issue with the write speed to some of your data locations, and specifically this test is showing results for tempdir. We can fix this.
The short solution for you is to point moodles temp and cache directories to a faster storage medium. As you only have one web server you don't need to worry about sharing these folders between nodes so ignore any discussion about that. As we are only talking about Temp and Cache data we can just put this all into memory rather than writing to disk at all (this has the advantage of freeing up some IO for things that do actually need it too)
Find out where you temp and cache dirs are (usually under moodledata, but also check your config.php to see if they have been manually set elsewhere). Then mount a 'ramdisk' to this these locations, e.g.
# mount -t tmpfs tmpfs /<path to moodledata>/temp
And then again for your cache and localcache dirs... you have bucket loads of RAM so I'm choosing not to worry about sizing here...
Purge your moodle caches in the usual fashion and re-run the benchmark... better? I though so
Now this works your'll want to add these mountpoints to your /etc/fstab so that they come up automatically on reboots... Google is your friend if you need help with any of the specifics here.
Paul
Not sure I see the point of noatime on a tmpfs, but no harm I suppose. Not sure you need to set a mode, my mount points are owned by my www user so the defaults work fine for me. Additionally you may want to set noexec... can't think why anything created in these folders should ever be executable.
So mine looks like,
tmpfs /<path to moodledata>/cache tmpfs nodev,nosuid,noexec,size=<something sensible if anything> 0 0
Thank you to everyone for the followup posts. It is amazing how much a RAMdisk improved my score. Before this weekend I'd never heard of a RAMdisk. Dropping from 2k to 199 is a great improvement. Going from 17 second write time to .38 second write time is amazingly different.
Without this plugin I'd have just suffered under the illusion that this was just a result of "moodle being moodle".
Do I need to worry about setting limits on the RAMdisks? Moodle is the only thing that this server currently handles (although it may get sucked into serving up Wordpress pages for the teachers as well..)
I'll say that I am slightly disappointed in the CPU score as well, but I knew that they weren't the "fastest" chips out there being a few generations old now. Again, I'm not too concerned about the "fake account" connection since we authorize via Google anyway - although if there is a way to speed that up too, I'd take tips.
Yes, you do need to be aware of some things here.
tmpfs by default allocates a size of 50% RAM to the drive. This is only used when data is stored, space allocated to tmpfs is available to the OS for other uses when it is not being used by the disk.
Moodle uses it's tmpdir for all sorts of things, including backup and restore of courses. This can need GBs of data depending on your course. If the backup process runs out of space it fails and can leave partial files lingering in your tmpfs taking up space causing knock on problems. For you you have such a totally ridiculous amount of RAM this probably won't be an issue... but be aware of it and manage it if needs be.
An alternative to tmpfs is ramfs. ramfs does not have space restrictions and will grow as large as free memory will allow will then spill over to swap causing a huge hit to your IO performance. Make sure you don't use ramfs.
If you are worried about a tmpfs for your moodle tempdir being too small consider adding an SSD to your setup for the purpose instead,
Hi Daniel,
There are a couple of things to bear in mind here. Moodle has several directory options available to you to help you with performance. These include the ability to set your dataroot, as well as tempdir, cachedir, and localcachedir.
Of these, the dataroot, tempdir, and cachedir must be shared between all nodes in your cluster. The localcachedir is a local option which does not have to be shared.
The thing about shared file systems is that they are typically slower - they have to handle file locking, and are usually network based file-systems (which are also typically slower).
The test above is a write test of the tempdir, which is one of those directories which must be on a shared file system. As a result it may be slower than if you are running in a single machine system.
The other thing to bear in mind is that RAID1 is typically slower than without RAID because you have to write to both disks and have confirmation that both disks wrote successfully before the operation completes. Reads are much faster though.
As a side note, we are moving many of the operations which happen in tempdir to localcachedir where possible. We cannot move all operations, because some of them need state to persist between page loads. At the moment the ones which will not be moving are backup, restore, and the plugin installer.
I'd recommend you check that your localcachedir is actually local to each node in the cluster (e.g. not shared).
I'll also suggest to the maintainer of this plugin that they also perform some write tests in the localcachedir.
Andrew
Now that the plugin has 1 month, I am enchanted that it is useful and that it highlighted the problems which some meets .
What tests you would like to see in the following version?
Thanks for this great plugin,
I'm running Moodle v3.0.3+ live server with:
The score was 442 points detailed below:
P.S. the test was done at a time the server is generating an automated backup, but that score is not steady and differs to reach more than 900 point sometimes.
Though I would suggest, if you please, to have a history of the tests or may be a script to be run in a schedule !!
Finally, any suggestions about fixing those issues? FYI the database check gives no issues!!
Best regards,
Hi,
Here is another test after the automated backup finished, and the surprise is that the score comes higher!!
Description | Time in seconds | Acceptable limit | Critical limit | |
---|---|---|---|---|
1 | Moodle loading time
Run the configuration file «config.php»
|
0.062 | 0.5 | 0.8 |
2 | Function called many times
A function is called in a loop to test processor speed
|
0.511 | 0.5 | 0.8 |
3 | Reading files
Test the read speed in Moodle's temporary folder
|
0.026 | 0.5 | 0.8 |
4 | Creating files
Test the write speed in Moodle's temporary folder
|
0.793 | 1 | 1.25 |
5 | Reading course
Test the read speed to read a course
|
4.869 | 0.75 | 1 |
6 | Writing course
Test the database speed to write a course
|
0.416 | 1 | 1.25 |
7 | Complex request (n°1)
Test the database speed to execute a complex request
|
1.047 | 0.5 | 0.7 |
8 | Complex request (n°2)
Test the database speed to execute a complex request
|
2.477 | 0.3 | 0.5 |
9 | Time to connect with the guest account
Measuring the time to load the login page with the guest account
|
0.011 | 0.3 | 0.8 |
10 | Time to connect with a fake user account
Measuring the time to load the login page with a fake user account
|
0.063 | 0.3 | 0.8 |
Total time | 10.275 sec. | |||
Score | 1028 points |
Hi Mickael and all
I have been reading through this post and the stories of everyone who tested the plug-in and benefited from it, it has been a year since your first version so I went to GITHub and gave it a try on my development laptop and got about 140 score - its just a MacBook with VM running ubuntu (everything related to moodle is on ubuntu VM).
This is just an intro to my question,
As I'm tasked to size a large moodle implementation for 25,000 students all running on moodle, every student will be watching average 2 lessons per day (each lesson is 45 minutes video + followed by 20 questions quiz), I can't estimate actual concurrent users as the tool will be available 24X7 and students can login at their preferred time.
What I have noticed is that most moodlers who shared benchmark didn't share number of students so if I need to use the benchmark plugin to help me size the hardware I need in my case how can I do it,
and I mean now during planning the hardware not as optimization afterwards.
thanksIf every student will be watching average 2 lessons per day (each lesson is 45 minutes video + followed by 20 questions quiz), then I think that it would be very useful if you can host all of these large videos in a separate server (it can be your own server, a YouTube channel or any other solution) , not in the Moodle server.
The Moodle quiz can use many resources, and it will benefit greatly from a generous hardware and a very optimized (tuned) database.
Hi Germán
I ran into a company called VDOChipher who seems to integrate well with Moodle (I have tested it on my laptop and is easy to manage), they come for a price but I think it can be justified given the protection of my video vs youtube)
How do I get more concrete about the 'generous' hardware, every post I find talks that same language but i'm struggling to understand how to build my architecture and servers.
So at one side how to size the servers and on the other how to design the architecture (one machine for all vs distributed architecture), I intend to host all on a hosting server but how to size is my biggest concern.
Production Server migrated from 2.8 to 3.1
I focus on budget, high performance Moodle installations and setups.
Hardware:
CPU - i7-980x (6c/12th)
RAM - 24Gb DDR3
SSD - 2x - 128Gb Samsung 850 Pro - Raid 0
HHD - 2x - 1.5Tb - Raid 1
Amazon S3 offsite storage
System:
Ubuntu 16.04
Nginx 1.10
PHP 7
MySQL 5.7.13
Ram Disk - 4Gb
Average Benchmark is about 70 points.
Hi,
First of all I want to thank Mickaël PANNEQUIN for developing this great plugin, it's been really helpful to detect and fix performance issues.
The server I have several Moodle instances installed on is this:
I've realized that having the same BD, web server and storage configuration in all the instances doesn't make them get the same score, seems like the Moodle configuration on each one has also great impact, but it's not trivial to know which these settings are.
For example: I've detected that having several authentication plugins enabled makes the last two tests slower, but one of the instances gets slower scores in tests 3 & 4 and another one in the first one and I have still no clue about why is this happening, do you know what can it be?
# | Description | Time in seconds | Acceptable limit | Critical limit |
---|---|---|---|---|
1 | Moodle loading time Run the configuration file «config.php» |
0.010 | 0.5 | 0.8 |
2 | Function called many times A function is called in a loop to test processor speed |
0.152 | 0.5 | 0.8 |
3 | Reading files Test the read speed in Moodle's temporary folder |
0.011 | 0.5 | 0.8 |
4 | Creating files Test the write speed in Moodle's temporary folder |
34.197 | 1 | 1.25 |
5 | Reading course Test the read speed to read a course |
0.121 | 0.75 | 1 |
6 | Writing course Test the database speed to write a course |
0.023 | 1 | 1.25 |
7 | Complex request (n°1) Test the database speed to execute a complex request |
0.070 | 0.5 | 0.7 |
8 | Complex request (n°2) Test the database speed to execute a complex request |
0.141 | 0.3 | 0.5 |
9 | Time to connect with the guest account Measuring the time to load the login page with the guest account |
0.460 | 0.3 | 0.8 |
10 | Time to connect with a fake user account Measuring the time to load the login page with a fake user account |
0.300 | 0.3 | 0.8 |
Total time | 35.485 sec. | |||
Score | 3549 points |
Thanks for a great plugin.
What do you thin could improve my performance?
Thanks,
Hi,
We've recently changed our Moodle server and moved from a physical server to a virtual server over VMware, these are the new servers' HW & SW:
Hardware (virtual over VMware)
60 GB dedicated RAM
16 CPU dedicated cores (over 2 x Intel Xeon Gold 5118 @ 2.30 GHz physical processors)
Storage: OS, database and MoodleData on a NetApp (20 * 900 GB SAS disks with 1.34TB SSD flash pool) over 10 GbE connection
temp, cache and localcache stored on RAM with tmpfs
Software:
Ubuntu 18.04 Server
Apache + PHP-FPM + OPCache (PHP 7.2)
Postgresql 10.6
Sessions on Redis
Moodle 3.5.5
We're getting around 70 points in average, this is one of the best scores:
Very useful. I have installed a couple of Moodles in the last week.
My first was on a Raspberry Pi, a standard Apache Mysql on Jessie Lite, Score 3424. Must try to improve it .
Second on a VPS through Hostinger with a Gig of Ram, 250b of virtual memory and a Intel(R) Xeon(R) CPU E5-2609 0 @ 2.40GHz, 2 cores. Costing me $6 for a month and a score as low as 300. Currently installing on what might be my production server using Debian 9 so will be interested in that benchmark.
These are empty installs - there is no courses. Biggest problem - writing to the temp folder,
Very easy to use as well - even at my level of expertise.
Hi Dinesh,
You shared lots of software details, but nothing about your hardware which is just as important in answering your question.
Looking at the PDF of your results, I would guess that you are using a spinning hard drive. A solid state drive, SSD, usually makes a huge difference in Moodle performance. Not far above these posts you can see an example of that in the results from a Raspberry Pi3B, small board computer, that actually performs pretty well, simply because it has solid state storage.
Dear Sir ,
Thanks For your reply .
please find the server details
Dell Pro510
Server CPU :- model name : Intel(R) Xeon(R) CPU E5506 @ 2.13GHz
MemTotal: 16250640 kB
MemFree: 13146192 kB
MemAvailable: 14844328 kB
[root@moodle ~]# lsblk
NAME MAJ:MIN RM SIZE RO TYPE MOUNTPOINT
sda 8:0 0 278.9G 0 disk
├─sda1 8:1 0 1G 0 part /boot
└─sda2 8:2 0 277.9G 0 part
├─cl-root 253:0 0 50G 0 lvm /
├─cl-swap 253:1 0 7.9G 0 lvm [SWAP]
└─cl-home 253:2 0 220G 0 lvm /home
sr0 11:0 1 1024M 0 rom
If any more infor reqd , please let me know ..
As mentioned before, I think you are using a spinning harddrive. Is that correct? If so, you can speed things up a bunch by using a SSD.
Hi guys,
I think that maybe we have the worst benchmark ever:
What should i do first? where I start to optimize? what should i check to get a reading course score more lower? please help.
Server:
Processor: Intel xeon e5-2640 2.40ghz 2.39ghz (4processors)
Ram: 8gb
os: Windows servier 201664 bit - IIS 10
php: 7.2.x
Bd: SQL Server(external server)
memcache activated
temp - sessions - cache folders on a ramdisk SCSI
Cache report:
Great plugin by the way.
Maybe, since your database is on an external server, it's possible the network link speed to it is too slow, or has some other sort of problem.
Hi, thanks for the answer.
How do you think that i can test this "it's possible the network link speed to it is too slow"...
For otherhand i realized this about disk drives:
Those hard drives are on a virtual machine? maybe thats the reason why read/create files are too slow?
This are some test to the database from the login page:
SELECT f.filter, fc.name, fc.value FROM mdl_filter_active f LEFT JOIN mdl_filter_config fc ON fc.filter = f.filter AND fc.contextid = f.contextid WHERE f.contextid = '1' AND f.active != '-9999' ORDER BY f.sortorder [array ( 0 => 1, 1 => -9999, )]
One thing you should try is to turn on debugging to developer mode, and also turn on Performance info. Hopefully, that combination will let you know is something is being reported without you knowing it, and the performance info added to the footer may give you some clues as to what you need to look at.
Thanks for your help...
I did it already, but the only information that i get is the time that took the page loads, on avg tooks more than 5-10 seconds on admin pages and more than 10-15 and even 20 seconds on courses pages.
Also i changed the theme but nothing and i have no errors with debug mode on.
Here are some test:
/admin/index.php?cache=1
/admin/search.php
/my/
/course/view.php?id=7
Unfortunately, to me, those times for page load and DB queries seem extremely slow. As a comparison, I have a small testing cluster made up of 5 Raspberry Pi 3 small board computers. It is set as one load balancer, two web servers, one DB server and one file server. The communication between the cluster components is over their standard 100MBps Ethernet connectors.
Here are the same pages on my cluster:
/admin/index.php?cache=1
/admin/search.php
/my/
/course/view.php?id=7
Since your system of Processor: Intel xeon e5-2640 2.40ghz 2.39ghz (4processors) is so much better than the Pi 3's processor and speed, there is definitely something wrong with your setup, for my little cluster to be so much faster.
Thanks a lot for taking time and help me with this, i really appreciated, also thanks for sharing in here those screenshots.
What can i see its a problem related to the connection between database and our dmz server. Im going to try resolve the issue but if you have some suggestions, these are welcome.
Thanks again.
My initial suspicion would be the PHP MS Sql driver that you are using - the PHP drivers for MS Sql are known to be pretty average in terms of performance.
Are there alternatives? (When you have to run MS SQL Server and moving to Unix/Linux is not an option)
I was wondering which temporary file are they talking about when I got this>.
The harddrive seems too slow.
are they talking about system/os temp folder /tmp (in our Redhat 7.5 VM instance) or are they taking about $moodledata/temp location?
maybe it does not have enough room?
I think the moodledata temp folder.
Acctually i changed that folder to a ram disk.
Maybe I should use a passthrough disk
Looking at the benchmark code I have no problem running this on our production site. To show how the benchmark results can change depending on the load: these are benchmarks on the same system but the slow one was during a load test.
observations:
- "reading course" is only testing database access times
- "reading/writing files" is on the TEMP directory and will change much depending on the load of the system as you can see.
I found that under heavy load there is not much going on in the temp folder. It is nice to see lower figures in the benchmark but will it speed up normal Moodle usage much?
Hi Visvanath,
The hardware is all hidden and everything runs on VMWare ESxi cluster VM's. I was told the disks are all SSD so it must be NFS and other overhead causing slow file access times.
We
have a setup with 4 webserver VM's running Apache and PHP-FPM 7.0 running RHEL6
with a shared document root on NFS. The Mysql database is served on two other VM's.
When running everything on a single 6-cpu VM with a ramdisk as temp folder the benchmark will get 60 points but that setup was not recommended. And using Moosh with a ramdisk as temp folder soon failed when deleting courses because Moosh will create a 10GB backup on the temp folder if the course is big.
More details:
Mysql (shared with other servers): 2x VM, 4CPU’s & 8GB Memory, RHEL6.10
Webservers: 4x VM, 2
CPU’s & 8GB Memory, RHEL 6.10, Apache 2.4 i.c.m. PHP-FPM 7.0
Shared filesystem is NFS (network Filesystem).
The benchmark plugin runs tests on one single webserver (and the loadbalancer decides which one). That is just fine but it will not represent the performance of the whole setup of course.
Why is a single system not recommended? Well, the current trend is towards microservice architectures that scale dynamically with the load. Adding extra web nodes can be done without bringing down the system. And there is redundancy, no single-point-of failure, the seperation of concerns between serving the database, the filesystem and the web requests etc etc. In other words: it is "good practice" and "it scales better".
Using JMetered quizzes proved that the load-balanced setup with multiple small VM's could indeed outrun the single-server setup. But I guess if you could add all cpu's and memory and nic's together and put it in a single machine that would be faster and cheaper if the load stays below a certain limit.
After some load tests and consulting Moodle Partner experts from Uplearning we managed to find the bottleneck: NFS (of course). Using a fast Redis APPLICATION cache (sessions can go in /tmp or ramdisk) we can now handle 1000 users logging in within 30sec (rampup) doing a 40-question quiz with 1 second delay between each question. The avg page load time is now under 7 seconds.
A thing to look at when using a load test is the number of RUNNING tasks on the webserver. If a lot of processes have a D instead of R (Running) they are probaby waiting for access to a (cache) file in a slow filesystem.
So the benchmark was useful in detecting the slow "create files" score on the moodledata shared application cache. And Redis is a way to get around that and get DOUBLE throughput.
Hi,
Thanks for this good plugin
Has anybody managed to have good perf on AWS?
Cheers,
Patrice
Could you describe how to use this?
I recently lost my main site and so created a new Moodle site from the backup - set up in one evening from a new server so no real time for testing. I wanted to know its performance so I ran the benchmark test. Results weren't bad, about 300 with the areas of concern the database. Clicking around, my new site looked responsive. I updated all student passwords on the new site and in the next class asked them to log in to test the new site.
There were about 60 in that class using their phones and each was being redirected to the "Must change password" screen. Except page loading was terribly slow - probably a minute or more. My site was seriously under-powered. In desperation I ran the benchmark again - I know, not a good idea - and the new benchmark was around 14000 and the Moodle loading time was around 2 minutes. My site was like a bicycle, quick away from the traffic lights but incapable of handling any real load.
So how do we use this plugin? Are there recommendations for testing under load?
I never could get anything good on a solo EC2 instance. However, I just spun this up yesterday to move over a way overburdened server. Went from 2203 yesterday morning to 83!
Using SSDNodes, 24GB 10x KVM. I've never had a VPS run so slick. Anyway, now off to see if I can get that score down even lower.
Hardware:
RAM - 24Gb DDR3
SSD - 120Gb NVMe
System:
Ubuntu 18.04
Moodle 3.6.2
Nginx 1.10
PHP 7.2
MariaDB 10.1.38 (5.5.5)
Software:
Hardware:
Here's my development site results for Benchmark, Moodle 'Test Performance' and my jmeter plan. cpu/memory look fine during testing but results still poor.
'Creating files' looks like the bottleneck, message below indicate slow hard drive for temp folder.
What temporary folder(s) does this refer to ('moodledata/temp' folder)? Not the cache folders? What should I do with this folder, can I move it to memory?
Environment:
Moodle 3.3.6
Windows 2008r2/IIS7.5/php7.1/mysql5.5
VMWare/12gb ram/intel xeon cpu e5-26700 @ 2.60 ghz (4cpu)
my jmeter plan shows 2sec for page load.
would these results suggest the moodledata/temp folder be a good candadite for a ramdisk drive?
$CFG->tempdir = '/tmp/moodle/tempdir'; // Directory MUST BE SHARED by all clsuter nodes.
$CFG->cachedir = '/tmp/moodle/cachedir'; // Directory MUST BE SHARED by all cluster nodes, locking required.
$CFG->localcachedir = '/tmp/moodle/localcachedir'; // Intended for local node caching.
thanks for the information, especially the CFG setting suggestions
I created a ramdisk for those 3 folders than updated config.php for the new location and the score improved significantly 28sec->7sec .
Moodle cache scores a lot different now too, not sure how to interpret them though.
Still 3 Critical warnings, not sure what to do about them?
my only concern now is what the downside or risks may be, at the moment I cant think of any seeing as my largest course backups are much smaller than allocated ramdisk.