- I have 3 old servers IBM 3550 M4 model 2013 with 2 CPU/server, 192 GB RAM DDR3 / server, HDD sas 10K
- Install EXSI and create VMs on these servers: 6 web server (4CPUs, 16GB RAM), 3 mariadb database (4CPUs, 16GB), 3 MoodleData (4CPUs, 16 GB RAM), 2 maxscale (4CPUs, 16 GB RAM), 1 redis cache (4CPUs, 16 GB RAM), 2 Nginx loadbalance (4CPUs, 16 GB RAM).
Yes, reusing old servers is one possibility. But it is not that simple. The old server might consume more energy than the new server. Even then, one has to take the "gray energy" or the https://en.wikipedia.org/wiki/Embodied_energy in to account. The only clear case is, if the old server is running any way, add more site to the old server rather than buying a new server.
I was thinking along some figure like "number of Moodle users per Watt". I know, there is no standardized "Moodle user". But even for the super computers there is the benchmark "Mega FLOP per Watt" https://www.computerworld.com/article/2535438/how-power-hungry-are-the-top500-supercomputers-.html. Why can't Moodle find a something comparable?
Ri: Re: Energy efficient Moodle servers: Ideas, examples, ..
Re: Ri: Re: Energy efficient Moodle servers: Ideas, examples, ..
Agree. It is easier to design a benchmark for HPC, there is no need even. Everybody seems to be focused on the LINPACK benchmarks. The Moodle crowd is very diverse, and they care only about their particular scenario(s). The teacher wants to know, "Will Moodle stand my exam tomorrow?". The school administration wants to know, "Will Moodle throw 'Connection refused' again during the peak hour?"
On which "user pattern is the right one?": If our friends in the economy department came up with the consumer price index, why we the benchmark obsessed Moodlers can't?
- https://docs.moodle.org/dev/Load_testing_Moodle_with_JMeter
- https://docs.moodle.org/en/Test_course_generator
- https://github.com/moodlehq/moodle-performance-comparison
and many more.
In fact there is the plug-in https://moodle.org/plugins/report_benchmark. Very easy to use. The problem is, it gives you 10 numbers on system performance without ramping up Moodle. And the results are in seconds, not in "Max. number of users" or such thing in the sense of cut-offs.
Hi AL
Yes, Sam Marshall's "Perspective" https://moodle.org/mod/forum/discuss.php?d=57028 was the measure in the old days. Surprisingly it gave the result in "max. number of simultaneous users". But how that formula was derived is anybody's guess. Same with the Howard's index. (Was it 20-50 users per GB?)
About developing something, I don't think that is even necessary. One just have to define a procedure making use of the many tools that are already available, finally giving a cut-off number of users for a specific (market basket) scenario. And that number will be divided by the Wattage to get the equivalent of "megaflops per Watt"
1) If you are still thinking in terms of a big box or a little box then you are asking the wrong questions. At times you will be over specc'ed and at other time you wan't handle load. You need to move to a more dynamic stack which scales on demand so you can walk the knife edge of never using more than you need but always having enough for your needs.
2) Roughly speaking if it is cheaper then it consumes less power. For example AWS and every other cloud provider wants you to actively game the system to use their services differently in a way which is cheaper, and you should play that game. But playing this game can be very complex so see below.
3) Make this a business problem not a technical one. For example if you are self hosting then you need a lot expertise to do so, and do so efficiently. If you outsource that to a Moodle partner (I'm with Catalyst IT) and lets say you have a fixed price per year, then this creates a very strong financial incentive for us to run our hosting as efficiently as we can across our fleet, and we are very aggressive on this front. Most performance / efficiently improvements are not financially viable for a single organisation to tackle themselves until they get to a very large scale, so join forces with someone aligned the same way.
As an aside, I really like the idea of report_benchmark, but in practice it needs a big rethink to give some better and more fine grained metrics in more useful units.
Thanks for the response. Yes, I know that you are busy in this field.
To you points:
> 1) If you are still thinking in terms of a big box or a little box then you are asking the wrong questions.
I get your point. If the Moodle instances are packages one per "box", it'll never be energy-efficient. Because the "box" is decided on the _peak_ load (at best), at normal load it is still burning the same power.
> 2) Roughly speaking if it is cheaper then it consumes less power.
> 3) Make this a business problem not a technical one.
Agree. A (Moodle) hosting business, i.e. running many Moodle instances, will automatically utilize the unused power of some customers to feed the others. As you say, they have the know how, and above all, have the interest not to waste hardware thereby automatically conserving energy. I can't deny that. In fact, I imagine Moodle Cloud to be a strong example of this effect. Imagine, every Moodle Cloud customer running his own box. Then Moodle will challenge the crypto miners in global warming.
But still there is a large segment of Moodle servers running in DIY mode. My OP is addressed to them. As many discussions in this forum would show, and discussions I'm having outside the forums, many institutions starting Moodle have exaggerated ideas of their usage. The irony is, for many institutions (in the West) the energy (and infrastructure) bill is still very small compared to the salaries. So they go for the "best server you can buy". The intention of the OP is to show them what modest and small boxes can do, as an argument against this kind of thinking.
Does the cron come into this? Cron tasks can do all sorts of things up to every minute, database changes, file changes, network requests, all contributing to load.
One would expect most core tasks to be fairly well tuned but it maybe there's scope to reduce the frequency of some of these to reduce load (I haven't investigated this).
Then there are plugins which may also have tasks but where perhaps fewer people have looked at the code or examined the performance. I've seen one report of potential for tuning in mod_customcert (#387), this task is run every minute by default. In the absence of any improvement at code/query level this could perhaps be run (for example) every two minutes presumably with a resulting reduction of load with minimal loss of functionality.
I haven't looked carefully enough at how the tasks are scheduled and sent to the background after Moodle went through a major overhaul in this central topic. (Yes, it is the pulse of a Moodle site.) So I can't say whether spreading the individual tasks differently will lead to less load. The general topic though, optimizing the application, always applies. But I excluded that, because that would mean code changes, which is beyond what I envisaged.
Here's another one I've recently run into, file storage wasted by unwanted/unused PDFs (MDL-71909).
If you have the core assignfeedback_editpdf plugin enabled – the default setting – then a PDF is created for every assignment submission even if Annotate PDF isn't selected for that assignment. Worse, if the submission doesn't have a PDF equivalent (such as submitted media files) then a blank PDF is created. Worse still, because the blank PDF is timestamped each one has a different content hash. So you can end up with many unused (and useless!) PDFs in Moodledata which could all be blank.
You can disable this plugin to stop it happening (assuming it's not used for any assignments across the site) – but the submissions still get appended to mdl_assignfeedback_editpdf_queue and not removed (because the plugin is disabled). If you ever subsequently enable the plugin the queue gets processed (by \assignfeedback_editpdf\task\convert_submissions) and you get as many PDFs as there have been assignment submissions (excluding any submissions or mod_assign instances that have been deleted).
So with the no-code-change view I'd recommend disabling this plugin unless this assignment feedback type is actually being used.
Re: Energy efficient Moodle servers: Ideas, examples, ..
P.S. @Leon, thanks for your cleaning script. I am yet to upgrade to those versions yet. And my major sites (two) are still 3.9 LTS.
Re: Energy efficient Moodle servers: Ideas, examples, ..




CPU temperature. Yes, that is the place where I should have been more cautious. The Pi 4 B has these two tiny "heat sinks", these may be 20 m square Aluminium fins, pasted to the chips. No fans, I don't like them. And worse, it is in the standard black Pi 4 case made of plastic and inside a closed rack cupboard. It is in a corner of a larger office space which has air conditioning. The history is that the RPi was initially a MoodleBox. So I didn't want to lose the wi-fi signal by putting the RPi in a metal case. I changed it last-minute to a regular LEMP server, manually installed. Had not many options in "housing" the server.
Yes, the graph shows that the CPU touched 80 C, the throttling temperature. I will give it a heavier heat at the next chance.
@Brett, according to the specs a RPi 4 *can* draw up to 15 W since 3 A are recommended for the power supply. I wish, I had a proper Watt meter on site! I quoted what I generally see on the web. Once I thoroughly measured the consumption of a RPi 2, can't remember the numbers, but they were well below the specs. An important reason is as headless server I don't connect anything to the device other than the Ethernet. And the load is spurious as usual in this kind of applications - only the live class generate heavy load, otherwise idling.
Re: Energy efficient Moodle servers: Ideas, examples, ..
https://www.raspberrypi.com/documentation/computers/raspberry-pi.html#typical-power-requirements
I guess that explains the big temperature difference I see, yours is in a case inside a cabinet. My SBC's are all in open air, dog bone stacks of three, six, seven, and seven. Plus the two stacks of seven RP's are all diagonally about four feet to the left and three feet below a ceiling fan that was running all the time when I was doing my performance checks.
Went back and did some looking at old pictures from January of 2013 where I was running Sam's old test on the sever I had just built. My old 66MHz server supported a whopping 4.99 "concurrent users" with 100% success for each requests. My new 3.7GHz upped that to 54 "concurrent users" with 100% success for each request.
While the report generated was interesting, I found that the OS System Monitor was even more interesting to watch live while the test was running. Memory usage was almost a flat line at around 10% of 32GB in use throughout the test. However, Network History, both sending and receiving, appeared to look like a square wave of 24.0 KBps and 48.0 KBps, with 8.8GB total received and 406.2MB total sent.
Even more interesting was the CPU History. During the early ramp up stage of the test, I could see the hint of a couple of square waves when two of the CPU's where at about 49%, three others were in use at 3%, 11.1% and 20.0%. The other three were flat lined at 0%. During the rest of the test, I could see all the CPU's becoming more and more involved until occasionally, I was seeing all eight CPU's basically maxed out at 97% to 100%. Between attempts, CPU usage would drop back to 4% to 12% on three, with 0% on the other five. The timeline graph looked very much like a nice square wave.
I need to see if I can find the test file and put it back in use to see what a Raspberry Pi and Orange Pi performance looks like. Maybe a Jmeter test too! 😁
Yes, some common load testing scheme would be nice to compare these boards functioning as Moodle servers. The stress-strain type of testing, for example what JMeter does, is the most obvious. But after I've noted that JMeter has (had?) different (old?) versions for Linux and (the latest) for Windows and the mess Java make with endless dependencies, I stopped experimenting. I don't see me going back there for some months!
Hi Germán
Simply because that group of 40 was accessing the Pi through the wired LAN! In addition there were a handful connected through the wi-fi interface of the Pi configured as an access point, but only via SSH for monitoring purposes.
Maybe you were thinking of the MoodleBox, which has this ~20 user limit, if connected through its built-in access point. That is because of the power limit of the wireless transmitter in the Pi (hardware) and how the network driver of the wireless interface optimized.
If you want to go beyond that limit you need an additional access point. See https://discuss.moodlebox.net/d/60-connect-an-access-point-to-the-moodlebox/7.
Data Centers Are Consuming Electricity Supplies - and Possibly Hurting the Environment
Re: Data Centers Are Consuming Electricity Supplies - and Possibly Hurting the Environment
- Microsoft chooses infamous nuclear site for AI power (20 September 2024)
https://www.bbc.com/news/articles/cx25v2d7zexo
- Google turns to nuclear to power AI data centres (15 October 2024)
https://www.bbc.com/news/articles/c748gn94k95o
Re: Data Centers Are Consuming Electricity Supplies - and Possibly Hurting the Environment
I guess average electricity prices around US 30 cents a kw/h. At that figure, a 10 w load over the roughly 740 hours a month will use around $2 a month of power. A Pi may use as little as 2 watts in active mode and so
a monthly bill of 40 cents. Most old boxes reconfigured as servers will use in the range of 50 to 100 watts and that is $10 to $20 a month.
I fire up remote servers if I want to play with something and a low spec 1 CPU/1 GB RAM costs between $1 to $6 monthly depending on the supplier. Allowing for their hardware, internet traffic, service support and billing, their power costs must be a fraction of the billed figure. Not surprising as well utilized servers are going to be more energy efficient than idle servers.
Hello Visvanath and all Moodlers! 🌟
This is a fantastic and very important question, especially nowadays with the growing awareness of sustainability and resource optimization! When we talk about creating energy-efficient Moodle servers, we're entering a field that involves both hardware and software, but there's no way to remove significant parts of Moodle without affecting the ability of students to access Moodle pages.
So the solution is to prevent requests from reaching the server. And for that, a CDN is one of the most effective ways to reduce the load on your main server. They work as global distributors of your content, reducing the number of direct requests to the server and improving latency for users in different parts of the world. I have had a very positive experience with BunnyCDN, where I managed to reduce direct requests to the server by up to 90%! Check out this article I wrote on the topic, I think you'll find it quite inspiring: Optimizing Moodle Performance - BunnyCDN. 🌍⚡
In addition to a CDN, implement caching at multiple levels: browser cache, page cache, and application cache (such as Redis or Memcached). This drastically reduces the load on the server by allowing Moodle to load static content directly from the cache without needing to process everything again for each request.
Eduardo Kraus
Professor / Programmer / Passionate about Moodle / Innovation and new products
While CDN's definetly can massively improve performance and user experience if its not your infrastructure serving the content it is someone elses. Caches are definetly a critical part of any Moodle installation at scale and there are some economies of scale to be had here but I'd question them on the energy efficiency front. Any caching requires large volumes of data to be held in memory, large NoSQL databases etc. I'd be really interested to see any specific studies on this.
Hi, Brett! 😄
You raised a very interesting point about the use of cache and CDNs in Moodle, and I’m excited about it!
First, it’s worth highlighting that although caches and CDNs use resources and require memory to store large volumes of data, the performance and energy efficiency gains they bring can be significant, especially in large-scale installations like Moodle. What many don’t realize is that the resource consumption of cache is actually much lower compared to the processing Moodle needs to handle when responding to all requests directly.
Imagine that without cache, each simple request to load an image (for example, via pluginfile.php
or theme/image.php
) has to go through several steps: opening multiple tables in the database, authenticating the user, checking permissions, and only then delivering the file. This not only increases latency but also adds a significant load on the database and the application server.
With cache in place, on the other hand, these static files (like images, PDFs, videos, etc.) are served directly from the cache, eliminating the need to query the database. This drastically reduces backend processing, frees up server resources for more critical tasks, and lowers energy consumption.
The use of CDNs and local cache reduces energy usage because the main server doesn't need to handle so many repetitive requests. This also results in a better experience for the end-user, with faster load times and less strain on the server.
Eduardo Kraus
Professor / Programmer / Passionate about Moodle / Innovation and new products
Thanks for your contributions. In fact they came from an unexpected corner. I always connect power consumption with the hardware. For example, a certain machine consumes so many Watts when idle and so many Watts when running at full throttle. Therefore my approach is to gather experience from production and simulated environments to estimate the size of machine needed for a specific case - not to buy exaggerated hardware. But that has a practical problem. Rarely the system administrator buys (or advices on) the future server. Either he rents space in an available data center or the (IT) management procures the equipment. So the "learned estimation" of a sys admin has no value.
But you have a point. Even when the machine is given, if one can reduce the strain on the machine for the same load, it'll consume less energy. That a layer of caching around the server would make it more efficient makes sense. By how much is the question. I read in these forums that, since Moodle serves individual web pages to the users, there are not many common content to cache. As a result the efficiency gain is small. Maybe the counter argument is that CSS and JS are the same. And during a synchronous on-line exam Moodle is probably sending the same content to many users. Still I'm interested to know how you measured the 80% in your report.
Virtualization has the same problem: Given a big iron machine how would it consume less energy if it is virtualized or containerized? I would say, virtualization and containarization allow to put more Moodle instances on the same hardware, rather than buying new hardware, that saves energy.
Admittedly all speculation, I don't have measurements on those things. Happy to see reports from you all. @Eduardo, perhaps an English translation of this report https://pt.linkedin.com/pulse/maximizando-performance-cluster-do-moodle-eduardo-kraus-g3tif is on the way.
Re: Energy efficient Moodle servers: Ideas, examples, ..
I was looking for a home server and found this: HP EliteDesk 800 G1 DM. It is a 20x20x3.5 cm thing. With 8 GB RAM and without disc goes for USD 80.- in the second-hand market. A colleague said he measured 20-50 W from idle to maximum power. It has a quiet cooling fan. More amazing thing is through BIOS you can stop it completely when idle.

HP EliteDesk 800 G1 DM and RPi 4B are worlds apart in server performance. I get consistently a score of only 220 with a RPi 4B 4G: https://moodle.org/mod/forum/discuss.php?d=464548#p1864999. Compare that to the score of 40 with the hp. (lower the better, in a logarithmic scale, so 40 is more than 5.5 times better than 220).
Discovered that the original YouTube nerd had made an "unboxing" video an year ago:
Renewed i5 Mini PC: HP EliteDesk 800 G2
https://www.youtube.com/ watch?v=ZPX3A7YS-6Q (remove the blank)
Suspiciously good to be true:
Tiny Linux kernel tweak could cut datacenter power use by 30%, boffins say
Not bad for 30 lines of code