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
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.