Note: You are currently viewing documentation for Moodle 2.1. Up-to-date documentation for the latest stable version is available here: Performance FAQ.

Performance FAQ: Difference between revisions

From MoodleDocs
Line 4: Line 4:


==What hardware should I buy for 'n' concurrent users?==
==What hardware should I buy for 'n' concurrent users?==
Firstly see above to make sure you express 'n' somewhere near correctly. Unfortunately, the answer is "it depends". It will depend primarily on your chosen operating system, your software configuration and what the users will be doing. The worst possible scenario is a large class all starting a timed quiz at exactly the same time. Very roughly, worst case, your Moodle site may only handle as few as 10-20 concurrent users per GB of memory. Moodle is a large application and can easily use more that 50MB (sometimes a lot more) of RAM per process. If you are planning a very large site, you are strongly encouraged to run a pilot first and take some measurements or resources used.
Firstly see above to make sure you express 'n' somewhere near correctly. Unfortunately, the answer is "it depends". It will depend primarily on your chosen operating system, your software configuration and what the users will be doing. The worst possible scenario is a large class all starting a timed quiz at exactly the same time. Luckily, users sat reading stuff are not generating any server load at all (until they click for the next activity/page). Very roughly, worst case, your Moodle site may only handle as few as 10-20 concurrent users per GB of memory. Moodle is a large application and can easily use more that 50MB (sometimes a lot more) of RAM per process. If you are planning a very large site, you are strongly encouraged to run a pilot first and take some measurements or resources used.


Prospective Moodle users tend to vastly over-estimate the required concurrency. It's potentially a very expensive mistake if you get this wrong.
Prospective Moodle users tend to vastly over-estimate the required concurrency. It's potentially a very expensive mistake if you get this wrong.

Revision as of 17:50, 4 December 2011

How do you define "concurrent users"?

As has been repeatedly stressed in the Hardware and performance forum, the load on the server at a particular time depends on the number of concurrent users. Not on the total number of user accounts and not on the number of users logged-in. The term "concurrent users" is used to mean those users for whom the server is actively doing something . It may by processing a webpage written in PHP, querying the database or simply transferring a file. (see also Wikipedia Concurrency). Strictly speaking we mean the number of active web server processes (each of which consume memory) and also the number of database connections.

What hardware should I buy for 'n' concurrent users?

Firstly see above to make sure you express 'n' somewhere near correctly. Unfortunately, the answer is "it depends". It will depend primarily on your chosen operating system, your software configuration and what the users will be doing. The worst possible scenario is a large class all starting a timed quiz at exactly the same time. Luckily, users sat reading stuff are not generating any server load at all (until they click for the next activity/page). Very roughly, worst case, your Moodle site may only handle as few as 10-20 concurrent users per GB of memory. Moodle is a large application and can easily use more that 50MB (sometimes a lot more) of RAM per process. If you are planning a very large site, you are strongly encouraged to run a pilot first and take some measurements or resources used.

Prospective Moodle users tend to vastly over-estimate the required concurrency. It's potentially a very expensive mistake if you get this wrong.

How do I benchmark a Moodle-site?

You can of course benchmark parts of the system separately: the hardware as seen by the operating system (eg. CPU, disk access), web server performance, database server performance, execution on PHP operations, etc. For further details see Performance#Obtain_a_baseline_benchmark.


But there is no easy formula to deduce the maximum number of concurrent users from those results. There is a PHP-script, the Performance perspectives - a little script, circulating amoung the Moodle-community which calculates a ballpark figure. The current version is attached to posting on 25. March 2011.

Warning: Note that running this script on a production server may have unwanted side-effects. You are strongly adviced to run it on a test-site.

What are PHP-accelerators?

See Wikipedia PHP accelerator.

Available software are documented under Performance#PHP_performance.

You find some user suggestions here Update on PHP-accelerators.

How do I cluster Moodle?

See Performance#Scalability

How do I replicate Moodle?

Mirroring_Moodle

How to Replicate MOODLE ??!!

My site is very slow, what should I do?

First find out "how slow". (The theme-trick here).

The next question is, whether the performance is normal or something malfunctions. There are many things which can malfunction:

  • hardware
  • crashed filesystems, specially network filesystems
  • memory leaks or other crashes in the system
  • bug in Moodle
  • corrupted database
  • networking issues (DNS, firewalls, ...)

Or your performance could be "normal" under the given circumstances:

  • Are you on a dedicated server or a shared (virtual) server?
  • How much RAM, processing power do you have?
  • What is the software stack you use? (Unix or Windows, Apache or IIS, MySQL, PostgreSQL or SQL-Server, ...?)
  • how many concurrent users can you support
  • what modules/activities you use? Check Performance#Performance of different Moodle modules

Performance#Obtain a baseline benchmark and compare it with the published figures.

What are the requirements for N users?

A moodle setup for 10K simultaneous users

How many users will my installation support?

This is another way of asking the same question as above. Please move up.

What is the best webserver?

It depends who you ask. Apache is almost universal on Unix and Linux. IIS is native to Windows Server but Apache can be used as well. As always, the latest version available is likely to provide the best performance. There are other "niche" web servers. If you are interested in one of those you are likely to know about it already.

Should I go for 64 bit or is 32 bit OK?

Most servers these days will be 64 bit anyway. On desktops - if you have a choice - 32 bit is probably better supported.

What hosting provider do you recommend?

Moodle Partners are approved by Moodle HQ, have extensive Moodle expertise and can provide comprehensive support. However, they are unlikely to be the cheapest solution (although it's worth asking) if your budget is tight. Cheap 'shared hosting' may not provide sufficient resources to run Moodle properly. There are many other options and it really depends on your needs. For one discussion see http://moodle.org/mod/forum/discuss.php?d=99405

See also

Using Moodle forum discussions