We are using moodle 2.0.1 to cater to 150 students. By next year we plan to reach out to 400-500 students.Our hardware specifications are:
Architecture: X86_64 (64 bit)
RAM : 4 GB
HARD DISK : 320 GB
OS installed: CentOS 5.7
Two very common problems that we are facing are:
-> moodle goes down very often though very few students have logged into the system
-> During the assignment submission deadline time, it is required that close to 100 students access the system and upload their assignments , but everytime during the time frame before and after the deadline time the system gets stuck/page doesn't get loaded and session times out.
The reason for this absurdness is very vague - has this got anything to do with the hardware or moodle itself is not clear.
Please find attached the CPU specifications of the remote server that we are using now.
I request you to suggest me as to how to proceed with the setup keeping in mind our plans in the long run.
If any upgrade is required, please let me know.
The first thing you need to determine is where your current bottleneck is, and whether you've already done any tuning of your server.
I assume you have shell access to your server - if so, take a look at your various resources and try to determine where your bottleneck is:
- take a look at the output of
free -mand take a look at the free columns, specifically whehter you're using your memory (e.g. you have memory left on the 'Mem:' line), and whether you're just using it for cache (buffers/cache line). Also take a look at whether you're swapping much. If you've got no free memory, and it's not being used for cache, then this could suggest that you're trying to over-resource your server (e.g. db config giving too much memory, no php accelerator, other software running gobbling up memory). You may also be swapping (swap is very slow compared to memory).
- use the 'top' command to see what's happening when you've got lots of users. You might find it helpful to display mutliple CPUs (hit 1), turn on colour (z), and to not show idle tasks (i). When you're experiencing a slow-down, what are you seeing in that list, and which column are your CPUs mainly in (ignore the 'id' column). I'd imagine that you're either in user (us), or wait (wa). If you're got a high wait, then you might have a disk issue (degraded RAID perhaps), or you might not have tuned your db config adequately so it's having to go to disk lots rather than use memory caches. If you're high in 'user', then you might find that you've not got your web server tuned adequately and it's killing the rest of the server.
- Try using
vmstat 1(ignore the first row of data). Where abouts is your CPU mostly sat at slow points, same with memory.
Some more questions for you to answer:
- Are you currently using a PHP Accelerator (e.g. APC)? ** which? ** have you tuned it - if so how?
- what database server are you using? ** have you tuned it - if so, how?
- what is your disk configuration (RAID 10, RAID 5, etc)?
- what web server are you using (e..g Apache, nginx, etc)? ** have you tuned your web server - if so, how? ** anything suspicious in your web server's logs?
For information, with one of the projects I'm currently working on we're running a Moodle with approximately 6-800 daily unique users on a Virtual machine with 8Gb RAM, and two cores, plus a database server with 2Gb RAM and two cores.
Take a look at some of the other posts in this forum:
And the wiki:
> We are using moodle 2.0.1 to cater to 150 students. By next year we plan to reach out to 400-500 students
In terms of the number of users yours is a small installation. See http://docs.moodle.org/22/en/Large_installations.
> Our hardware specifications are:
> Architecture: X86_64 (64 bit)
From the attachment: It is a Xeon, Quad core "Intel(R) Xeon(R) CPU E5506 @ 2.13GHz".
BTW, that attachment was unnecessary. One could paste the content into the post iteself.
> RAM : 4 GB
Keep an eye on the RAM usage. Since you already have a 64 bit system, you can easily add more RAM.
> HARD DISK : 320 GB
> OS installed: CentOS 5.7
Linux is a good choice!
> - moodle goes down very often though very few students have logged into the system
How many? What are they doing exactly?
> - During the assignment submission deadline time, it is required that close to 100 students access the system and upload their assignments,
100 students (try to) submit their work at the same time? That is surprisingly high for a 150 user site!
> but everytime during the time frame before and after the deadline time the system gets stuck/page doesn't get loaded and session times out.
You are talking of users uploading files in an activity of type "assignment" http://docs.moodle.org/en/Assignment_module and not about a quiz http://docs.moodle.org/20/en/Quiz ?
> The reason for this absurdness is very vague - has this got anything to do with the hardware or moodle itself is not clear.
You have to monitor the load in your sever during such a rush hour. See http://docs.moodle.org/en/Performance_recommendations#Obtain_a_baseline_benchmark. In fact I invited the visitors here in a seperate thread http://moodle.org/mod/forum/discuss.php?d=192162 to discuss their methods .
> I request you to suggest me as to how to proceed with the setup keeping in mind our plans in the long run.
Find out first if something malfunctions (corrupt database, wrong webserver config, network setup from bad drivers to poor or wrongly configured hardware, ...). Once all that is OK find out which component hits the limit (RAM, CPU, network, ...) by monitoring as mentioned above. Then "repair" those places either by tuning or by adding/improving the hardware.
There have been many informative discussions in this forum. Try the "Advanced search" facility mentioned in the introduciton.
When you say "100 students (try to) submit their work at the same time? That is surprisingly high for a 150 user site!" ; how many users can I expect the site to handle without any problem?
We had the same problem fixed by increasing the RAM to 8GB even our CPU is 1.8GHz. Try this if you are running it in Virtual environment.
No, what I meant was, the proportion (100 out of 150) of the users submitting an assignment exactly at the same time, is high.
And questions like "How many users can this site handle?" simply have no answers. (What is a user? What do they exactly do at the same time? What is 'same time', same second, same minute, same hour?) For details check the Performance documentation and Performance_FAQ given in the introduction to this forum.