Can Moodle handle > 100,000 hits/day?

Can Moodle handle > 100,000 hits/day?

by Lawrence Khoo -
Number of replies: 8
I'm tech person for an organization that will launch an English language reading site in August. Our current Chinese language site gets about 1 million hits per day, spread across 5 servers. We expect our English language site to receive at least 1/2 that number. Fortunately, we should be able to split the traffic across multiple servers. And we're willing to pay for the fastest PC servers money can buy.

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?








Average of ratings: -
In reply to Lawrence Khoo

Re: Can Moodle handle > 100,000 hits/day?

by Marcus Green -
Picture of Core developers Picture of Particularly helpful Moodlers Picture of Plugin developers Picture of Testers

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

In reply to Marcus Green

Re: Can Moodle handle > 100,000 hits/day?

by David Delgado -
The biggest reported active site has 1,400 courses and about 17,000 students.

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

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. smile
Average of ratings: Useful (1)
In reply to David Delgado

Re: Can Moodle handle > 100,000 hits/day?

by Bernard Boucher -

Hi David,

I am interested by your point #3 ( cluster of Moodle ):
Martin has a Moodle installation running this way.

At sourceforge we see Moodle operating on a cluster but technicals details are hidden behind Martin's sun glasseswink

I don't want to disturb Martin at this time, but do you know if there are documents about the GPL clustering software(s) ( openMosix, Oscar, ??? ) used there or elsewhere, and the modifications done on Moodle to achieve this. ( I found only information about using a common session directory in the forums )

Thanks,

Bernard
In reply to Bernard Boucher

Re: Can Moodle handle > 100,000 hits/day?

by Martin Dougiamas -
Picture of Core developers Picture of Documentation writers Picture of Moodle HQ Picture of Particularly helpful Moodlers Picture of Plugin developers Picture of Testers
I'm not sure what they are using at Sourceforge, but the only thing needed to make Moodle work there was to override the session path to a local stable directory (ie not /tmp).
In reply to David Delgado

Re: Can Moodle handle > 100,000 hits/day?

by Lawrence Khoo -
Thanks for your reply. Its been very helpful.

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?

In reply to Lawrence Khoo

Re: Can Moodle handle > 100,000 hits/day?

by Charles Libby -
I am trying to come up with a procedure for clustering.  The question will come up about clusters on different OSes.  I am still researching that whole train of thought, and I am trying to do it on old machines since I have a Zero Budget.
In reply to Lawrence Khoo

Re: Can Moodle handle > 100,000 hits/day?

by Lawrence Khoo -
I've done some research into Linux clustering and the most commonly used technique (sourceforge.org uses it) is LVS - Linux Virtual Server.  Essentially, all outside traffic flows through a director machine to a bunch of identical webservers on an internal network.  The director (which is the only machine that needs special software), does NAT (network address translation) for the rest of the machines, so to the outside world, it looks just like one big server.
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.