Advice installing Moodle on a VM

Advice installing Moodle on a VM

by Jamie Sawyer -
Number of replies: 11
Hey all,

My company is planning on implementing a Moodle rollout over the next couple of months, building training courses for accreditation etcetera, and replacing our old training system.

We're looking at installing Moodle to a virtual server, and I was wondering if anyone here has had any experience with this situation to help us spec our VM(s).

We are looking at getting a system initially capable of running 200 concurrent users, although it would be nice to build a system which is easily expandable (out rather than up, given they're VMs). I guess the questions I have:

1) Are we going to need to separate WS and DBS in order to make it easy to expand in the future?

2) Given we have experience of running 10-15 servers with Windows Server, IIS + Microsoft SQL Server, are we still OK to use these as opposed to Linux, Apache + MySQL? (Ignoring the PHP side for now)

3) Based on the vague guidelines, 4Gb of RAM is enough for an all-in-one system, but if we do split WS and DBS activities, how much Memory load is on the WS - little enough that it can be run with, say, 2Gb RAM?

4) Given these are VMs, it's better to have more VMs with less cores than fewer VMs with more cores (crazy threading issues I'd never even thought about until getting thrown in the deep end with VMs!), so how will we need to set up our environment - is WS-DBS going to be enough with only a core or 2 on each, or are we going to need a WS-farm of some description? How does Moodle cope in these conditions?

5) Am I just asking far too many questions at this point for something which will probably just be answered with a "one fat VM should cope with the lot, you're over-thinking this!"? ;)

Thanks in advance,

Jamie Sawyer
IT Support Analyst, AOMi

edit: I may have put this in the wrong forum - didn't see the hardware forum - if necessary, if a mod is able to move this to the appropriate place, that'd be lovely.
Average of ratings: -
In reply to Jamie Sawyer

Re: Advice installing Moodle on a VM

by Colin Fraser -
Picture of Documentation writers Picture of Testers
This is an interesting question and fits here, it is, after all, an installation question. Try to throw some light on it, although my experience is limited here. Tried it once, and did not get it to work properly, and have just not had the chance to come back to it, but may in the near future if the idea of a Cloud is feasible - at work. So if you want to take a fool's advice here:

1) You do not need to separate the WS and the DBS, but for the purposes for security and data safety it is probably not a bad idea, if you are mirroring the DBS. How likely is future expansion? If you envisage a situation whereby your user base is going to expand exponentially, this is will ease any scalability issues.

2) If you already have all that experience, install PHP and configure it for MSSQL then why bother with Apache and MySQL? Use what you have, expand your knowledge base, why re-invent the wheel? What you can do is scour the Moodle Docs on the topics of IIS and MSSQL which should give you a basic understanding of how you can proceed. What you may end up with is a completely different understanding - which you can then share with the rest of the Windows community - without compromising your own security.

3) Memory is always going to be an issue. Moodle in the Windows environment is a bit of a hog, so I seriously suggest that you just apply as much RAM as you can in the WS and the DBS.

4) Moodle copes well in a web farm, on a stand alone, and in any environment. It is a connectionless web app. As long as the server and database work it will do just about everything asked of it. I am encouraging people to look at the Moodle Docs, Moodle Clusters and Mirroring Moodle, and perhaps update and expand them, but no luck so far. Anything you want to add there, please feel free to do so.

5) "Over thinking" usually implies that retentive nit-picking usually reserved for database designers. Techies do something different, they consider possibilities and plow on anyway. You could use "one fat VM" but that is not always the best solution. The only answer to that is "what works for you and your situation." Who cares what the people next door do? Can you get this working and keep it working? A patchwork of ideas will fall over regularly, we all know that, so what planned approach is going to cause the least distress? What consistent concepts will allow you to get up and running again in as short a time as possible if your absolute worst nightmare happens? That is all that matters.

Good luck..
In reply to Jamie Sawyer

Re: Advice installing Moodle on a VM

by Howard Miller -
Picture of Core developers Picture of Documentation writers Picture of Particularly helpful Moodlers Picture of Peer reviewers Picture of Plugin developers
This is better in Hardware and Performance... perhaps Helen will move it smile

I'm very cynical about running Moodle in a VM unless it's (basically) an evaluation. The reason for using a VM is so you don't have to spend money on a new dedicated machine, yeh wink

Moodle is a big, big application and 200 concurrent users is actually quite a lot - although it depends completely on what they are doing (just browsing vs. all running quizzes for example).

On top of this you seem to be proposing using Microsoft software. This is, IMO, a bad plan if you have a choice. MS web software isn't really up to the job of running large PHP applications unless you throw vast amounts of memory at it and tune it carefully. It would be a lot less bother just to run with Linux.

Without getting deeply into this, my starting point would probably be two (Linux) servers - both reasonably specified - one for the web server and one for the db. Real boxes, not VMs.

Sorry, if this is not what you wanted to hear.
In reply to Howard Miller

Svar: Re: Advice installing Moodle on a VM

