I am keen on hearing feedback on this draft plan. It has the following stages to address increasing server load, and a couple of lingering questions:
- Start with a single server -- tune apache, mysql and persistent db connections.
- Add PHP accelerator software. MMCache seems to have problems, PHP accelerator doesn't (see: http://moodle.org/mod/forum/discuss.php?d=4076 ) Question: is MMCache still problematic? Anyone using it successfully?
- Add reverse proxy -- configure aggresively. Question: does Moodle use cache control directives to benefit from proxies and browser caches?
- Segregate mysql to a dedicated DB server. Tune.
- Add additional webservers to offset the PHP processing load. Question: what data does Moodle store in its data directory? Should I share the data directory via NFS? Would it be possible to store this data in MySQL, potentially caching it on each webserver's filesystem?
- Add additional mysql servers in a master/slave setup. This only benefits performance if Moodle opens dbhandles in RO mode in a way that can be directed to the RO slaves. Question: does Moodle use db handles for RW and RO connections separately?
- Once the master mysql server is the bottleneck, is there any alternative?
- What is the impact of running postgresql instead of MySQL? Other RDBMSs?
I am not an expert in this but have an interest in the answers because it will be relevant to the question of whether the University of York should introduce Moodle university wide. So I will attempt answers to some of your questions:
Question: does Moodle use cache control directives to benefit from proxies and browser caches?
Yes it does, see for example the lines in cvs:/moodle/file.phpheader("Last-Modified: " . gmdate("D, d M Y H:i:s", $lastmodified) . " GMT");
header("Expires: " . gmdate("D, d M Y H:i:s", time() + $lifetime) . " GMT");
header("Cache-control: max_age = $lifetime"); // a day
Question: what data does Moodle store in its data directory?
All uploaded resources, forum attachments, participant photos, backup files ...
Question: Would it be possible to store this data in MySQL
Yes, this is work in progress, see the forum on Moodle's Document Management Ssytem at http://moodle.org/mod/forum/view.php?id=1807.
Question: does Moodle use db handles for RW and RO connections separately?
Moodle is doing all its database calls through the AdoDB library. I don't know the details but if the possibility of doing the read requests from a less loaded slave database is not already implemented in that library then it would certainly be easy to do it.
It is planned to allow the Document Management System to run on a separate MySQL server from the rest of Moodle. The rest of Moodle does not write to the database very often, so I think it is quite inconceivable that the master server will ever be the bottleneck. But if the inconceivable happens it would be easy to put some tables onto a different server. The log table would be a good candidate.
You may also be interested in the post at http://moodle.org/mod/forum/discuss.php?d=5859#30212