Moodle cluster (high availability and load balance) with Raspberry pi 4

Moodle cluster (high availability and load balance) with Raspberry pi 4

by Eduardo Alexandre Gula -
Number of replies: 3

Hi,

I'm researching on being able to use and configure a cluster with Raspberry 4 to run Moodle. Maybe using models with more memory (4Gb or 8Gb).

Thus, with the use of some units, the idea would be to have a system of high availability and load balancing, being able to allocate some Raspberry pi to receive user requests, others for the system, for the database, etc.

I met a project involving Raspberry pi (in the case of individual and not cluster use) that mentions up to 30 users, but in the specific case desired, the intention is to be able to serve a much larger number with the cluster configuration, with around 2500 users , with approximately 500 connected simultaneously.

Are there any use cases in this regard?


Eduardo


Average of ratings: -
In reply to Eduardo Alexandre Gula

Re: Moodle cluster (high availability and load balance) with Raspberry pi 4

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

You are trying to bridge two realms. The clustering people are in the cloud and have their own group https://moodle.org/mod/forum/discuss.php?d=414040. Moodle on Raspberry Pi is a different project all together https://moodlebox.net/. Ultimately not many in this forum do both, with the exception of AL Rachels perhaps https://moodle.org/mod/forum/search.php?id=5&forumid=94&user=AL+Rachels.

Coming down to numbers, your estimation "500 connected simultaneously" means 500 users have interacted with the server within the last 5 minutes, as shown in the "Online users" block in Moodle? Well, MoodleBox has reported up to 200 without clustering, a single R Pi as all-on-one Moodle, https://discuss.moodlebox.net/d/260-plans-for-moodlebox-bullseye-and-64-bit/14. As you know, these numbers do not scale linearly. Clustering brings its own overhead. Ref. https://docs.moodle.org/en/Server_cluster and https://docs.moodle.org/en/Caching.

Warning: MoodleBox is excellently optimized/tuned. It runs fluidly on a R Pi 3 A+, the half-size R Pi with only 512 MB RAM https://www.adafruit.com/product/4027.

My question is, why cluster micro computers when a single state-of-art server, properly configured, is likely to handle your load?

Do you have a particular architecture in mind? Since Moodle has various components, web server, PHP, database server, cache server, file server, a flexible cluster tends explode in number of units.

How does high availability fit in to this? What kind of failures do you want to account for? What are your single points of failure? Nobody has eliminated all of them.
wink
In reply to Visvanath Ratnaweera

Re: Moodle cluster (high availability and load balance) with Raspberry pi 4

by Eduardo Alexandre Gula -
Hi,

First of all, thank you so much for the amount of information in your response.

Why did I think about using a Raspberry pi set? I list some reasons:
1. I work at a university and this could be an interesting case study.
2. Yes, there is the possibility of a more robust server, even being able to virtualize some servers. However, by having a single server, the chance of hardware failure can stop access to the entire platform. One option would be to buy 2 physical servers. But in that case, the cost would increase significantly.
Just to give you an idea, a DL380 server (32Gb of ram, 1x CPU, no disks is around $3,800.00 (already converted from local currency), while a Rasbberry pi is around $160.00.
Even separating some Raspberry with distinct functions for user requests, system, database, cache, etc, the cost tends to be much lower.
For example: A single diskless server costs more than 20 Raspberry pi.

Thus, the intention is both in the research aspect and in the objective of trying to obtain an LMS platform with a reasonably low cost and that, even with the failure of some node, it still works.

I know there are complexities involved in this setup and that's why I'm doing this initial research to verify initial feasibility.

The links you provide will be helpful for my research and any additional information will be of great help.

Eduardo
In reply to Eduardo Alexandre Gula

Re: Moodle cluster (high availability and load balance) with Raspberry pi 4

by Visvanath Ratnaweera -
Picture of Particularly helpful Moodlers Picture of Translators
Hello Eduardo

Yes, if (academic) curiosity and fun play a major role, every journey is worthwhile - within bounds of course. For example, to prove that there is an yet smaller particle (energy? wave? hole?) scientists burn zillions of energy and then warn us that the ice cap is melting!

 On dedicated servers there is something similar. The purchasing price is one thing the (environmental) price of burning energy 7x24 is often conveniently overseen. In that sense the R Pi has an edge.

If you want get to know on the capacity of R Pi as a Moodle server, you could just take two, one as the web server / cache server and the other the database server. Generally the web server is CPU heavy, cache server and the database server are heavy on RAM. The database server also sensitive to disk I/O. So a R Pi 4 B 8 GB model is the best R Pi out of the current models. Using an SSD drive in place of the SD card should give a boost in I/O.

As already mentioned, study how MoodleBox is tuned. Don't depend on Moodle Bench https://moodle.org/mod/forum/discuss.php?d=335357 as a performance indicator https://moodle.org/mod/forum/discuss.php?d=393752. Only a true load test, like JMeter https://docs.moodle.org/dev/Load_testing_Moodle_with_JMeter, will measure the performance under load.

This forum is a knowledge base on everything Moodle and performance. Pl. make use of the excellent advance search https://moodle.org/mod/forum/search.php?id=5.

Finally please do post your findings here in the forum. There are always others looking for the same.