by Calle S -
I beg to differ from that opinion, as there is no difference in runnig on a VW from a dedicated server. For all practical purpose its the same thing. And stating that M$ webservers aren't up to running a big PHP service is as you state just up to the RAM and CPU you dedicate to the VM instance. If you are used to MS software and/or your organization is MS heavy just go with that.

Running a VM is always cheaper that having dedicated hardware, both in initial cost and in the running cost.

Just go with the VM solution and keep to low cost, if the app is running slow just dedicate more RAM and CPU to the instance.


In reply to Calle S

Re: Svar: Re: Advice installing Moodle on a VM

by Howard Miller -
Picture of Core developers Picture of Documentation writers Picture of Particularly helpful Moodlers Picture of Peer reviewers Picture of Plugin developers
Of course, it's down to the resources you dedicate to the VM, but most VM installations I have seen do not have the capabilities to run a Moodle site that would cater for 200 concurrent users (with the caveat that 'concurrent users' is a poor measure to estimate load). Running on M$ *does* make that worse. Again, if you have the resources and the know-how it can certainly be done, I agree.

I may be a little reactionary about VM solutions. A lot of people seem to think they are the answer to almost everything but not always. I would caution that a large-scale Moodle installation is one of those cases were VM just might not be the solution.
In reply to Howard Miller

Re: Svar: Re: Advice installing Moodle on a VM

by Jamie Sawyer -
Hmm, interesting discussion here. Having just spoken to a few people (note: the same people that told me we would have 200 concurrent users), I think that the actual concurrent user load will be **significantly** lower (I had these same problems explaining concurrency while doing some stress testing!). I think the current plan would be as follows:

1) Set ourselves up with 2 VMs - a WS and a DBS, each of which dual core and relatively high speed (2.8GHz+, preferably higher still, need to look at costing), with 4Gb RAM attached. Hard disks would be virtualised from a big ol' SAN, so access speeds shouldn't be an issue.

2) If we're starting to max out the WS, we can add more WSs in a farm, as per Colin's original post, or if it's just RAM issues, plug some more on (8/16Gb or something).

3) If the DBS is starting to feel the strain, I suspect the best idea there would be to move to a big, local, physical server - fingers crossed that wouldn't be necessary though.

I understand there's a (large) performance hit by using MS Server/SQL, however you've got to understand we're coming from a massively MS-centric set-up at the moment, and moving away from that would involve me getting stuck administrating the Linux servers on my own (being the only member of the team with Linux experience) - not really something I want to do!

Assuming that we move our estimate down to 200 people "doing courses" simultaneously - but not necessarily online together, making this a *much* smaller implementation than even I knew - does the spec above look reasonable? To be honest with the changes in load, this is a much less interesting question now sad

Jamie Sawyer
In reply to Jamie Sawyer

Re: Svar: Re: Advice installing Moodle on a VM

by Howard Miller -
Picture of Core developers Picture of Documentation writers Picture of Particularly helpful Moodlers Picture of Peer reviewers Picture of Plugin developers
Honestly, if you don't think the load is going to be a big deal run it up on your VMs (one or two, more about your convenience probably) and then monitor the usage. If it does take off in the future you'll have some solid information.
In reply to Jamie Sawyer

Re: Svar: Re: Advice installing Moodle on a VM

by Tim Hunt -
Picture of Core developers Picture of Documentation writers Picture of Particularly helpful Moodlers Picture of Peer reviewers Picture of Plugin developers
Just a note that typically Moodle maxes out on the web servers, rather than the database - until you are at about half a dozen web servers. That makes scaling easy for quite a long way.

I am sure you are right that in your situation, your familiarity with the MS stack is more significant than the fact PHP apps typically run better on Linux, for the same hardware.

Also, you have a plan that get you started quickly with your existing hardware, and which has plenty of room to grow in the future. So you are in a pretty good place, and if/when your usage does grow, you will have a history of real load data to use when planning future upgrades.
In reply to Tim Hunt

Re: Svar: Re: Advice installing Moodle on a VM

by Jamie Sawyer -
Thanks for all the replies, I reckon we'll just stick with the basic plan outlined above and see it as a live POC (always a dangerous route to go, but we have some other physical servers around and about which we could potentially use). Good to know that expanding outwards is reasonable (WS farm), and that the DB side of things isn't too heavy - we'll see how it goes and pass the results back onto here to give some general anecdotal evidence for this sort of system.

Thanks a lot again everyone,

Jamie Sawyer
In reply to Jamie Sawyer

Re: Advice installing Moodle on a VM

by Helen Foster -
Picture of Core developers Picture of Documentation writers Picture of Moodle HQ Picture of Particularly helpful Moodlers Picture of Plugin developers Picture of Testers Picture of Translators
Thanks everyone for the interesting discussion. Just moving it to the Hardware and Performance forum as suggested...
In reply to Jamie Sawyer

Re: Advice installing Moodle on a VM

by Ebenezer Le Page -
Jamie - contact me directly.  Very similar to what we have done in scale and platform.