Several confusing parts of clustering

Several confusing parts of clustering

by 丞浩 吳 -
Number of replies: 2

Hi

I am planning for clustering our current moodle platform currently.

The targeted performance is for around 3000 concurrent users.

Our current moodle version is 3.5.8.

Here are the SW/HW specs of our current moodle.

1. Main moodle server with:

- CentOS 7

- Apache server 2.4.6

- Memcached server 1.4.15


2. Database server with:

- MySQL Ver 14.14 Distrib 5.6.44 (using default engine InnoDB)


3. Storage server on NAS with:

- $CFG->dataroot mounted on this NAS


Both application server (1.) and database server (2.) are on VM hosted on the workstation inside our school computing center.

Storage server (3.) is a pure NAS machine, like Synology product. It simply offers only a storage function.


My plan is to add another application server with the snapshot of the current one (1.), this will give us two application servers for redundancy. Also, put a load balance before these two application servers. I would like to keep the database server and the storage server the same as the structure we have right now.


Here is my plan for the new structure.


1. Setup a redis server for application cache and session cache in MUC setting. (moodle dashboard -> Plugins -> caching -> Configuration )

2. mount dataroot/temp directory ($CFG -> tempdir) on a ramdisk to improve the r/w speed. (Base on the moodle benchmark plugin result and advise)

3. set $CFG-> wwwroot to the load balance server, instead of the main moodle apache server now.


I have been figuring out these stuff for a couple of weeks on my own, and I think I got ~90% of all I need to bring our moodle to clustering structure. But I still have several questions.

1. Is there any security or performance risk to put $CFG -> tempdir on a ramdisk? And what is the exact purpose of this temp directory? I have googled with some answers like, backup processes of moodle itself, restoring course data (I have no idea what this means), etc. If this temp directory will not impact the user performance, then I will consider staying with the setting now.


2. Do I need to prepare a new VM instance for the cache server (redis) only, like what I did for the database server? If yes, then what is the recommended memory size of that cache server VM?


3. What is the exact usage of $CFG -> dirroot? I have checked the GitHub page for the definition of those $CFG, but the comments of $CFG -> dirroot and $CFG -> libroot are the same. This is the GitHub page I mentioned (https://github.com/moodle/moodle/blob/v3.5.8/lib/setup.php).


4. Besides $CFG -> cachedir, $CFG -> tempdir, is there any directory that should be shared in the clustering structure? I have read some performance tuning advice said that I should put the $CFG -> dirroot on the local storage of each application server.


5. The document says do not put session and MUC on the same memcached server, but it didn't mention about redis server. I am wondering is it proper to put session and MUC on the same redis server? Or if I handle session with memcached server and MUC with redis server, is it okay to run the memcached server and redis server on the same host?


Many many thanks to you for reading my questions. Hope I have stated my situation and problem clear enough. If there is any further information I can provide, please kindly let me know.


Thanks in advance.


Average of ratings: -
In reply to 丞浩 吳

Re: Several confusing parts of clustering

by Howard Miller -
Picture of Core developers Picture of Documentation writers Picture of Particularly helpful Moodlers Picture of Peer reviewers Picture of Plugin developers
Ok...

1. I wouldn't bother. I doubt you'll see much, if any improvement. You're right... it's used for intermediate files for certain processes. It's not a huge factor in performance.

2. You can just switch to Redis for everything. I have had good experiences with Redis. You can put it on its own VM if you want or run it on an existing machine - you don't need a huge instance. Obviously, you need a good network connection.

3. You don't need to set or worry about that - it's calculated automatically. It's actually the location of the *root* of your Moodle code.

4. You're overthinking this. Point $CFG->dataroot the the shared directory. You could try setting $CFG->localcachedir to a local directory on each machine.  Forget about the others - you'll be fine.

5. The advantage of Redis is that you can do this. Give them different prefixes. It works fine.
Average of ratings: Useful (2)
In reply to Howard Miller

Re: Several confusing parts of clustering

by 丞浩 吳 -
Thank you, Howard.

I will take your advice and step further for the next step to try the new clustering structure on my debugging environment.
If I get any results of this setup, I will come here again and share what I get to the forum.

Good luck to me.
Average of ratings: Useful (1)