My question is, can Moodle handle that kind of traffic? Moodle seems to have everything we need for the site, but if the traffic will cause significant slowdowns, we would have to look for custom solutions. Which frankly, we would rather not do, as it is much much more expensive (we've been quoted prices in 5 digits).
Has anyone out there ever used Moodle in a production environment that received over 10,000 hits per hour?
I used to work for an organisation that ran what was probably the second most visited website in the UK (after the BBC website). They were not particularly restricted by money but the technologies they chose were a combination of PHP, MySQL and Linux. They could have selected JSP, Perl, and for non web facing situations they did use ORACLE, but for facing the public it was Linux Apache MySQL and PHP (LAMP).
PHP was designed from the ground up for serving interactive web pages and MySQL was is very, very fast, particularly where the emphasis is on database reads rather than updates.
One of the differences between the solution they chose and moodle is that they used native PHP mysql calls rather than the adoDB layer that moodle uses, which does incur some performance penalty but fairly slight.
Marcus
Anyway, the more powerful your server is, the more hits Moodle can handle well. In my opinion you have 3 options:
1) Clasic solution (simple)
- 1 Very powerful server just for Moodle (several fast Xeon CPU's, for example, 4GB of RAM and a big SCSI RAID 5). Bottleneck: CPU
- 1 Very powerful server just for MySQL (similar one). Bottleneck: CPU
2) Several Moodle servers (nearly as simple as the former one)
Just if you have many courses. Group them by Categories and use several moodle servers (one for each Category) to spread the load.
3) Elegant solution (a bit complicated, but VERY effective)
Just make a cluster. Use several servers as if they were a single one, conected by a fast network (Gigabit Ethernet, for example). This is how Google works (20,000 Linux servers working as if they were a single computer). This could be a bit hard to configure, but this way you will have no limits to scale. Martin has a Moodle installation running this way at Sourceforge, so, it is proven to work.
Just choose your solution. But...
- Do not forget to use MySQL 4.0 (forget about default 3.23). It has a very good cache system (improvement: about 600%).
- Use a PHP Cache system such as PHP Accelerator or Zend Perfomance Suite (improvement: about 500%)
- Make sure to set dbpersist = false at config.php -> much better performance
- Take a look at the "Servers and performance" forum and, specially the discussions about "Moodle optimization" and "PHP optimization HOWTO".
Hope all this helps. Just read, thing and make lots of testing before being in production.
Bernard
1) Clasic solution (simple), 1 Very powerful server just for Moodle, 1 Very powerful server just for MySQL
I did some checking and it seems that a multi processor system would be useful for Moodle & Apache, but not for MySQL. Apparently, Moodle will appear as only one MySQL user, and MySQL can't take davantage of multiple CPUs if there is only one user. (ie. its spreads multiple users over the multiple CPUs.)
So I've decided to recommend a dual processor AMD Opteron 64 server for Moodle and a single processor Opteron 64 server for MySQL (both loaded up with max RAM and CPU speed). And another single processor system as backup server (to backup onto and to take over in case either server goes down). All connected togther with gigabit ethernet.
2) Several Moodle servers (nearly as simple as the former one)
We will definitely go to this architecture if neccesary. Probably with a server serving a static front page pointing users at different moodle servers, according to what course they're in.
3) Elegant solution (a bit complicated, but VERY effective) Just make a cluster.
I'm not sure if I want to go that way. I have zero experience with this. Anything you can point me to to help me get started on clustering?
For more info on LVS check out:
http://www.linux-mag.com/2003-11/clusters_01.html
http://www.ntua.gr/lvsp/Joseph.Mack/mini-HOWTO/LVS-mini-HOWTO.html
We've decided to go with a much simpler system to distribute our server load, Round-Robin DNS (look at http://hacks.oreilly.com/pub/h/79). We plan on getting about five dual Opteron Moodle servers, and one dual Opteron MySQL server. We expect about 50,000 registered users, and about a million page hits per day by the end of the year. Will report back about how things work out.