<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>https://docs.moodle.org/39/en/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=Emerrill</id>
	<title>MoodleDocs - User contributions [en]</title>
	<link rel="self" type="application/atom+xml" href="https://docs.moodle.org/39/en/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=Emerrill"/>
	<link rel="alternate" type="text/html" href="https://docs.moodle.org/39/en/Special:Contributions/Emerrill"/>
	<updated>2026-04-15T05:01:04Z</updated>
	<subtitle>User contributions</subtitle>
	<generator>MediaWiki 1.43.5</generator>
	<entry>
		<id>https://docs.moodle.org/39/en/index.php?title=Global_search&amp;diff=133167</id>
		<title>Global search</title>
		<link rel="alternate" type="text/html" href="https://docs.moodle.org/39/en/index.php?title=Global_search&amp;diff=133167"/>
		<updated>2019-02-25T16:13:25Z</updated>

		<summary type="html">&lt;p&gt;Emerrill: Solr 7 is now supported MDL-60759&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{More features}}&lt;br /&gt;
==What is Global search?==&lt;br /&gt;
*Global search lets you search everywhere on the Moodle site that you have access to. A student can search their courses for particular lecture notes, for example, or a teacher could search for subject-related activities.&lt;br /&gt;
*The feature needs to be enabled by the administrator in Advanced features and then, from the Manage Global search page, the search engine must be selected.&lt;br /&gt;
&lt;br /&gt;
When Global search is enabled,  search box is then available next to the user menu.&lt;br /&gt;
&lt;br /&gt;
[[File:NFGlobalsearchbox.png|thumb|center|480px|Searching the site (when global search is enabled)]]&lt;br /&gt;
&lt;br /&gt;
*A [[Global search block]] may also be added to course pages.&lt;br /&gt;
&lt;br /&gt;
==What can I search for?==&lt;br /&gt;
You can search for your courses, activities information and some activities contents like forum posts, book chapters, glossary entries or collaborative wikis pages. &lt;br /&gt;
&lt;br /&gt;
HTML block content may be searched and, if the administrator sets the setting &amp;quot;Searchable courses&amp;quot; to &#039;&#039;Search within all courses the user can access&#039;&#039; then courses which are visible to users but which they are not enrolled in may also be searched. (These courses are courses with guest access or if the user has the capability to view all courses.)&lt;br /&gt;
&lt;br /&gt;
==How does it work?==&lt;br /&gt;
*Click the search icon by the user menu and type a search term into the box that appears, or type into the box in the [[Global search block]] if enabled.&lt;br /&gt;
*On the next screen, you can simply click the search button to search everywhere, or expand the Filter to search in specific areas:&lt;br /&gt;
&lt;br /&gt;
[[File:NFFilteringGlobalSearch2.png|thumb|center|600px|Filtering the search]]&lt;br /&gt;
&lt;br /&gt;
*You will then see results displayed from all areas of Moodle you have access to:&lt;br /&gt;
&lt;br /&gt;
[[File:31GSResults2a.png|thumb|center|600px|Search results]]&lt;br /&gt;
&lt;br /&gt;
===Solr-specific features===&lt;br /&gt;
&#039;&#039;These features are only available if you use &#039;&#039;&#039;Solr&#039;&#039;&#039; as your search engine.&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
====Search query features====&lt;br /&gt;
You can improve your search using any of the following search query features:&lt;br /&gt;
&lt;br /&gt;
* Specifying the field to be searched by prefixing the search query with &#039;title:&#039;, &#039;content:&#039;, &#039;name:&#039;, or &#039;intro:&#039; e.g.&#039;title:news&#039; returns results with the word &#039;news&#039; in the title&lt;br /&gt;
* Boolean operators (&#039;AND&#039;, &#039;OR&#039;, &#039;NOT&#039;) to combine or exclude keywords&lt;br /&gt;
* Wildcard characters (&#039;*&#039; or &#039;?&#039; ) to represent characters in the search query&lt;br /&gt;
* Proximity searches (&#039;~&#039;) e.g. mood~2 returns &amp;quot;moodle&amp;quot; (2 letters away from &amp;quot;mood&amp;quot;), Moodle Australia~3 returns results containing &amp;quot;Moodle HQ in Perth, Australia&amp;quot; (the queried terms were within 3 words of each other)&lt;br /&gt;
* Boosting terms (&#039;^&#039;) to boost certain words or phrases e.g. &amp;quot;Perth Australia&amp;quot;^5 &amp;quot;Australia&amp;quot; will return results with the phrase &amp;quot;Perth Australia&amp;quot; as more relevant.&lt;br /&gt;
&lt;br /&gt;
====File contents indexing====&lt;br /&gt;
Solr has the ability to index the contents of files, such as File resources and attachments to Forum posts.&lt;br /&gt;
&lt;br /&gt;
====Extra filters====&lt;br /&gt;
&#039;&#039;&#039;New in 3.5&#039;&#039;&#039; : New fields now facilitate filtering by user ID and searching by group.&lt;br /&gt;
&lt;br /&gt;
==How is it set up?==&lt;br /&gt;
&lt;br /&gt;
Note: Global search needs a search engine. It&#039;s recommended you set everything up first, index the site contents &#039;&#039;and only then&#039;&#039; enable Global search.&lt;br /&gt;
&lt;br /&gt;
Moodle core includes two search engines: Simple Global search and Solr. See the [https://docs.moodle.org/dev/Search_engines Developer docs on Search engine plugins] if you wish to write your own.&lt;br /&gt;
&lt;br /&gt;
===Setting up Simple search===&lt;br /&gt;
&lt;br /&gt;
Simple Global search provides global search features without the need to install an external search engine.&lt;br /&gt;
&lt;br /&gt;
{{MediaPlayer | url = https://youtu.be/4JJhOd2XAiY | desc = Simple global search}}&lt;br /&gt;
&lt;br /&gt;
===Setting up Solr===&lt;br /&gt;
&lt;br /&gt;
* The latest Solr 5 available version is the recommended one.&lt;br /&gt;
* Moodle supports Solr server from 4.0 onwards, although you can only use the Solr schema setup script that we provide with Moodle from Solr 5. The latest Solr 5 available version is the recommended one; the same will apply to Solr 6 once it is released.&lt;br /&gt;
&lt;br /&gt;
====General Setup====&lt;br /&gt;
&lt;br /&gt;
# Set the feature up in &#039;&#039;Site administration &amp;gt; Plugins &amp;gt; Search &amp;gt; Manage global search&#039;&#039; by selecting Solr as the search engine and ticking search area checkboxes as required&lt;br /&gt;
# In &#039;&#039;Site administration &amp;gt; Plugins &amp;gt; Search &amp;gt; Solr&#039;&#039;, set &#039;&#039;&#039;Host name&#039;&#039;&#039; to localhost, &#039;&#039;&#039;Port&#039;&#039;&#039; to 8983 and &#039;&#039;&#039;Index name&#039;&#039;&#039; to &#039;moodle&#039; (the name of the index in Solr) &lt;br /&gt;
# If you are using Solr with SSL encryption and basic authentication (see below if you want to use client certificates instead), you will need to configure this.This is important if solr is not installed in the web server server.&lt;br /&gt;
## Go to &#039;&#039;Site administration &amp;gt; Plugins &amp;gt; Search &amp;gt; Solr&#039;&#039;&lt;br /&gt;
## Set &#039;&#039;&#039;Secure mode&#039;&#039;&#039; to Yes&lt;br /&gt;
## Set port number if required (sometimes SSL installations use port 443).&lt;br /&gt;
## Type in the username and password.&lt;br /&gt;
# If you are using Solr with SSL encryption via client certificates, you will need to configure Moodle as such. This is important if solr is not installed in the web server server.&lt;br /&gt;
## You will need a separate key file and cacert file, both in pem format, located on your server Moodle, and readable by the PHP process.&lt;br /&gt;
## Go to &#039;&#039;Site administration &amp;gt; Plugins &amp;gt; Search &amp;gt; Solr&#039;&#039;&lt;br /&gt;
## Set &#039;&#039;&#039;Secure mode&#039;&#039;&#039; to Yes&lt;br /&gt;
## &#039;&#039;&#039;SSL certificate&#039;&#039;&#039; to /path/to/certs/solr-ssl.cacert.pem&lt;br /&gt;
## &#039;&#039;&#039;SSL key&#039;&#039;&#039; to /path/to/certs/solr-ssl.key.pem&lt;br /&gt;
## &#039;&#039;&#039;SSL key Password&#039;&#039;&#039; to The password used to lock the SSL Key&lt;br /&gt;
## &#039;&#039;&#039;SSL CA certificates name&#039;&#039;&#039; to /path/to/certs/solr-ssl.cacert.pem&lt;br /&gt;
# You now need to populate the created Solr index with your site&#039;s data. You can do it via the web interface by going to &#039;&#039;Site administration &amp;gt; Reports &amp;gt; Global search info&#039;&#039; or from the CLI by running the &amp;lt;tt&amp;gt;search/cli/indexer.php&amp;lt;/tt&amp;gt; script. The CLI script is the recommended option for big sites.&amp;lt;br&amp;gt;&amp;lt;code&amp;gt;# sudo -u www-run php search/cli/indexer.php --force&amp;lt;/code&amp;gt;&lt;br /&gt;
# Enable Global search in &#039;&#039;Site administration &amp;gt; Advanced features&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
====File Indexing====&lt;br /&gt;
&lt;br /&gt;
Solr has the ability to index the contents of files, such as File resources and attachments to Forum posts. This uses the [https://tika.apache.org/ Tika] engine which comes bundled with Solr. To enable this feature:&lt;br /&gt;
# In &#039;&#039;Site administration &amp;gt; Plugins &amp;gt; Search &amp;gt; Solr&#039;&#039; enable the checkbox &#039;&#039;&#039;Enable file indexing&#039;&#039;&#039;&lt;br /&gt;
# Set &#039;&#039;&#039;Maximum file size to index (kB)&#039;&#039;&#039; to some value - the default is &#039;&#039;&#039;2097152&#039;&#039;&#039; (2GB)&lt;br /&gt;
#* Files larger than this limit will not be sent for Solr for indexing, but the file name will still be indexed.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;New in 34:&#039;&#039;&#039; File indexing now works retroactively -ie, if you set up Global search without file indexing enabled and a later date you enable file indexing, files associated with existing objects will be included.&lt;br /&gt;
&lt;br /&gt;
====How to install Solr====&lt;br /&gt;
&lt;br /&gt;
You need PHP Solr extension installed. You can download the official latest versions from [http://pecl.php.net/package/solr PECL: Package: solr]. The minimum required version is PECL Solr 2.1 for PHP 5 branch and PECL Solr 2.4 for PHP 7 branch.&lt;br /&gt;
&lt;br /&gt;
Basic installation steps (using apache web server):&lt;br /&gt;
&lt;br /&gt;
===== Linux (Debian/Ubuntu) =====&lt;br /&gt;
Using APT:&lt;br /&gt;
    sudo apt install php-solr&lt;br /&gt;
    sudo service apache2 restart&lt;br /&gt;
&lt;br /&gt;
If you can&#039;t install the SOLR PHP module via APT, try the following:&lt;br /&gt;
&lt;br /&gt;
With PHP5.x&lt;br /&gt;
    sudo apt-get install libpcre3-dev libxml2-dev libcurl4-openssl-dev&lt;br /&gt;
    sudo apt-get install php5-dev&lt;br /&gt;
    sudo apt-get install php-pear&lt;br /&gt;
    sudo pecl install solr&lt;br /&gt;
    sudo sh -c &amp;quot;echo &#039;extension=solr.so&#039; &amp;gt; /etc/php5/apache2/conf.d/solr.ini&amp;quot;&lt;br /&gt;
    sudo sh -c &amp;quot;echo &#039;extension=solr.so&#039; &amp;gt; /etc/php5/cli/conf.d/solr.ini&amp;quot;&lt;br /&gt;
    sudo service apache2 restart&lt;br /&gt;
&lt;br /&gt;
With PHP 7&lt;br /&gt;
    sudo apt-get install libpcre3-dev libxml2-dev libcurl4-openssl-dev&lt;br /&gt;
    sudo apt-get install php7.0-dev&lt;br /&gt;
    sudo apt-get install php-pear&lt;br /&gt;
    sudo pecl install solr&lt;br /&gt;
    sudo sh -c &amp;quot;echo &#039;extension=solr.so&#039; &amp;gt; /etc/php/7.0/apache2/conf.d/solr.ini&amp;quot;&lt;br /&gt;
    sudo sh -c &amp;quot;echo &#039;extension=solr.so&#039; &amp;gt; /etc/php/7.0/cli/conf.d/solr.ini&amp;quot;&lt;br /&gt;
    sudo service apache2 restart&lt;br /&gt;
&lt;br /&gt;
===== Linux (Redhat/Centos 6 &amp;amp; 7) =====&lt;br /&gt;
&lt;br /&gt;
====== Using built in php5 packages ======&lt;br /&gt;
  yum install php-pecl-solr2&lt;br /&gt;
  service httpd restart&lt;br /&gt;
&lt;br /&gt;
====== Using 3rd party php7 packages (webtactic) ======&lt;br /&gt;
  yum install libxml2-devel pcre-devel libcurl-devel php70w-devel php70w-pear&lt;br /&gt;
  pecl install solr&lt;br /&gt;
  echo &amp;quot;extension=solr.so&amp;quot; &amp;gt; /etc/php.d/solr.ini&lt;br /&gt;
  service httpd restart&lt;br /&gt;
&lt;br /&gt;
===== OSX using macports =====&lt;br /&gt;
&lt;br /&gt;
    sudo port install apache-solr4&lt;br /&gt;
    sudo port install php54-solr&lt;br /&gt;
&lt;br /&gt;
===== OSX using homebrew =====&lt;br /&gt;
&lt;br /&gt;
    brew install homebrew/php/php56-solr&lt;br /&gt;
&lt;br /&gt;
===== Windows =====&lt;br /&gt;
&lt;br /&gt;
Install the pecl package as usual. (This has not yet been tested.)&lt;br /&gt;
&lt;br /&gt;
===== The Solr server =====&lt;br /&gt;
&lt;br /&gt;
Note that for medium/large sites you may need to increase maxBooleanClauses setting. In [https://tracker.moodle.org/browse/MDL-54992 MDL-54992] we are working on an alternative way to query the server. &lt;br /&gt;
&lt;br /&gt;
Please note that there is a security issue that affects some Solr versions. The patched versions are 5.5.5, 6.6.2, 7.1, 7.2 and all new versions are patched. If your Solr server version is lower but you can&#039;t upgrade to one of the patched versions it is recommended to disable the XML Query Parser.&lt;br /&gt;
 &lt;br /&gt;
The following example snippet (feel free to copy &amp;amp; paste into a .sh script with execution permissions) will download Solr 5.5.5 (replace it with latest 5.x) in the current directory, start the solr server and create an index in it named &#039;&#039;&#039;moodle&#039;&#039;&#039; to add moodle data to it. If wget gives an error, check  http://www-us.apache.org/dist/lucene/solr and update SOLRVERSION&lt;br /&gt;
&lt;br /&gt;
    #!/bin/bash&lt;br /&gt;
    set -e&lt;br /&gt;
    SOLRVERSION=5.5.5&lt;br /&gt;
    SOLRNAME=solr-$SOLRVERSION&lt;br /&gt;
    SOLRTAR=$SOLRNAME&#039;.tgz&#039;&lt;br /&gt;
    INDEXNAME=moodle&lt;br /&gt;
    if [ -d $SOLRNAME ]; then&lt;br /&gt;
        echo &amp;quot;Error: Directory $SOLRNAME already exists, remove it before starting the setup again.&amp;quot;&lt;br /&gt;
        exit 1&lt;br /&gt;
    fi&lt;br /&gt;
    if [ ! -f $SOLRTAR ]; then&lt;br /&gt;
        wget http://www-us.apache.org/dist/lucene/solr/$SOLRVERSION/$SOLRTAR&lt;br /&gt;
    fi&lt;br /&gt;
    tar -xvzf $SOLRTAR&lt;br /&gt;
    cd $SOLRNAME&lt;br /&gt;
    bin/solr start&lt;br /&gt;
    bin/solr create -c $INDEXNAME&lt;br /&gt;
    # After setting it up and creating the index use:&lt;br /&gt;
    # - &amp;quot;/yourdirectory/solrdir/bin/solr start&amp;quot; from CLI to start the server&lt;br /&gt;
    # - &amp;quot;/yourdirectory/solrdir/bin/solr stop&amp;quot; from CLI to stop the server.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
======Solr 5/6 schema setup======&lt;br /&gt;
&lt;br /&gt;
Moodle will use Solr&#039;s managed schema interface to install the required fields. You will be directed on what to do from the Manage global search page.&lt;br /&gt;
&lt;br /&gt;
For very large or busy sites, it is recommended that you manually remove the &#039;&#039;&#039;_text_&#039;&#039;&#039; field, and associated copy directive from, the default Solr schema. This field is not used by Moodle, and will significantly slow indexing, and increase the size of the resulting Solr core.&lt;br /&gt;
&lt;br /&gt;
======Solr 4 schema setup======&lt;br /&gt;
&lt;br /&gt;
You cannot  use the schema setup script when using a Solr 4 server. If you really want to use the Solr 4x branch, here are the field types descriptions:&lt;br /&gt;
&lt;br /&gt;
Extracted from search/classes/document.php&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;nicetable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Field name&lt;br /&gt;
! Field type&lt;br /&gt;
! Stored&lt;br /&gt;
! Indexed&lt;br /&gt;
! Query field&lt;br /&gt;
|-&lt;br /&gt;
| id&lt;br /&gt;
| org.apache.solr.schema.StrField&lt;br /&gt;
| true&lt;br /&gt;
| false&lt;br /&gt;
| false&lt;br /&gt;
|-&lt;br /&gt;
| itemid&lt;br /&gt;
| org.apache.solr.schema.TrieIntField&lt;br /&gt;
| true&lt;br /&gt;
| true&lt;br /&gt;
| false&lt;br /&gt;
|-&lt;br /&gt;
| title&lt;br /&gt;
| org.apache.solr.schema.TextField&lt;br /&gt;
| true&lt;br /&gt;
| true&lt;br /&gt;
| true&lt;br /&gt;
|-&lt;br /&gt;
| content&lt;br /&gt;
| org.apache.solr.schema.TextField&lt;br /&gt;
| true&lt;br /&gt;
| true&lt;br /&gt;
| true&lt;br /&gt;
|-&lt;br /&gt;
| contextid&lt;br /&gt;
| org.apache.solr.schema.TrieIntField&lt;br /&gt;
| true&lt;br /&gt;
| true&lt;br /&gt;
| false&lt;br /&gt;
|-&lt;br /&gt;
| areaid&lt;br /&gt;
| org.apache.solr.schema.StrField&lt;br /&gt;
| true&lt;br /&gt;
| true&lt;br /&gt;
| false&lt;br /&gt;
|-&lt;br /&gt;
| type&lt;br /&gt;
| org.apache.solr.schema.TrieIntField&lt;br /&gt;
| true&lt;br /&gt;
| true&lt;br /&gt;
| false&lt;br /&gt;
|-&lt;br /&gt;
| courseid&lt;br /&gt;
| org.apache.solr.schema.TrieIntField&lt;br /&gt;
| true&lt;br /&gt;
| true&lt;br /&gt;
| false&lt;br /&gt;
|-&lt;br /&gt;
| owneruserid&lt;br /&gt;
| org.apache.solr.schema.TrieIntField&lt;br /&gt;
| true&lt;br /&gt;
| true&lt;br /&gt;
| false&lt;br /&gt;
|-&lt;br /&gt;
| modified&lt;br /&gt;
| org.apache.solr.schema.TrieDateField&lt;br /&gt;
| true&lt;br /&gt;
| true&lt;br /&gt;
| false&lt;br /&gt;
|-&lt;br /&gt;
| userid&lt;br /&gt;
| org.apache.solr.schema.TrieIntField&lt;br /&gt;
| true&lt;br /&gt;
| true&lt;br /&gt;
| false&lt;br /&gt;
|-&lt;br /&gt;
| description1&lt;br /&gt;
| org.apache.solr.schema.TextField&lt;br /&gt;
| true&lt;br /&gt;
| true&lt;br /&gt;
| true&lt;br /&gt;
|-&lt;br /&gt;
| description2&lt;br /&gt;
| org.apache.solr.schema.TextField&lt;br /&gt;
| true&lt;br /&gt;
| true&lt;br /&gt;
| true&lt;br /&gt;
|-&lt;br /&gt;
| solr_filegroupingid&lt;br /&gt;
| org.apache.solr.schema.StrField&lt;br /&gt;
| true&lt;br /&gt;
| true&lt;br /&gt;
| false&lt;br /&gt;
|-&lt;br /&gt;
| solr_fileid&lt;br /&gt;
| org.apache.solr.schema.StrField&lt;br /&gt;
| true&lt;br /&gt;
| true&lt;br /&gt;
| false&lt;br /&gt;
|-&lt;br /&gt;
| solr_filecontenthash&lt;br /&gt;
| org.apache.solr.schema.StrField&lt;br /&gt;
| true&lt;br /&gt;
| true&lt;br /&gt;
| false&lt;br /&gt;
|-&lt;br /&gt;
| solr_fileindexstatus&lt;br /&gt;
| org.apache.solr.schema.TrieIntField&lt;br /&gt;
| true&lt;br /&gt;
| true&lt;br /&gt;
| false&lt;br /&gt;
|-&lt;br /&gt;
| solr_filecontent&lt;br /&gt;
| org.apache.solr.schema.TextField&lt;br /&gt;
| false&lt;br /&gt;
| true&lt;br /&gt;
| true&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
======Memory and File indexing considerations======&lt;br /&gt;
&lt;br /&gt;
For large sites, and particularly if you are using the File indexing feature, it&#039;s a good idea to give Solr plenty of memory, eg aound 10-20GB. To start Solr with more than its default 512MB of RAM, use the &#039;&#039;-m&#039;&#039; option: &lt;br /&gt;
 solr start -m 12g&lt;br /&gt;
&lt;br /&gt;
See the documents for your version of Solr on how to increases memory when Solr is started automatically.&lt;br /&gt;
&lt;br /&gt;
======Too many boolean clauses error======&lt;br /&gt;
&lt;br /&gt;
Because of the way Moodle handles permissions for searches, if you have non-admin users with access to a large number of activities (&amp;gt;1000), they may an error similar to the following:&lt;br /&gt;
&lt;br /&gt;
    The query you provided could not be parsed by the search engine: org.apache.solr.search.SyntaxError: Cannot parse &lt;br /&gt;
    ...&lt;br /&gt;
    too many boolean clauses&lt;br /&gt;
&lt;br /&gt;
To correct this, you need to increase the &#039;&#039;maxBooleanClauses&#039;&#039; setting in your Solr core. The setting is located in &#039;&#039;corename/conf/solrconfig.xml&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
This important note is included in the config file:&lt;br /&gt;
    ** WARNING **&lt;br /&gt;
    &lt;br /&gt;
    This option actually modifies a global Lucene property that&lt;br /&gt;
    will affect all SolrCores.  If multiple solrconfig.xml files&lt;br /&gt;
    disagree on this property, the value at any given moment will&lt;br /&gt;
    be based on the last SolrCore to be initialized.&lt;br /&gt;
&lt;br /&gt;
This means that for consistent behavior you should update this value for all cores in the Solr server.&lt;br /&gt;
&lt;br /&gt;
=====Commannd for installing Solr Server on Centos 7=====&lt;br /&gt;
First of all install java (openjdk)&lt;br /&gt;
 yum install java-1.8.0-openjdk&lt;br /&gt;
Add user for solr&lt;br /&gt;
 adduser solr&lt;br /&gt;
Download solr server, find latest here : http://lucene.apache.org/solr/mirrors-solr-latest-redir.html, from the list there download latest solr-[version].tgz&lt;br /&gt;
&lt;br /&gt;
Here is the list of needed commands (note that latest solr is suggested, change command to appropriate version) &lt;br /&gt;
 cd /opt&lt;br /&gt;
 wget http://www-eu.apache.org/dist/lucene/solr/6.6.0/solr-6.6.0.tgz&lt;br /&gt;
 tar zxvf solr-6.6.0.tgz&lt;br /&gt;
 cp solr-6.6.0/bin/install_solr_service.sh .&lt;br /&gt;
 rm -rf solr-6.6.0&lt;br /&gt;
 ./install_solr_service.sh solr-6.6.0.tgz&lt;br /&gt;
 chkconfig solr on&lt;br /&gt;
Create the index&lt;br /&gt;
 su - solr -c &amp;quot;/opt/solr/bin/solr create_core -c moodle&amp;quot;&lt;br /&gt;
Then go to your Moodle and set index name as created (moodle)&lt;br /&gt;
&lt;br /&gt;
==See also==&lt;br /&gt;
&lt;br /&gt;
Forum discussions:&lt;br /&gt;
* [https://moodle.org/mod/forum/discuss.php?d=334938 Global search doesn&#039;t index plugins?]&lt;br /&gt;
* [https://moodle.org/mod/forum/discuss.php?d=339819 Global Search on Moodle 3.1]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
A quick introduction to Moodle global search, followed by a description of the new features and fixes in Moodle 3.4 (and some of those in Moodle 3.5).&lt;br /&gt;
*[https://www.slideshare.net/sammarshall_ou/moodle-global-search-nows-the-time-to-jump-in Presentation by Sam Marshall from the Open University]&lt;br /&gt;
&lt;br /&gt;
[[es:Búsqueda global]]&lt;br /&gt;
[[de:Globale Suche]]&lt;/div&gt;</summary>
		<author><name>Emerrill</name></author>
	</entry>
	<entry>
		<id>https://docs.moodle.org/39/en/index.php?title=Global_search&amp;diff=124267</id>
		<title>Global search</title>
		<link rel="alternate" type="text/html" href="https://docs.moodle.org/39/en/index.php?title=Global_search&amp;diff=124267"/>
		<updated>2016-07-02T13:08:31Z</updated>

		<summary type="html">&lt;p&gt;Emerrill: /* The Solr server */ Include information about max boolean parameters error&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{More features}}&lt;br /&gt;
{{New features}}&lt;br /&gt;
==What is Global search?==&lt;br /&gt;
*Global search lets you search everywhere on the Moodle site that you have access to. A student can search their courses for particular lecture notes, for example, or a teacher could search for subject-related activities.&lt;br /&gt;
*The feature needs to be enabled by the administrator and a search box is then available next to the user menu.&lt;br /&gt;
&lt;br /&gt;
[[File:NFGlobalsearchbox.png|thumb|center|480px|Searching the site (when global search is enabled)]]&lt;br /&gt;
&lt;br /&gt;
*A [[Global search block]] may also be added to course pages.&lt;br /&gt;
&lt;br /&gt;
==What can I search for?==&lt;br /&gt;
You can search for your courses, activities information and some activities contents like forum posts, book chapters, glossary entries or collaborative wikis pages. We will add more contents in future Moodle versions. Developers interested in adding plugin&#039;s contents to global search may be interested in looking at the [https://docs.moodle.org/dev/Search_API Search API].&lt;br /&gt;
&lt;br /&gt;
==How does it work?==&lt;br /&gt;
*Click the search icon by the user menu and type a search term into the box that appears, or type into the box in the [[Global search block]] if enabled.&lt;br /&gt;
*On the next screen, you can simply click the search button to search everywhere, or expand the Filter to search in specific areas:&lt;br /&gt;
&lt;br /&gt;
[[File:NFFilteringGlobalSearch2.png|thumb|center|600px|Filtering the search]]&lt;br /&gt;
&lt;br /&gt;
*You will then see results displayed from all areas of Moodle you have access to:&lt;br /&gt;
&lt;br /&gt;
[[File:31GSResults2a.png|thumb|center|600px|Search results]]&lt;br /&gt;
&lt;br /&gt;
===Solr search query features===&lt;br /&gt;
&lt;br /&gt;
You can improve your search using any of the following search query features:&lt;br /&gt;
&lt;br /&gt;
* Specifying the field to be searched by prefixing the search query with &#039;title:&#039;, &#039;content:&#039;, &#039;name:&#039;, or &#039;intro:&#039; e.g.&#039;title:news&#039; returns results with the word &#039;news&#039; in the title&lt;br /&gt;
* Boolean operators (&#039;AND&#039;, &#039;OR&#039;, &#039;NOT&#039;) to combine or exclude keywords&lt;br /&gt;
* Wildcard characters (&#039;*&#039; or &#039;?&#039; ) to represent characters in the search query&lt;br /&gt;
* Proximity searches (&#039;~&#039;) e.g. mood~2 returns &amp;quot;moodle&amp;quot; (2 letters away from &amp;quot;mood&amp;quot;), Moodle Australia~3 returns results containing &amp;quot;Moodle HQ in Perth, Australia&amp;quot; (the queried terms were within 3 words of each other)&lt;br /&gt;
* Boosting terms (&#039;^&#039;) to boost certain words or phrases e.g. &amp;quot;Perth Australia&amp;quot;^5 &amp;quot;Australia&amp;quot; will return results with the phrase &amp;quot;Perth Australia&amp;quot; as more relevant.&lt;br /&gt;
&lt;br /&gt;
Note: The above features are only available when using the Solr search engine.&lt;br /&gt;
&lt;br /&gt;
==How is it set up?==&lt;br /&gt;
&lt;br /&gt;
{{Note|Global search needs a search engine. Instructions for the installing the PHP Solr extension and a Solr server are below. See the [https://docs.moodle.org/dev/Search_engines Developer docs on Search engine plugins] if you wish to write your own. It&#039;s recommended you set everything up first, index the site contents &#039;&#039;and only then&#039;&#039; enable Global search.}}&lt;br /&gt;
&lt;br /&gt;
===Setting up Solr===&lt;br /&gt;
&lt;br /&gt;
====General Setup====&lt;br /&gt;
&lt;br /&gt;
# Set the feature up in &#039;&#039;Site administration &amp;gt; Plugins &amp;gt; Search &amp;gt; Manage global search&#039;&#039; by selecting Solr as the search engine and ticking search area checkboxes as required&lt;br /&gt;
# In &#039;&#039;Site administration &amp;gt; Plugins &amp;gt; Search &amp;gt; Solr&#039;&#039;, set &#039;&#039;&#039;Host name&#039;&#039;&#039; to localhost, &#039;&#039;&#039;Port&#039;&#039;&#039; to 8983 and &#039;&#039;&#039;Index name&#039;&#039;&#039; to &#039;moodle&#039; (the name of the index in Solr) &lt;br /&gt;
# If you are using Solr with SSL encryption, you will need to configure Moodle as such. This is important if solr is not installed in the web server server.&lt;br /&gt;
## You will need a separate key file and cacert file, both in pem format, located on your server Moodle, and readable by the PHP process.&lt;br /&gt;
## Go to &#039;&#039;Site administration &amp;gt; Plugins &amp;gt; Search &amp;gt; Solr&#039;&#039;&lt;br /&gt;
## Set &#039;&#039;&#039;Secure mode&#039;&#039;&#039; to Yes&lt;br /&gt;
## &#039;&#039;&#039;SSL certificate&#039;&#039;&#039; to /path/to/certs/solr-ssl.cacert.pem&lt;br /&gt;
## &#039;&#039;&#039;SSL key&#039;&#039;&#039; to /path/to/certs/solr-ssl.key.pem&lt;br /&gt;
## &#039;&#039;&#039;SSL key Password&#039;&#039;&#039; to The password used to lock the SSL Key&lt;br /&gt;
## &#039;&#039;&#039;SSL CA certificates name&#039;&#039;&#039; to /path/to/certs/solr-ssl.cacert.pem&lt;br /&gt;
# Index your site&#039;s data going to &#039;&#039;Site administration &amp;gt; Reports &amp;gt; Global search info&#039;&#039; or from the CLI running &#039;&#039;&#039;php admin/tool/task/cli/schedule_task.php --execute=&amp;quot;\core\task\search_index_task&amp;quot;&#039;&#039;&#039; script, being the CLI script the recommended option for big sites.&lt;br /&gt;
# Enable Global search in &#039;&#039;Site administration &amp;gt; Advanced features&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
====File Indexing====&lt;br /&gt;
&lt;br /&gt;
Solr has the ability to index the contents of files, such as File resources and attachments to Forum posts. This uses the [https://tika.apache.org/ Tika] engine which comes bundled with Solr. To enable this feature:&lt;br /&gt;
# In &#039;&#039;Site administration &amp;gt; Plugins &amp;gt; Search &amp;gt; Solr&#039;&#039; enable the checkbox &#039;&#039;&#039;Enable file indexing&#039;&#039;&#039;&lt;br /&gt;
# Set &#039;&#039;&#039;Maximum file size to index (kB)&#039;&#039;&#039; to some value - the default is &#039;&#039;&#039;2097152&#039;&#039;&#039; (2GB)&lt;br /&gt;
#* Files larger than this limit will not be sent for Solr for indexing, but the file name will still be indexed.&lt;br /&gt;
&lt;br /&gt;
===How to install Solr===&lt;br /&gt;
&lt;br /&gt;
You need PHP Solr extension installed. You can download the official latest versions from [http://pecl.php.net/package/solr](http://pecl.php.net/package/solr) The minimum required version is PECL Solr 2.1 for PHP 5 branch and PECL Solr 2.4 for PHP 7 branch.&lt;br /&gt;
&lt;br /&gt;
Basic installation steps (using apache web server):&lt;br /&gt;
&lt;br /&gt;
==== Linux (Debian/Ubuntu) ====&lt;br /&gt;
&lt;br /&gt;
    sudo apt-get install libpcre3-dev libxml2-dev libcurl4-openssl-dev&lt;br /&gt;
    sudo apt-get install php5-dev&lt;br /&gt;
    sudo apt-get install php-pear&lt;br /&gt;
    sudo pecl install solr&lt;br /&gt;
    sudo sh -c &amp;quot;echo &#039;extension=solr.so&#039; &amp;gt; /etc/php5/apache2/conf.d/solr.ini&amp;quot;&lt;br /&gt;
    sudo sh -c &amp;quot;echo &#039;extension=solr.so&#039; &amp;gt; /etc/php5/cli/conf.d/solr.ini&amp;quot;&lt;br /&gt;
    sudo service apache2 restart&lt;br /&gt;
&lt;br /&gt;
==== OSX using macports ====&lt;br /&gt;
&lt;br /&gt;
    sudo port install apache-solr4&lt;br /&gt;
    sudo port install php54-solr&lt;br /&gt;
&lt;br /&gt;
==== OSX using homebrew ====&lt;br /&gt;
&lt;br /&gt;
    brew install homebrew/php/php56-solr&lt;br /&gt;
&lt;br /&gt;
==== Windows ====&lt;br /&gt;
&lt;br /&gt;
Install the pecl package as usual. (This has not yet been tested.)&lt;br /&gt;
&lt;br /&gt;
==== The Solr server ====&lt;br /&gt;
&lt;br /&gt;
Moodle 3.1 supports Solr server from 4.0 onwards, although you can only use the Solr schema setup script that we provide with Moodle from Solr 5. The latest Solr 5 available version is the recommended one; the same will apply to Solr 6 once it is released. &lt;br /&gt;
&lt;br /&gt;
Note that for medium/large sites you may need to increase maxBooleanClauses setting. In [https://tracker.moodle.org/browse/MDL-54992 MDL-54992] we are working on an alternative way to query the server. &lt;br /&gt;
 &lt;br /&gt;
The following example snippet (feel free to copy &amp;amp; paste into a .sh script with execution permissions) will download Solr 5.4.1 (replace it with latest 5.x) in the current directory, start the solr server and create an index in it named &#039;&#039;&#039;moodle&#039;&#039;&#039; to add moodle data to it.&lt;br /&gt;
&lt;br /&gt;
    #!/bin/bash&lt;br /&gt;
    set -e&lt;br /&gt;
    SOLRVERSION=5.4.1&lt;br /&gt;
    SOLRNAME=solr-$SOLRVERSION&lt;br /&gt;
    SOLRTAR=$SOLRNAME&#039;.tgz&#039;&lt;br /&gt;
    INDEXNAME=moodle&lt;br /&gt;
    if [ -d $SOLRNAME ]; then&lt;br /&gt;
        echo &amp;quot;Error: Directory $SOLRNAME already exists, remove it before starting the setup again.&amp;quot;&lt;br /&gt;
        exit 1&lt;br /&gt;
    fi&lt;br /&gt;
    if [ ! -f $SOLRTAR ]; then&lt;br /&gt;
        wget http://www-us.apache.org/dist/lucene/solr/$SOLRVERSION/$SOLRTAR&lt;br /&gt;
    fi&lt;br /&gt;
    tar -xvzf $SOLRTAR&lt;br /&gt;
    cd $SOLRNAME&lt;br /&gt;
    bin/solr start&lt;br /&gt;
    bin/solr create -c $INDEXNAME&lt;br /&gt;
    # After setting it up and creating the index use:&lt;br /&gt;
    # - &amp;quot;/yourdirectory/solrdir/bin/solr start&amp;quot; from CLI to start the server&lt;br /&gt;
    # - &amp;quot;/yourdirectory/solrdir/bin/solr stop&amp;quot; from CLI to stop the server.&lt;br /&gt;
&lt;br /&gt;
=====Solr 5/6 schema setup=====&lt;br /&gt;
&lt;br /&gt;
Moodle will use Solr&#039;s managed schema interface to install the required fields. You will be directed on what to do from the Manage global search page.&lt;br /&gt;
&lt;br /&gt;
For very large or busy sites, it is recommended that you manually remove the &#039;&#039;&#039;_text_&#039;&#039;&#039; field, and associated copy directive from, the default Solr schema. This field is not used by Moodle, and will significantly slow indexing, and increase the size of the resulting Solr core.&lt;br /&gt;
&lt;br /&gt;
=====Solr 4 schema setup=====&lt;br /&gt;
&lt;br /&gt;
You cannot  use the schema setup script when using a Solr 4 server. If you really want to use the Solr 4x branch, here are the field types descriptions:&lt;br /&gt;
&lt;br /&gt;
Extracted from search/classes/document.php&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;nicetable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Field name&lt;br /&gt;
! Field type&lt;br /&gt;
! Stored&lt;br /&gt;
! Indexed&lt;br /&gt;
! Query field&lt;br /&gt;
|-&lt;br /&gt;
| id&lt;br /&gt;
| org.apache.solr.schema.StrField&lt;br /&gt;
| true&lt;br /&gt;
| false&lt;br /&gt;
| false&lt;br /&gt;
|-&lt;br /&gt;
| itemid&lt;br /&gt;
| org.apache.solr.schema.TrieIntField&lt;br /&gt;
| true&lt;br /&gt;
| true&lt;br /&gt;
| false&lt;br /&gt;
|-&lt;br /&gt;
| title&lt;br /&gt;
| org.apache.solr.schema.TextField&lt;br /&gt;
| true&lt;br /&gt;
| true&lt;br /&gt;
| true&lt;br /&gt;
|-&lt;br /&gt;
| content&lt;br /&gt;
| org.apache.solr.schema.TextField&lt;br /&gt;
| true&lt;br /&gt;
| true&lt;br /&gt;
| true&lt;br /&gt;
|-&lt;br /&gt;
| contextid&lt;br /&gt;
| org.apache.solr.schema.TrieIntField&lt;br /&gt;
| true&lt;br /&gt;
| true&lt;br /&gt;
| false&lt;br /&gt;
|-&lt;br /&gt;
| areaid&lt;br /&gt;
| org.apache.solr.schema.StrField&lt;br /&gt;
| true&lt;br /&gt;
| true&lt;br /&gt;
| false&lt;br /&gt;
|-&lt;br /&gt;
| type&lt;br /&gt;
| org.apache.solr.schema.TrieIntField&lt;br /&gt;
| true&lt;br /&gt;
| true&lt;br /&gt;
| false&lt;br /&gt;
|-&lt;br /&gt;
| courseid&lt;br /&gt;
| org.apache.solr.schema.TrieIntField&lt;br /&gt;
| true&lt;br /&gt;
| true&lt;br /&gt;
| false&lt;br /&gt;
|-&lt;br /&gt;
| owneruserid&lt;br /&gt;
| org.apache.solr.schema.TrieIntField&lt;br /&gt;
| true&lt;br /&gt;
| true&lt;br /&gt;
| false&lt;br /&gt;
|-&lt;br /&gt;
| modified&lt;br /&gt;
| org.apache.solr.schema.TrieDateField&lt;br /&gt;
| true&lt;br /&gt;
| true&lt;br /&gt;
| false&lt;br /&gt;
|-&lt;br /&gt;
| userid&lt;br /&gt;
| org.apache.solr.schema.TrieIntField&lt;br /&gt;
| true&lt;br /&gt;
| true&lt;br /&gt;
| false&lt;br /&gt;
|-&lt;br /&gt;
| description1&lt;br /&gt;
| org.apache.solr.schema.TextField&lt;br /&gt;
| true&lt;br /&gt;
| true&lt;br /&gt;
| true&lt;br /&gt;
|-&lt;br /&gt;
| description2&lt;br /&gt;
| org.apache.solr.schema.TextField&lt;br /&gt;
| true&lt;br /&gt;
| true&lt;br /&gt;
| true&lt;br /&gt;
|-&lt;br /&gt;
| solr_filegroupingid&lt;br /&gt;
| org.apache.solr.schema.StrField&lt;br /&gt;
| true&lt;br /&gt;
| true&lt;br /&gt;
| false&lt;br /&gt;
|-&lt;br /&gt;
| solr_fileid&lt;br /&gt;
| org.apache.solr.schema.StrField&lt;br /&gt;
| true&lt;br /&gt;
| true&lt;br /&gt;
| false&lt;br /&gt;
|-&lt;br /&gt;
| solr_filecontenthash&lt;br /&gt;
| org.apache.solr.schema.StrField&lt;br /&gt;
| true&lt;br /&gt;
| true&lt;br /&gt;
| false&lt;br /&gt;
|-&lt;br /&gt;
| solr_fileindexstatus&lt;br /&gt;
| org.apache.solr.schema.TrieIntField&lt;br /&gt;
| true&lt;br /&gt;
| true&lt;br /&gt;
| false&lt;br /&gt;
|-&lt;br /&gt;
| solr_filecontent&lt;br /&gt;
| org.apache.solr.schema.TextField&lt;br /&gt;
| false&lt;br /&gt;
| true&lt;br /&gt;
| true&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=====Memory and File indexing considerations=====&lt;br /&gt;
&lt;br /&gt;
For large sites, and particularly if you are using the File indexing feature, it&#039;s a good idea to give Solr plenty of memory, eg aound 10-20GB. To start Solr with more than its default 512MB of RAM, use the &#039;&#039;-m&#039;&#039; option: &lt;br /&gt;
 solr start -m 12g&lt;br /&gt;
&lt;br /&gt;
See the documents for your version of Solr on how to increases memory when Solr is started automatically.&lt;br /&gt;
&lt;br /&gt;
=====Too many boolean clauses error=====&lt;br /&gt;
&lt;br /&gt;
Because of the way Moodle handles permissions for searches, if you have non-admin users with access to a large number of activities (&amp;gt;1000), they may an error similar to the following:&lt;br /&gt;
&lt;br /&gt;
    The query you provided could not be parsed by the search engine: org.apache.solr.search.SyntaxError: Cannot parse &lt;br /&gt;
    ...&lt;br /&gt;
    too many boolean clauses&lt;br /&gt;
&lt;br /&gt;
To correct this, you need to increase the &#039;&#039;maxBooleanClauses&#039;&#039; setting in your Solr core. The setting is located in &#039;&#039;corename/conf/solrconfig.xml&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
This important note is included in the config file:&lt;br /&gt;
    ** WARNING **&lt;br /&gt;
    &lt;br /&gt;
    This option actually modifies a global Lucene property that&lt;br /&gt;
    will affect all SolrCores.  If multiple solrconfig.xml files&lt;br /&gt;
    disagree on this property, the value at any given moment will&lt;br /&gt;
    be based on the last SolrCore to be initialized.&lt;br /&gt;
&lt;br /&gt;
This means that for consistent behavior you should update this value for all cores in the Solr server.&lt;br /&gt;
&lt;br /&gt;
==See also==&lt;br /&gt;
&lt;br /&gt;
* [https://moodle.org/mod/forum/discuss.php?d=334938 Global search doesn&#039;t index plugins?] forum discussion&lt;br /&gt;
&lt;br /&gt;
[[es:Búsqueda global]]&lt;/div&gt;</summary>
		<author><name>Emerrill</name></author>
	</entry>
	<entry>
		<id>https://docs.moodle.org/39/en/index.php?title=Performance_recommendations&amp;diff=123791</id>
		<title>Performance recommendations</title>
		<link rel="alternate" type="text/html" href="https://docs.moodle.org/39/en/index.php?title=Performance_recommendations&amp;diff=123791"/>
		<updated>2016-05-25T13:25:02Z</updated>

		<summary type="html">&lt;p&gt;Emerrill: Removing image optimization recommendation, due to MDL-50175.&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Performance}}&lt;br /&gt;
Moodle can be made to perform very well, at small usage levels or scaling up to many thousands of users. The factors involved in performance are basically the same as for any PHP-based database-driven system. When trying to optimize your server, try to focus on the factor which will make the most difference to the user. For example, if you have relatively more users browsing than accessing the database, look to improve the webserver performance.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Obtain a baseline benchmark==&lt;br /&gt;
&lt;br /&gt;
Before attempting any optimization, you should obtain a baseline benchmark of the component of the system you are trying to improve. For Linux try [http://lbs.sourceforge.net/ LBS] and for Windows use the Performance Monitor. Once you have quantitative data about how your system is performing currently, you&#039;ll be able to determine if the change you have made has had any real impact.&lt;br /&gt;
&lt;br /&gt;
The overall aim of adjustments to improve performance is to use RAM (cacheing) and to reduce disk-based activity. It is especially important to try to eliminate swap file usage as much as you can. If your system starts swapping, this is a sign that you need more RAM. &lt;br /&gt;
&lt;br /&gt;
The &#039;&#039;&#039;optimization order preference&#039;&#039;&#039; is usually: primary storage (more RAM), secondary storage (faster hard disks/improved hard disk configuration), processor (more and faster).&lt;br /&gt;
&lt;br /&gt;
==Scalability==&lt;br /&gt;
&lt;br /&gt;
Moodle&#039;s design (with clear separation of application layers) allows for strongly scalable setups. (Please check the list of [[Large installations|large Moodle installations]].)&lt;br /&gt;
&lt;br /&gt;
Large sites usually separate the web server and database onto separate servers, although for smaller installations this is typically not necessary.&lt;br /&gt;
&lt;br /&gt;
It is possible to load-balance a Moodle installation, for example by using more than one webserver. The separate webservers should query the same database and refer to the same filestore and cache areas (see [[Caching]]), but otherwise the separation of the application layers is complete enough to make this kind of clustering feasible. Similarly, the database could be a cluster of servers (e.g. a MySQL cluster), but this is not an easy task and you should seek expert support, e.g. from a Moodle Partner.&lt;br /&gt;
&lt;br /&gt;
===Server cluster===&lt;br /&gt;
&lt;br /&gt;
Using Moodle forum discussions:&lt;br /&gt;
&lt;br /&gt;
*[http://moodle.org/mod/forum/discuss.php?d=57202 Moodle clustering]&lt;br /&gt;
*[http://moodle.org/mod/forum/discuss.php?d=44470 Software load balancing]&lt;br /&gt;
*[http://moodle.org/mod/forum/discuss.php?d=49986 TCP load balancing]&lt;br /&gt;
*[http://moodle.org/mod/forum/discuss.php?d=88214 Installation for 3000 simultaneous users]&lt;br /&gt;
&lt;br /&gt;
==Hardware configuration==&lt;br /&gt;
&#039;&#039;&#039;Note&#039;&#039;&#039;: The fastest and most effective change that you can make to improve performance is to &#039;&#039;&#039;increase the amount of RAM on your web server&#039;&#039;&#039; - get as much as possible (e.g. 4GB or more). Increasing primary memory will reduce the need for processes to swap to disk and will enable your server to handle more users.&lt;br /&gt;
* Better performance is gained by obtaining the best &#039;&#039;&#039;processor capability&#039;&#039;&#039; you can, i.e. dual or dual core processors. A modern BIOS should allow you to enable hyperthreading, but check if this makes a difference to the overall performance of the processors by using a [http://en.wikipedia.org/wiki/Super_PI CPU benchmarking tool].&lt;br /&gt;
* If you can afford them, use &#039;&#039;&#039;SCSI hard disks&#039;&#039;&#039; instead of SATA drives. SATA drives will increase your system&#039;s CPU utilization, whereas SCSI drives have their own integrated processors and come into their own when you have multiple drives. If you must have SATA drives, check that your motherboard and the drives themselves support NCQ (Native Command Queuing).&lt;br /&gt;
* Purchase hard disks with a &#039;&#039;&#039;low seek time&#039;&#039;&#039;. This will improve the overall speed of your system, especially when accessing Moodle&#039;s reports.&lt;br /&gt;
* Size your &#039;&#039;&#039;swap file&#039;&#039;&#039; correctly. The general advice is to set it to 4 x physical RAM.&lt;br /&gt;
* Use a &#039;&#039;&#039;RAID disk system&#039;&#039;&#039;. Although there are many different RAID configurations you can create, the following generally works best:&lt;br /&gt;
** install a hardware RAID controller (if you can)&lt;br /&gt;
** the operating system and swap drive on one set of disks configured as RAID-1.&lt;br /&gt;
** Moodle, Web server and Database server on another set of disks configured as RAID-5.&lt;br /&gt;
* If your &#039;moodledata&#039; area is going to be on relatively slow storage (e.g. NFS mount on to a NAS device) you will probably have performance issues with the default cache configuration (which writes to this storage). See the page on [[Caching]] and consider an alternative. Using [https://en.wikipedia.org/wiki/GlusterFS GlusterFS] / [https://en.wikipedia.org/wiki/OCFS2 OCFS2] / [https://en.wikipedia.org/wiki/GFS2 GFS2] on a [https://en.wikipedia.org/wiki/Storage_Area_Network SAN] device and [https://en.wikipedia.org/wiki/Fibre_Channel Fiber Channel] could improve performance (See more info on the Moodle [https://moodle.org/mod/forum/discuss.php?d=214680#p1123124 forum thread])&lt;br /&gt;
* Use &#039;&#039;&#039;gigabit ethernet&#039;&#039;&#039; for improved latency and throughput. This is especially important when you have your webserver and database server separated out on different hosts.&lt;br /&gt;
* Check the settings on your &#039;&#039;&#039;network card&#039;&#039;&#039;. You may get an improvement in performance by increasing the use of buffers and transmit/receive descriptors (balance this with processor and memory overheads) and off-loading TCP checksum calculation onto the card instead of the OS.&lt;br /&gt;
*  Read this [http://moodle.org/mod/forum/discuss.php?d=68579 Case Study] on a server stress test with 300 users.  &lt;br /&gt;
* See this [http://elearning.sgu.ac.jp/doc/PT/ accompanying report] on network traffic and server loads.&lt;br /&gt;
* Also see this SFSU presentation at Educause (using VMWare): [http://www.educause.edu/Resources/AnOpenSourceLMSforaMissionCrit/162843]&lt;br /&gt;
&lt;br /&gt;
==Operating System==&lt;br /&gt;
* You can use [http://en.wikipedia.org/wiki/Linux Linux](recommended), Unix-based, Windows or Mac OS X for the server &#039;&#039;&#039;operating system&#039;&#039;&#039;. *nix operating systems generally require less memory than Mac OS X or Windows servers for doing the same task as the server is configured with just a shell interface. Additionally Linux does not have licensing fees attached, but can have a big learning curve if you&#039;re used to another operating system. If you have a large number of processors running SMP, you may also want to consider using a highly tuned OS such as [http://en.wikipedia.org/wiki/Solaris_Operating_Environment Solaris].&lt;br /&gt;
* Check your own OS and &#039;&#039;&#039;vendor specific instructions&#039;&#039;&#039; for optimization steps.&lt;br /&gt;
** For Linux look at the [http://linuxperf.sourceforge.net/ Linux Performance Team] site. &lt;br /&gt;
** For Linux investigate the hdparm command, e.g. hdparm -m16 -d1 can be used to enable read/write on multiple sectors and DMA. Mount disks with the async and noatime options.&lt;br /&gt;
** For Windows set the sever to be optimized for network applications (Control Panel, Network Connections, LAN connection, Properties, File &amp;amp; Printer Sharing for Microsoft Networks, Properties, Optimization). You can also search the [http://technet.microsoft.com/ Microsoft TechNet site] for optimization documents.&lt;br /&gt;
&lt;br /&gt;
==Web server performance==&lt;br /&gt;
&lt;br /&gt;
Installing [http://www.mozilla.com/en-US/ Firefox] and the [https://addons.mozilla.org/en-US/firefox/addon/1843 firebug] extension will allow you to watch the time it takes for each page component to load. Also, the [https://addons.mozilla.org/en-US/firefox/addon/5369 Yslow] extension will evaluate your page against Yahoo&#039;s [http://www.skrenta.com/2007/05/14_rules_for_fast_web_pages_by_1.html 14 rules], full text [http://developer.yahoo.com/performance/rules.html Best Practices for Speeding Up Your Web Site], &amp;lt;strike&amp;gt;([http://video.yahoo.com/video/play?vid=1040890 video])&amp;lt;/strike&amp;gt; for fast loading websites.&lt;br /&gt;
&lt;br /&gt;
===PHP performance===&lt;br /&gt;
* You are strongly recommended to use a &#039;&#039;&#039;PHP accelerator&#039;&#039;&#039; to ease CPU load, such as [http://pecl.php.net/apc APC], [http://www.php-accelerator.co.uk/ PHPA], [http://trac.lighttpd.net/xcache/ Xcache], [http://sourceforge.net/projects/wincache WinCache] or [http://eaccelerator.net/ eAccelerator]. (Take care to choose a PHP accelerator that is known to work well with your version of PHP and note that Turck MMCache is [http://turckmmcache.exeprod.com/TheManifestoEnglish no longer maintained] and can cause failures with PHP 5). PHP 5.5 (and newer) includes OpCache and is fully supported and recommended by Moodle&lt;br /&gt;
* Improvements in read/write performance can be improved by putting the cached PHP pages on a [[TMPFS]] filesystem - but remember that you&#039;ll lose the cache contents when there is a power failure or the server is rebooted.&lt;br /&gt;
* Performance of PHP is better when installed as an &#039;&#039;&#039;Apache/IIS6 ISAPI module&#039;&#039;&#039; (rather than a CGI). IIS 7.0/7.5 (Windows Server 2008/R2) users should choose a FastCGI installation for best performance.&lt;br /&gt;
* Also check the &#039;&#039;&#039;memory_limit&#039;&#039;&#039; in php.ini, reduce it to 16M for Moodle version earlier than 1.7 ([http://moodle.org/mod/forum/discuss.php?d=39656 See this forum discussion]). For Moodle 1.7 or later, it is recommended that the value of memory_limit should be 40M. As of [http://www.php.net/ChangeLog-5.php PHP 5.2.1] the default value for the memory_limit directive is 128M.&lt;br /&gt;
* Also see [[PHP_settings_by_Moodle_version]]&lt;br /&gt;
* Use [http://blog.bitnami.com/2014/06/performance-enhacements-for-apache-and.html PHP-FPM] (with apache).&lt;br /&gt;
&lt;br /&gt;
===Install HowTo===&lt;br /&gt;
* [http://2bits.com/articles/installing-php-apc-gnulinux-centos-5.html APC on CentOS 5.x (linux)]&lt;br /&gt;
* [http://fplanque.com/dev/linux/install-apc-php-cache-debian-lenny APC on Debian (linux)]&lt;br /&gt;
* [http://www.linuxtuts.net/211-installing-memcached-php5-memcache-module-debian-apache2.html MemCache module on Debian (Apache2 and PHP5) ]&lt;br /&gt;
* [http://noveckg.blogspot.com/2010/03/installing-memcached-on-centos-5x.html Installing Memcache on CentOS 5.x (linux)]&lt;br /&gt;
* [http://noveckg.blogspot.com/2010/02/installing-eaccelerator-cache-for-php.html Installing eAccelerator on CentOS 5.x (linux)]&lt;br /&gt;
* [https://docs.moodle.org/en/Installing_eAccelerator_In_Ubuntu_Server/ Installing eAccelerator on Ubuntu Server (linux)]&lt;br /&gt;
&lt;br /&gt;
===Apache performance===&lt;br /&gt;
* If you are using Apache on a Windows server, use the build from [http://www.apachelounge.com Apache Lounge] which is reported to have [http://moodle.org/mod/forum/discuss.php?d=93358 performance and stability improvements] compared to the official Apache download. Note that this is an unofficial build, so may not keep up with official releases.&lt;br /&gt;
* Set the &#039;&#039;&#039;MaxRequestWorkers&#039;&#039;&#039; directive correctly (&#039;&#039;&#039;MaxClients&#039;&#039;&#039; before Apache 2.4). Use this formula to help (which uses 80% of available memory to leave room for spare):&lt;br /&gt;
 MaxRequestWorkers = Total available memory * 80% / Max memory usage of apache process&lt;br /&gt;
:Memory usage of apache process is usually 10MB but Moodle can easily use up to 100MB per process, so a general rule of thumb is to divide your available memory in megabytes by 100 to get a conservative setting for MaxClients. You are quite likely to find yourself lowering the MaxRequestWorkers from its default of 150 on a Moodle server. To get a more accurate estimate read the value from the shell command:&lt;br /&gt;
 #ps -ylC httpd --sort:rss&lt;br /&gt;
&lt;br /&gt;
:If you need to increase the value of &#039;&#039;&#039;MaxRequestWorkers&#039;&#039;&#039; beyond 256, you will also need to set the &#039;&#039;&#039;ServerLimit&#039;&#039;&#039; directive. &lt;br /&gt;
&lt;br /&gt;
:&#039;&#039;&#039;Warning&#039;&#039;&#039;: Do not be tempted to set the value of MaxRequestWorkers higher than your available memory as your server will consume more RAM than available and start to swap to disk. &lt;br /&gt;
* Consider reducing the &#039;&#039;&#039;number of modules&#039;&#039;&#039; that Apache loads in the httpd.conf file to the minumum necessary to reduce the memory needed. &lt;br /&gt;
* Use the &#039;&#039;&#039;latest version of Apache&#039;&#039;&#039; - Apache 2 has an improved memory model which reduces memory usage further.&lt;br /&gt;
* For Unix/Linux systems, consider lowering &#039;&#039;&#039;MaxConnectionsPerChild&#039;&#039;&#039; (&#039;&#039;&#039;MaxRequestsPerChild&#039;&#039;&#039; before Apache 2.4) in httpd.conf to as low as 20-30 (if you set it any lower the overhead of forking begins to outweigh the benefits). &lt;br /&gt;
* For a heavily loaded server, consider setting &#039;&#039;&#039;KeepAlive Off&#039;&#039;&#039; (do this only if your Moodle pages do not contain links to resources or uploaded images) or lowering the &#039;&#039;&#039;KeepAliveTimeout&#039;&#039;&#039; to between 2 and 5. The default is 15 (seconds) - the higher the value the more server processes will be kept waiting for possibly idle connections. A more accurate value for KeepAliveTimeout is obtained by observing how long it takes your users to download a page. After altering any of the KeepAlive variables, monitor your CPU utilization as there may be an additional overhead in initiating more worker processes/threads.&lt;br /&gt;
* As an alternative to using KeepAlive Off, consider setting-up a &#039;&#039;&#039;Reverse Proxy server&#039;&#039;&#039; infront of the Moodle server to cache HTML files with images. You can then return Apache to using keep-alives on the Moodle server.&lt;br /&gt;
* If you do not use a .htaccess file, set the &#039;&#039;&#039;AllowOverride&#039;&#039;&#039; variable to AllowOverride None to prevent .htaccess lookups.&lt;br /&gt;
* Set &#039;&#039;&#039;DirectoryIndex&#039;&#039;&#039; correctly so as to avoid content-negotiation. Here&#039;s an example from a production server:&lt;br /&gt;
 DirectoryIndex index.php index.html index.htm&lt;br /&gt;
* Unless you are doing development work on the server, set &#039;&#039;&#039;ExtendedStatus Off&#039;&#039;&#039; and disable mod_info as well as mod_status.&lt;br /&gt;
* Leave &#039;&#039;&#039;HostnameLookups Off&#039;&#039;&#039; (as default) to reduce DNS latency.&lt;br /&gt;
* Consider reducing the value of &#039;&#039;&#039;TimeOut&#039;&#039;&#039; to between 30 to 60 (seconds). &lt;br /&gt;
* For the &#039;&#039;&#039;Options directive&#039;&#039;&#039;, avoid Options Multiviews as this performs a directory scan. To reduce disk I/O further use&lt;br /&gt;
 Options -Indexes FollowSymLinks&lt;br /&gt;
&lt;br /&gt;
* Compression reduces response times by reducing the size of the HTTP response&lt;br /&gt;
# Install and enable mod_deflate - refer to documentation or man pages&lt;br /&gt;
# Add this code to the virtual server config file within the &amp;lt;directory&amp;gt; section for the root directory (or within the .htaccess file if AllowOverrides is On):&lt;br /&gt;
 &amp;lt;ifModule mod_deflate.c&amp;gt;&lt;br /&gt;
   AddOutputFilterByType DEFLATE text/html text/plain text/xml text/x-js text/javascript text/css application/javascript&lt;br /&gt;
 &amp;lt;/ifmodule&amp;gt;&lt;br /&gt;
* Use Apache [http://blog.bitnami.com/2014/06/performance-enhacements-for-apache-and.html event] [http://httpd.apache.org/docs/current/mpm.html MPM] (and not the default Prefork or Worker)&lt;br /&gt;
&lt;br /&gt;
===IIS performance===&lt;br /&gt;
All alter this location in the registry:&lt;br /&gt;
 HKLM\SYSTEM\CurrentControlSet\Services\Inetinfo\Parameters\&lt;br /&gt;
* The equivalent to KeepAliveTimeout is &#039;&#039;&#039;ListenBackLog&#039;&#039;&#039; (IIS - registry location is HKLM\ SYSTEM\ CurrentControlSet\ Services\ Inetinfo\ Parameters). Set this to between 2 to 5.&lt;br /&gt;
*Change the &#039;&#039;&#039;MemCacheSize&#039;&#039;&#039; value to adjust the amount of memory (Mb) that IIS will use for its file cache (50% of available memory by default).&lt;br /&gt;
*Change the &#039;&#039;&#039;MaxCachedFileSize&#039;&#039;&#039; to adjust the maximum size of a file cached in the file cache in bytes. Default is 262,144 (256K).&lt;br /&gt;
*Create a new DWORD called &#039;&#039;&#039;ObjectCacheTTL&#039;&#039;&#039; to change the length of time (in milliseconds) that objects in the cache are held in memory. Default is 30,000 milliseconds (30 seconds).&lt;br /&gt;
&lt;br /&gt;
===Lighttpd, NginX and Cherokee performance===&lt;br /&gt;
You can increase server performance by using a &#039;&#039;&#039;light-weight&#039;&#039;&#039; webserver like [http://www.lighttpd.net/ lighttpd],  [http://nginx.net/ nginx] or [http://www.cherokee-project.com/ cherokee] in combination with PHP in FastCGI-mode. Lighttpd was originally created as a proof-of-concept[http://www.lighttpd.net/story] to address the [http://www.kegel.com/c10k.html C10k problem] and while primarily recommended for memory-limited servers, its design origins and asynchronous-IO model make it a suitable and proven[http://blog.lighttpd.net/articles/2006/12/28/lighttpd-powers-5-alexa-top-250-sites] alternative HTTP server for high-load websites and web apps, including Moodle. See the [[lighttpd | MoodleDocs Lighttpd page]] for additional information, configuration example and links.&lt;br /&gt;
&lt;br /&gt;
Alternatively, both [http://www.lighttpd.net/ lighttpd] and [http://nginx.net/ nginx] are capable of performing as a load-balancer and/or reverse-proxy to alleviate load on back-end servers[http://www.linuxjournal.com/article/10108], providing benefit without requiring an actual software change on existing servers.&lt;br /&gt;
&lt;br /&gt;
Do note that these are likely to be the least tested server environments of all particularly if you are using advanced features such as web services and/or Moodle Networking. They are probably best considered for heavily used Moodle sites with relatively simple configurations.&lt;br /&gt;
&lt;br /&gt;
===X-Sendfile===&lt;br /&gt;
&lt;br /&gt;
X-Sendfile modules improve performance when sending large files from Moodle. It is recommended to configure your web server and Moodle to use this feature of available.&lt;br /&gt;
&lt;br /&gt;
Configure web server:&lt;br /&gt;
* Apache - https://tn123.org/mod_xsendfile/&lt;br /&gt;
* Lighttpd - http://redmine.lighttpd.net/projects/lighttpd/wiki/X-LIGHTTPD-send-file&lt;br /&gt;
* Nginx - http://wiki.nginx.org/XSendfile&lt;br /&gt;
&lt;br /&gt;
Enable support in config.php (see config-dist.php):&lt;br /&gt;
&amp;lt;code php&amp;gt;&lt;br /&gt;
//     $CFG-&amp;gt;xsendfile = &#039;X-Sendfile&#039;;           // Apache {@see https://tn123.org/mod_xsendfile/}&lt;br /&gt;
//     $CFG-&amp;gt;xsendfile = &#039;X-LIGHTTPD-send-file&#039;; // Lighttpd {@see http://redmine.lighttpd.net/projects/lighttpd/wiki/X-LIGHTTPD-send-file}&lt;br /&gt;
//     $CFG-&amp;gt;xsendfile = &#039;X-Accel-Redirect&#039;;     // Nginx {@see http://wiki.nginx.org/XSendfile}&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Configure file location prefixes if your server implementation requires it:&lt;br /&gt;
&amp;lt;code php&amp;gt;&lt;br /&gt;
//     $CFG-&amp;gt;xsendfilealiases = array(&lt;br /&gt;
//         &#039;/dataroot/&#039; =&amp;gt; $CFG-&amp;gt;dataroot,&lt;br /&gt;
//         &#039;/cachedir/&#039; =&amp;gt; &#039;/var/www/moodle/cache&#039;,    // for custom $CFG-&amp;gt;cachedir locations&lt;br /&gt;
//         &#039;/localcachedir/&#039; =&amp;gt; &#039;/var/local/cache&#039;,    // for custom $CFG-&amp;gt;localcachedir locations&lt;br /&gt;
//         &#039;/tempdir/&#039;  =&amp;gt; &#039;/var/www/moodle/temp&#039;,     // for custom $CFG-&amp;gt;tempdir locations&lt;br /&gt;
//         &#039;/filedir&#039;   =&amp;gt; &#039;/var/www/moodle/filedir&#039;,  // for custom $CFG-&amp;gt;filedir locations&lt;br /&gt;
//     );&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Database performance==&lt;br /&gt;
&lt;br /&gt;
===MySQL performance===&lt;br /&gt;
&lt;br /&gt;
The following are MySQL specific settings which can be adjusted for better performance in your my.cnf (my.ini in Windows). The file contains a list of settings and their values. To see the current values use these commands&lt;br /&gt;
 SHOW STATUS;&lt;br /&gt;
 SHOW VARIABLES; &lt;br /&gt;
&#039;&#039;&#039;Important&#039;&#039;&#039;: You must make backups of your database before attempting to change any MySQL server configuration. After any change to the my.cnf, restart mysqld.&lt;br /&gt;
&lt;br /&gt;
If you are able, the [http://mysqltuner.com/ MySQLTuner] tool can be run against your MySQL server and will calculate appropriate configuration values for most of the following settings based on your current load, status and variables automatically.&lt;br /&gt;
&lt;br /&gt;
* Enable the &#039;&#039;&#039;query cache&#039;&#039;&#039; with &lt;br /&gt;
 query_cache_type = 1. &lt;br /&gt;
For most Moodle installs, set the following:&lt;br /&gt;
 query_cache_size = 36M &lt;br /&gt;
 query_cache_min_res_unit = 2K. &lt;br /&gt;
The query cache will improve performance if you are doing few updates on the database. &lt;br /&gt;
* Set the &#039;&#039;&#039;table cache&#039;&#039;&#039; correctly. For Moodle 1.6 set &lt;br /&gt;
 table_cache = 256 #(table_open_cache in MySQL &amp;gt; 5.1.2)&lt;br /&gt;
(min), and for Moodle 1.7 set &lt;br /&gt;
 table_cache = 512 #(table_open_cache in MySQL &amp;gt; 5.1.2)&lt;br /&gt;
(min). The table cache is used by all threads (connections), so monitor the value of opened_tables to further adjust - if opened_tables &amp;gt; 3 * table_cache(table_open_cache in MySQL &amp;gt; 5.1.2) then increase table_cache upto your OS limit. Note also that the figure for table_cache will also change depending on the number of modules and plugins you have installed. Find the number for your server by executing the mysql statement below. Look at the number returned and set table_cache to this value.&lt;br /&gt;
 mysql&amp;gt;SELECT COUNT(table_name) FROM information_schema.tables WHERE table_schema=&#039;yourmoodledbname&#039;;&lt;br /&gt;
* Set the &#039;&#039;&#039;thread cache&#039;&#039;&#039; correctly. Adjust the value so that your thread cache utilization is as close to 100% as possible by this formula:&lt;br /&gt;
 thread cache utilization (%) = (threads_created / connections) * 100&lt;br /&gt;
* The &#039;&#039;&#039;key buffer&#039;&#039;&#039; can improve the access speed to Moodle&#039;s SELECT queries. The correct size depends on the size of the index files (.myi) and in Moodle 1.6 or later (without any additional modules and plugins), the recommendation for this value is key_buffer_size = 32M. Ideally you want the database to be reading once from the disk for every 100 requests so monitor that the value is suitable for your install by adjusting the value of key_buffer_size so that the following formulas are true:&lt;br /&gt;
 key_read / key_read_requests &amp;lt; 0.01&lt;br /&gt;
 key_write / key_write_requests &amp;lt;= 1.0&lt;br /&gt;
* Set the &#039;&#039;&#039;maximum number of connections&#039;&#039;&#039; so that your users will not see a &amp;quot;Too many connections&amp;quot; message. Be careful that this may have an impact on the total memory used. MySQL connections usually last for milliseconds, so it is unusual even for a heavily loaded server for this value to be over 200.&lt;br /&gt;
* Manage &#039;&#039;&#039;high burst activity&#039;&#039;&#039;. If your Moodle install uses a lot of quizzes and you are experiencing performance problems (check by monitoring the value of threads_connected - it should not be rising) consider increasing the value of back_log.&lt;br /&gt;
* &#039;&#039;&#039;Optimize your tables weekly and after upgrading Moodle&#039;&#039;&#039;. It is good practice to also optimize your tables after performing a large data deletion exercise, e.g. at the end of your semester or academic year. This will ensure that index files are up to date. Backup your database first and then use:&lt;br /&gt;
 mysql&amp;gt;CHECK TABLE mdl_tablename;&lt;br /&gt;
 mysql&amp;gt;OPTIMIZE TABLE mdl_tablename;&lt;br /&gt;
:The common tables in Moodle to check are mdl_course_sections, mdl_forum_posts, mdl_log and mdl_sessions (if using dbsessions). Any errors need to be corrected using REPAIR TABLE (see the [http://dev.mysql.com/doc/refman/5.0/en/repair-table.html MySQL manual] and this [http://moodle.org/mod/forum/discuss.php?d=58208#p279638 forum script]).&lt;br /&gt;
* &#039;&#039;&#039;Maintain the key distribution&#039;&#039;&#039;. Every month or so it is a good idea to stop the mysql server and run these myisamchk commands.&lt;br /&gt;
 #myisamchk -a -S /pathtomysql/data/moodledir/*.MYI&lt;br /&gt;
:&#039;&#039;&#039;Warning&#039;&#039;&#039;: You must stop the mysql database process (mysqld) before running any myisamchk command. If you do not, you risk data loss.&lt;br /&gt;
* Reduce the number of &#039;&#039;&#039;temporary tables saved to disk&#039;&#039;&#039;. Check this with the created_tmp_disk_tables value. If this is relatively large (&amp;gt;5%) increase tmp_table_size until you see a reduction. Note that this will have an impact on RAM usage.&lt;br /&gt;
&lt;br /&gt;
===PostgreSQL performance===&lt;br /&gt;
&lt;br /&gt;
There are some good papers around on tuning PostgreSQL (like [http://wiki.postgresql.org/wiki/Tuning_Your_PostgreSQL_Server this one]), and Moodle&#039;s case does not seem to be different to the general case.&lt;br /&gt;
&lt;br /&gt;
The first thing to recognise is that if you really need to worry about tuning you should be using a separate machine for the database server. If you are not using a separate machine then the answers to many performance questions are substantially muddied by the memory requirements of the rest of the application.&lt;br /&gt;
&lt;br /&gt;
You should probably &#039;&#039;&#039;enable autovacuum&#039;&#039;&#039;, unless you know what you are doing. Many e-learning sites have predictable periods of low use, so disabling autovacuum and running a specific vacuum at those times can be a good option. Or perhaps leave autovacuum running but do a full vacuum weekly in a quiet period.&lt;br /&gt;
&lt;br /&gt;
Set &#039;&#039;&#039;shared_buffers&#039;&#039;&#039; to something reasonable. For versions up to 8.1 my testing has shown that peak performance is almost always obtained with buffers &amp;lt; 10000, so if you are using such a version, and have more than 512M of RAM just set shared_buffers to 10,000 (8MB).&lt;br /&gt;
&lt;br /&gt;
The buffer management had a big overhaul in 8.2 and &amp;quot;reasonable&amp;quot; is now a much larger number. I have not conducted performance tests with 8.2, but the recommendations from others are generally that you should now scale shared_buffers much more with memory and may continue to reap benefits even up to values like 100,000 (80MB). Consider using 1-2% of system RAM.&lt;br /&gt;
&lt;br /&gt;
PostgreSQL will also assume that the operating system is caching its files, so setting &#039;&#039;&#039;effective_cache_size&#039;&#039;&#039; to a reasonable value is also a good idea. A reasonable value will usually be (total RAM - RAM in use by programs). If you are running Linux and leave the system running for a day or two you can look at &#039;free&#039; and under the &#039;cached&#039; column you will see what it currently is. Consider taking that number (which is kB) and dividing it by 10 (i.e. allow 20% for other programs cache needs and then divide by 8 to get pages). If you are not using a dedicated database server you will need to decrease that value to account for usage by other programs.&lt;br /&gt;
&lt;br /&gt;
Some other useful parameters that can have positive effects, and the values I would typically set them to on a machine with 4G RAM, are:&lt;br /&gt;
&lt;br /&gt;
 work_mem = 10240&lt;br /&gt;
&lt;br /&gt;
That&#039;s 10M of RAM to use instead of on-disk sorting and so forth. That can give a big speed increase, but it is per connection and 200 connections * 10M is 2G, so it can theoretically chew up a lot of RAM.&lt;br /&gt;
&lt;br /&gt;
 maintenance_work_mem = 163840&lt;br /&gt;
&lt;br /&gt;
That&#039;s 160M of RAM which will be used by (e.g.) VACUUM, index rebuild, cluster and so forth. This should only be used periodically and should be freed when those processes exit, so I believe it is well worth while.&lt;br /&gt;
&lt;br /&gt;
 wal_buffers = 64&lt;br /&gt;
&lt;br /&gt;
These buffers are used for the write-ahead log, and there have been a number of reports on the PostgreSQL mailing lists of improvement from this level of increase.&lt;br /&gt;
&lt;br /&gt;
This is a little out of date now (version 8.0) but still worth a read: http://www.powerpostgresql.com/Docs&lt;br /&gt;
&lt;br /&gt;
And there is lots of good stuff here as well: http://www.varlena.com/GeneralBits/Tidbits/index.php&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Based on Andrew McMillan&#039;s post at [http://moodle.org/mod/forum/discuss.php?d=68558 Tuning PostgreSQL] forum thread.&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
* Splitting &#039;&#039;&#039;mdl_log&#039;&#039;&#039; to several tables and using a VIEW with UNION to read them as one. (See Tim Hunt [https://moodle.org/mod/forum/discuss.php?d=243531#p1104165 explanation] on the Moodle forums)&lt;br /&gt;
&lt;br /&gt;
===Other database performance links===&lt;br /&gt;
* Consider using a &#039;&#039;&#039;distributed cacheing system&#039;&#039;&#039; like [http://en.wikipedia.org/wiki/Memcached memcached] but note that memcached does not have any security features so it should be used behind a firewall.&lt;br /&gt;
* Consider using PostgreSQL. See [[Arguments in favour of PostgreSQL]] and [http://moodle.org/mod/forum/discuss.php?d=49195 how to migrate from MySQL to PostgreSQL] (forum discussion).&lt;br /&gt;
* [http://dev.mysql.com/doc/refman/5.0/en/server-parameters.html General advice on tuning MySQL parameters] (advice from the MySQL manual)&lt;br /&gt;
* [http://www.mysqlperformanceblog.com/2007/11/01/innodb-performance-optimization-basics/ InnoDB performance optimization] taken from the [http://www.mysqlperformanceblog.com/ MySQL performance blog] site.&lt;br /&gt;
&lt;br /&gt;
==Performance of different Moodle modules==&lt;br /&gt;
&lt;br /&gt;
Moodle&#039;s activity modules, filters, and other plugins can be activated/deactivated. If necessary, you may wish to deactivate some features (such as chat) if not required - but this isn&#039;t necessary. Some notes on the performance of certain modules:&lt;br /&gt;
&lt;br /&gt;
* The &#039;&#039;&#039;Chat&#039;&#039;&#039; module is [http://moodle.org/mod/forum/discuss.php?d=37979&amp;amp;parent=175079 said] to be a hog in terms of frequent HTTP requests to the main server. This can be reduced by setting the module to use &#039;&#039;Streamed&#039;&#039; updates, or, if you&#039;re using a Unix-based webserver, by running the chat in daemon mode. When using the Chat module use the configuration settings to tune for your expected load. Pay particular attention to the &#039;&#039;chat_old_ping&#039;&#039; and &#039;&#039;chat_refresh&#039;&#039; parameters as these can have greatest impact on server load.&lt;br /&gt;
* The &#039;&#039;&#039;Quiz&#039;&#039;&#039; module is known to stretch database performance. However, it has been getting better in recent versions, and we don&#039;t know of any good, up-to-date performance measurements. (Here is a [http://moodle.org/mod/forum/discuss.php?d=68579 case study from 2007 with 300 quiz users].)&lt;br /&gt;
* The Moodle &#039;&#039;&#039;Cron&#039;&#039;&#039; task is triggered by calling the script &#039;&#039;cron.php&#039;&#039;. If this is called over HTTP (e.g. using wget or curl) it can take a large amount of memory on large installations. If it is called by directly invoking the php command (e.g. &#039;&#039;php -f /path/to/moodle/directory/admin/cli/cron.php&#039;&#039;) efficiency can be much improved.&lt;br /&gt;
* The &#039;&#039;&#039;Recent activities&#039;&#039;&#039; block is consuming too many resources if you have huge number of records &amp;lt;code&amp;gt;mdl_log&amp;lt;/code&amp;gt;. This is being tested to optimize the SQL query.&lt;br /&gt;
&lt;br /&gt;
See [[Performance settings]] for more information on performance-related Moodle settings.&lt;br /&gt;
&lt;br /&gt;
==See also==&lt;br /&gt;
&lt;br /&gt;
*Using Moodle: [http://moodle.org/mod/forum/view.php?f=94 Hardware and Performance] forum&lt;br /&gt;
*[http://opensourceelearning.blogspot.be/2012/10/why-your-moodle-site-is-slow-five.html Why Your Moodle Site is Slow: Five Simple Settings] blog post from Jonathan Moore &lt;br /&gt;
*I teach with Moodle perfomance testing: http://www.iteachwithmoodle.com/2012/11/17/moodle-2-4-beta-performance-test-comparison-with-moodle-2-3/&lt;br /&gt;
*[http://jfilip.ca/2013/08/20/moodle-2-4-5-vs-2-5-1-performance-and-muc-apc-cache-store/ Moodle 2.4.5 vs 2.5.2 performance and MUC APC cahe store]&lt;br /&gt;
*[http://jfilip.ca/2013/09/25/moodle-performance-testing-2-4-6-vs-2-5-2-vs-2-6dev/ Moodle performance testing 2.4.6 vs 2.5.2 vs 2.6dev]&lt;br /&gt;
*[http://jfilip.ca/2013/09/24/moodle-performance-analysis-revisted-now-with-mariadb/ Moodle performance analysis revisited (now with MariaDB)]&lt;br /&gt;
*[http://tjhunt.blogspot.ca/2013/05/performance-testing-moodle.html Tim Hunt&#039;s blog (May 2, 2013) on performance testing Moodle]&lt;br /&gt;
*[http://newrelic.com/ New Relic, Application Performance Monitoring]&lt;br /&gt;
*[http://blog.bitnami.com/2014/06/performance-enhacements-for-apache-and.html Performance enhacements for Apache and PHP (Apache Event MPM and PHP-FPM)]&lt;br /&gt;
&lt;br /&gt;
There have been a lot of discussions on moodle.org about performance, here are some of the more interesting and (potentially) useful ones:&lt;br /&gt;
&lt;br /&gt;
* [http://moodle.org/mod/forum/discuss.php?d=83057 Performance woes!]&lt;br /&gt;
* [http://moodle.org/mod/forum/discuss.php?d=57028 Performance perspectives - a little script]&lt;br /&gt;
* [http://moodle.org/mod/forum/discuss.php?d=88927 Comments on planned server hardware]&lt;br /&gt;
* [http://moodle.org/mod/forum/discuss.php?d=102978#p461624 Moodle performance in a pil by Martin Langhoff]&lt;br /&gt;
* [https://moodle.org/mod/forum/discuss.php?d=240391#unread Advice on optimising php/db code in moodle2+]&lt;br /&gt;
* [https://moodle.org/mod/forum/discuss.php?d=243531 Moodle 2.5 performance testing at the OU]&lt;br /&gt;
* [https://moodle.org/mod/forum/discuss.php?d=273602 100 active users limit with 4vCPU]&lt;br /&gt;
&lt;br /&gt;
[[es:Recomendaciones sobre desempeño]]&lt;br /&gt;
[[fr:Performance]]&lt;br /&gt;
[[ja:パフォーマンス]]&lt;br /&gt;
[[de:Geschwindigkeitsempfehlungen]]&lt;/div&gt;</summary>
		<author><name>Emerrill</name></author>
	</entry>
	<entry>
		<id>https://docs.moodle.org/39/en/index.php?title=Global_search&amp;diff=123692</id>
		<title>Global search</title>
		<link rel="alternate" type="text/html" href="https://docs.moodle.org/39/en/index.php?title=Global_search&amp;diff=123692"/>
		<updated>2016-05-19T13:17:07Z</updated>

		<summary type="html">&lt;p&gt;Emerrill: /* How is it set up? */ Add information about file indexing setup and memory.&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{More features}}&lt;br /&gt;
{{New features}}&lt;br /&gt;
==What is Global search?==&lt;br /&gt;
*Global search lets you search everywhere on the Moodle site that you have access to. A student can search their courses for particular lecture notes, for example, or a teacher could search for subject-related activities.&lt;br /&gt;
*The feature needs to be enabled by the administrator and a search box is then available next to the user menu.&lt;br /&gt;
&lt;br /&gt;
[[File:NFGlobalsearchbox.png|thumb|center|480px|Searching the site (when global search is enabled)]]&lt;br /&gt;
&lt;br /&gt;
*A [[Global search block]] may also be added to course pages.&lt;br /&gt;
&lt;br /&gt;
==How does it work?==&lt;br /&gt;
*Click the search icon by the user menu and type a search term into the box that appears, or type into the box in the [[Global search block]] if enabled.&lt;br /&gt;
*On the next screen, you can simply click the search button to search everywhere, or expand the Filter to search in specific areas:&lt;br /&gt;
&lt;br /&gt;
[[File:NFFilteringGlobalSearch2.png|thumb|center|600px|Filtering the search]]&lt;br /&gt;
&lt;br /&gt;
*You will then see results displayed from all areas of Moodle you have access to:&lt;br /&gt;
&lt;br /&gt;
[[File:31GSResults2a.png|thumb|center|600px|Search results]]&lt;br /&gt;
&lt;br /&gt;
===Solr search query features===&lt;br /&gt;
&lt;br /&gt;
You can improve your search using any of the following search query features:&lt;br /&gt;
&lt;br /&gt;
* Specifying the field to be searched by prefixing the search query with &#039;title:&#039;, &#039;content:&#039;, &#039;name:&#039;, or &#039;intro:&#039; e.g.&#039;title:news&#039; returns results with the word &#039;news&#039; in the title&lt;br /&gt;
* Boolean operators (&#039;AND&#039;, &#039;OR&#039;, &#039;NOT&#039;) to combine or exclude keywords&lt;br /&gt;
* Wildcard characters (&#039;*&#039; or &#039;?&#039; ) to represent characters in the search query&lt;br /&gt;
* Proximity searches (&#039;~&#039;) e.g. mood~2 returns &amp;quot;moodle&amp;quot; (2 letters away from &amp;quot;mood&amp;quot;), Moodle Australia~3 returns results containing &amp;quot;Moodle HQ in Perth, Australia&amp;quot; (the queried terms were within 3 words of each other)&lt;br /&gt;
* Boosting terms (&#039;^&#039;) to boost certain words or phrases e.g. &amp;quot;Perth Australia&amp;quot;^5 &amp;quot;Australia&amp;quot; will return results with the phrase &amp;quot;Perth Australia&amp;quot; as more relevant.&lt;br /&gt;
&lt;br /&gt;
Note: The above features are only available when using the Solr search engine.&lt;br /&gt;
&lt;br /&gt;
==How is it set up?==&lt;br /&gt;
&lt;br /&gt;
{{Note|Global search needs a search engine. Instructions for the installing the PHP Solr extension and a Solr server are below. See the [https://docs.moodle.org/dev/Search_engines Developer docs on Search engine plugins] if you wish to write your own. It&#039;s recommended you set everything up first, index the site contents &#039;&#039;and only then&#039;&#039; enable Global search.}}&lt;br /&gt;
&lt;br /&gt;
===Setting up Solr===&lt;br /&gt;
&lt;br /&gt;
====General Setup====&lt;br /&gt;
&lt;br /&gt;
# Set the feature up in &#039;&#039;Site administration &amp;gt; Plugins &amp;gt; Search &amp;gt; Manage global search&#039;&#039; by selecting Solr as the search engine and ticking search area checkboxes as required&lt;br /&gt;
# In &#039;&#039;Site administration &amp;gt; Plugins &amp;gt; Search &amp;gt; Solr&#039;&#039;, set &#039;&#039;&#039;Host name&#039;&#039;&#039; to localhost, &#039;&#039;&#039;Port&#039;&#039;&#039; to 8983 and &#039;&#039;&#039;Index name&#039;&#039;&#039; to &#039;moodle&#039; (the name of the index in Solr) &lt;br /&gt;
# If you are using Solr with SSL encryption, you will need to configure Moodle as such. This is important if solr is not installed in the web server server.&lt;br /&gt;
## You will need a separate key file and cacert file, both in pem format, located on your server Moodle, and readable by the PHP process.&lt;br /&gt;
## Go to &#039;&#039;Site administration &amp;gt; Plugins &amp;gt; Search &amp;gt; Solr&#039;&#039;&lt;br /&gt;
## Set &#039;&#039;&#039;Secure mode&#039;&#039;&#039; to Yes&lt;br /&gt;
## &#039;&#039;&#039;SSL certificate&#039;&#039;&#039; to /path/to/certs/solr-ssl.cacert.pem&lt;br /&gt;
## &#039;&#039;&#039;SSL key&#039;&#039;&#039; to /path/to/certs/solr-ssl.key.pem&lt;br /&gt;
## &#039;&#039;&#039;SSL key Password&#039;&#039;&#039; to The password used to lock the SSL Key&lt;br /&gt;
## &#039;&#039;&#039;SSL CA certificates name&#039;&#039;&#039; to /path/to/certs/solr-ssl.cacert.pem&lt;br /&gt;
# Index your site&#039;s data going to &#039;&#039;Site administration &amp;gt; Reports &amp;gt; Global search info&#039;&#039; or from the CLI running &#039;&#039;&#039;php admin/tool/task/cli/schedule_task.php --execute=&amp;quot;\core\task\search_index_task&amp;quot;&#039;&#039;&#039; script, being the CLI script the recommended option for big sites.&lt;br /&gt;
# Enable Global search in &#039;&#039;Site administration &amp;gt; Advanced features&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
====File Indexing====&lt;br /&gt;
&lt;br /&gt;
Solr has the ability to index the contents of files, such as File resources and attachments to Forum posts. This uses the [https://tika.apache.org/ Tika] engine which comes bundled with Solr. To enable this feature:&lt;br /&gt;
# In &#039;&#039;Site administration &amp;gt; Plugins &amp;gt; Search &amp;gt; Solr&#039;&#039; enable the checkbox &#039;&#039;&#039;Enable file indexing&#039;&#039;&#039;&lt;br /&gt;
# Set &#039;&#039;&#039;Maximum file size to index (kB)&#039;&#039;&#039; to some value - the default is &#039;&#039;&#039;2097152&#039;&#039;&#039; (2GB)&lt;br /&gt;
#* Files larger than this limit will not be sent for Solr for indexing, but the file name will still be indexed.&lt;br /&gt;
&lt;br /&gt;
===How to install Solr===&lt;br /&gt;
&lt;br /&gt;
You need PHP Solr extension installed. You can download the official latest versions from [http://pecl.php.net/package/solr](http://pecl.php.net/package/solr) The minimum required version is PECL Solr 2.1 for PHP 5 branch and PECL Solr 2.4 for PHP 7 branch.&lt;br /&gt;
&lt;br /&gt;
Basic installation steps (using apache web server):&lt;br /&gt;
&lt;br /&gt;
==== Linux (Debian/Ubuntu) ====&lt;br /&gt;
&lt;br /&gt;
    sudo apt-get install libpcre3-dev libxml2-dev libcurl4-openssl-dev&lt;br /&gt;
    sudo apt-get install php5-dev&lt;br /&gt;
    sudo apt-get install php-pear&lt;br /&gt;
    sudo pecl install solr&lt;br /&gt;
    sudo service apache2 restart&lt;br /&gt;
    sudo sh -c &amp;quot;echo &#039;extension=solr.so&#039; &amp;gt; /etc/php5/apache2/conf.d/solr.ini&amp;quot;&lt;br /&gt;
    sudo sh -c &amp;quot;echo &#039;extension=solr.so&#039; &amp;gt; /etc/php5/cli/conf.d/solr.ini&amp;quot;&lt;br /&gt;
&lt;br /&gt;
==== OSX using macports ====&lt;br /&gt;
&lt;br /&gt;
    sudo port install apache-solr4&lt;br /&gt;
    sudo port install php54-solr&lt;br /&gt;
&lt;br /&gt;
==== OSX using homebrew ====&lt;br /&gt;
&lt;br /&gt;
    brew install homebrew/php/php56-solr&lt;br /&gt;
&lt;br /&gt;
==== Windows ====&lt;br /&gt;
&lt;br /&gt;
Install the pecl package as usual. (This has not yet been tested.)&lt;br /&gt;
&lt;br /&gt;
==== The Solr server ====&lt;br /&gt;
&lt;br /&gt;
Moodle 3.1 supports Solr server from 4.0 onwards, although you can only use the Solr schema setup script that we provide with Moodle from Solr 5. The latest Solr 5 available version is the recommended one; the same will apply to Solr 6 once it is released. &lt;br /&gt;
&lt;br /&gt;
The following example snippet (feel free to copy &amp;amp; paste into a .sh script with execution permissions) will download Solr 5.4.1 (replace it with latest 5.x) in the current directory, start the solr server and create an index in it named &#039;&#039;&#039;moodle&#039;&#039;&#039; to add moodle data to it.&lt;br /&gt;
&lt;br /&gt;
    #!/bin/bash&lt;br /&gt;
    set -e&lt;br /&gt;
    SOLRVERSION=5.4.1&lt;br /&gt;
    SOLRNAME=solr-$SOLRVERSION&lt;br /&gt;
    SOLRTAR=$SOLRNAME&#039;.tgz&#039;&lt;br /&gt;
    INDEXNAME=moodle&lt;br /&gt;
    if [ -d $SOLRNAME ]; then&lt;br /&gt;
        echo &amp;quot;Error: Directory $SOLRNAME already exists, remove it before starting the setup again.&amp;quot;&lt;br /&gt;
        exit 1&lt;br /&gt;
    fi&lt;br /&gt;
    if [ ! -f $SOLRTAR ]; then&lt;br /&gt;
        wget http://www-us.apache.org/dist/lucene/solr/$SOLRVERSION/$SOLRTAR&lt;br /&gt;
    fi&lt;br /&gt;
    tar -xvzf $SOLRTAR&lt;br /&gt;
    cd $SOLRNAME&lt;br /&gt;
    bin/solr start&lt;br /&gt;
    bin/solr create -c $INDEXNAME&lt;br /&gt;
    # After setting it up and creating the index use:&lt;br /&gt;
    # - &amp;quot;/yourdirectory/solrdir/bin/solr start&amp;quot; from CLI to start the server&lt;br /&gt;
    # - &amp;quot;/yourdirectory/solrdir/bin/solr stop&amp;quot; from CLI to stop the server.&lt;br /&gt;
&lt;br /&gt;
=====Solr 5/6 schema setup=====&lt;br /&gt;
&lt;br /&gt;
Moodle will use Solr&#039;s managed schema interface to install the required fields. You will be directed on what to do from the Manage global search page.&lt;br /&gt;
&lt;br /&gt;
For very large or busy sites, it is recommended that you manually remove the &#039;&#039;&#039;_text_&#039;&#039;&#039; field, and associated copy directive from, the default Solr schema. This field is not used by Moodle, and will significantly slow indexing, and increase the size of the resulting Solr core.&lt;br /&gt;
&lt;br /&gt;
=====Solr 4 schema setup=====&lt;br /&gt;
&lt;br /&gt;
You cannot  use the schema setup script when using a Solr 4 server. If you really want to use the Solr 4x branch, here are the field types descriptions:&lt;br /&gt;
&lt;br /&gt;
Extracted from search/classes/document.php&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;nicetable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Field name&lt;br /&gt;
! Field type&lt;br /&gt;
! Stored&lt;br /&gt;
! Indexed&lt;br /&gt;
! Query field&lt;br /&gt;
|-&lt;br /&gt;
| id&lt;br /&gt;
| org.apache.solr.schema.StrField&lt;br /&gt;
| true&lt;br /&gt;
| false&lt;br /&gt;
| false&lt;br /&gt;
|-&lt;br /&gt;
| itemid&lt;br /&gt;
| org.apache.solr.schema.TrieIntField&lt;br /&gt;
| true&lt;br /&gt;
| true&lt;br /&gt;
| false&lt;br /&gt;
|-&lt;br /&gt;
| title&lt;br /&gt;
| org.apache.solr.schema.TextField&lt;br /&gt;
| true&lt;br /&gt;
| true&lt;br /&gt;
| true&lt;br /&gt;
|-&lt;br /&gt;
| content&lt;br /&gt;
| org.apache.solr.schema.TextField&lt;br /&gt;
| true&lt;br /&gt;
| true&lt;br /&gt;
| true&lt;br /&gt;
|-&lt;br /&gt;
| contextid&lt;br /&gt;
| org.apache.solr.schema.TrieIntField&lt;br /&gt;
| true&lt;br /&gt;
| true&lt;br /&gt;
| false&lt;br /&gt;
|-&lt;br /&gt;
| areaid&lt;br /&gt;
| org.apache.solr.schema.StrField&lt;br /&gt;
| true&lt;br /&gt;
| true&lt;br /&gt;
| false&lt;br /&gt;
|-&lt;br /&gt;
| type&lt;br /&gt;
| org.apache.solr.schema.TrieIntField&lt;br /&gt;
| true&lt;br /&gt;
| true&lt;br /&gt;
| false&lt;br /&gt;
|-&lt;br /&gt;
| courseid&lt;br /&gt;
| org.apache.solr.schema.TrieIntField&lt;br /&gt;
| true&lt;br /&gt;
| true&lt;br /&gt;
| false&lt;br /&gt;
|-&lt;br /&gt;
| owneruserid&lt;br /&gt;
| org.apache.solr.schema.TrieIntField&lt;br /&gt;
| true&lt;br /&gt;
| true&lt;br /&gt;
| false&lt;br /&gt;
|-&lt;br /&gt;
| modified&lt;br /&gt;
| org.apache.solr.schema.TrieDateField&lt;br /&gt;
| true&lt;br /&gt;
| true&lt;br /&gt;
| false&lt;br /&gt;
|-&lt;br /&gt;
| userid&lt;br /&gt;
| org.apache.solr.schema.TrieIntField&lt;br /&gt;
| true&lt;br /&gt;
| true&lt;br /&gt;
| false&lt;br /&gt;
|-&lt;br /&gt;
| description1&lt;br /&gt;
| org.apache.solr.schema.TextField&lt;br /&gt;
| true&lt;br /&gt;
| true&lt;br /&gt;
| true&lt;br /&gt;
|-&lt;br /&gt;
| description2&lt;br /&gt;
| org.apache.solr.schema.TextField&lt;br /&gt;
| true&lt;br /&gt;
| true&lt;br /&gt;
| true&lt;br /&gt;
|-&lt;br /&gt;
| solr_filegroupingid&lt;br /&gt;
| org.apache.solr.schema.StrField&lt;br /&gt;
| true&lt;br /&gt;
| true&lt;br /&gt;
| false&lt;br /&gt;
|-&lt;br /&gt;
| solr_fileid&lt;br /&gt;
| org.apache.solr.schema.StrField&lt;br /&gt;
| true&lt;br /&gt;
| true&lt;br /&gt;
| false&lt;br /&gt;
|-&lt;br /&gt;
| solr_filecontenthash&lt;br /&gt;
| org.apache.solr.schema.StrField&lt;br /&gt;
| true&lt;br /&gt;
| true&lt;br /&gt;
| false&lt;br /&gt;
|-&lt;br /&gt;
| solr_fileindexstatus&lt;br /&gt;
| org.apache.solr.schema.TrieIntField&lt;br /&gt;
| true&lt;br /&gt;
| true&lt;br /&gt;
| false&lt;br /&gt;
|-&lt;br /&gt;
| solr_filecontent&lt;br /&gt;
| org.apache.solr.schema.TextField&lt;br /&gt;
| false&lt;br /&gt;
| true&lt;br /&gt;
| true&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=====Memory and File indexing considerations=====&lt;br /&gt;
&lt;br /&gt;
For large sites, and particularly if you are using the File indexing feature, you will want to give Solr plenty of memory, likely on the order of 10-20GB. To start Solr with more than its default 512MB of RAM, use the &#039;&#039;-m&#039;&#039; option: &lt;br /&gt;
 solr start -m 12g&lt;br /&gt;
&lt;br /&gt;
See the documents for your version of Solr on how to increases memory when Solr is started automatically.&lt;br /&gt;
&lt;br /&gt;
[[es:Búsqueda global]]&lt;/div&gt;</summary>
		<author><name>Emerrill</name></author>
	</entry>
	<entry>
		<id>https://docs.moodle.org/39/en/index.php?title=Global_search&amp;diff=123409</id>
		<title>Global search</title>
		<link rel="alternate" type="text/html" href="https://docs.moodle.org/39/en/index.php?title=Global_search&amp;diff=123409"/>
		<updated>2016-05-12T13:46:40Z</updated>

		<summary type="html">&lt;p&gt;Emerrill: /* How is it set up? */ Rearrange SSL config&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{New features}}&lt;br /&gt;
==What is Global search?==&lt;br /&gt;
*Global search lets you search everywhere on the Moodle site that you have access to. A student can search their courses for particular lecture notes, for example, or a teacher could search for subject-related activities.&lt;br /&gt;
*The feature needs to be enabled by the administrator and a search box is then available next to the user menu.&lt;br /&gt;
&lt;br /&gt;
[[File:NFGlobalsearchbox.png|thumb|center|480px|Searching the site (when global search is enabled)]]&lt;br /&gt;
&lt;br /&gt;
*A [[Global search block]] may also be added to course pages.&lt;br /&gt;
&lt;br /&gt;
==How does it work?==&lt;br /&gt;
*Click the search icon by the user menu and type a search term into the box that appears, or type into the box in the [[Global search block]] if enabled.&lt;br /&gt;
*On the next screen, you can simply click the search button to search everywhere, or expand the Filter to search in specific areas:&lt;br /&gt;
&lt;br /&gt;
[[File:NFFilteringGlobalSearch.png|thumb|center|600px|Filtering the search]]&lt;br /&gt;
&lt;br /&gt;
*You will then see results displayed from all areas of Moodle you have access to:&lt;br /&gt;
&lt;br /&gt;
[[File:31GSResults2.png|thumb|center|600px|Search results]]&lt;br /&gt;
&lt;br /&gt;
==How is it set up?==&lt;br /&gt;
&lt;br /&gt;
{{Note|Global search needs a search engine. Instructions for the installing the PHP Solr extension and a Solr server are below. See the [https://docs.moodle.org/dev/Search_engines Developer docs on Search engine plugins] if you wish to write your own.}}&lt;br /&gt;
&lt;br /&gt;
# Enable Global search in &#039;&#039;Site administration &amp;gt; Advanced features&#039;&#039;&lt;br /&gt;
# Set the feature up in &#039;&#039;Site administration &amp;gt; Plugins &amp;gt;Search &amp;gt; Manage global search&#039;&#039; by selecting Solr as the search engine and ticking search area checkboxes as required&lt;br /&gt;
# In &#039;&#039;Site administration &amp;gt; Plugins &amp;gt; Search &amp;gt; Solr&#039;&#039;, set &#039;&#039;&#039;Host name&#039;&#039;&#039; to localhost, &#039;&#039;&#039;Port&#039;&#039;&#039; to 8983 and &#039;&#039;&#039;Index name&#039;&#039;&#039; to &#039;moodle&#039; (the name of the index in Solr)&lt;br /&gt;
&lt;br /&gt;
If you are using Solr with SSL encryption, you will need to configure Moodle as such.&lt;br /&gt;
# You will need a separate key file and cacert file, both in pem format, located on your server Moodle, and readable by the PHP process.&lt;br /&gt;
# Go to &#039;&#039;Site administration &amp;gt; Plugins &amp;gt; Search &amp;gt; Solr&#039;&#039;&lt;br /&gt;
# Set &#039;&#039;&#039;Secure mode&#039;&#039;&#039; to Yes&lt;br /&gt;
# &#039;&#039;&#039;SSL certificate&#039;&#039;&#039; to /path/to/certs/solr-ssl.cacert.pem&lt;br /&gt;
# &#039;&#039;&#039;SSL key&#039;&#039;&#039; to /path/to/certs/solr-ssl.key.pem&lt;br /&gt;
# &#039;&#039;&#039;SSL key Password&#039;&#039;&#039; to The password used to lock the SSL Key&lt;br /&gt;
# &#039;&#039;&#039;SSL CA certificates name&#039;&#039;&#039; to /path/to/certs/solr-ssl.cacert.pem&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===How to install Solr===&lt;br /&gt;
&lt;br /&gt;
You need PHP Solr extension installed. You can download the official latest versions from [http://pecl.php.net/package/solr](http://pecl.php.net/package/solr) The minimum required version is PECL Solr 2.1 for PHP 5 branch and PECL Solr 2.4 for PHP 7 branch.&lt;br /&gt;
&lt;br /&gt;
Basic installation steps (using apache web server):&lt;br /&gt;
&lt;br /&gt;
==== Linux (Debian/Ubuntu) ====&lt;br /&gt;
&lt;br /&gt;
    sudo apt-get install libpcre3-dev libxml2-dev libcurl4-openssl-dev&lt;br /&gt;
    sudo apt-get install php5-dev&lt;br /&gt;
    sudo apt-get install php-pear&lt;br /&gt;
    sudo pecl install solr&lt;br /&gt;
    sudo service apache2 restart&lt;br /&gt;
    sudo sh -c &amp;quot;echo &#039;extension=solr.so&#039; &amp;gt; /etc/php5/apache2/conf.d/solr.ini&amp;quot;&lt;br /&gt;
    sudo sh -c &amp;quot;echo &#039;extension=solr.so&#039; &amp;gt; /etc/php5/cli/conf.d/solr.ini&amp;quot;&lt;br /&gt;
&lt;br /&gt;
==== OSX using macports ====&lt;br /&gt;
&lt;br /&gt;
    sudo port install apache-solr4&lt;br /&gt;
    sudo port install php54-solr&lt;br /&gt;
&lt;br /&gt;
==== OSX using homebrew ====&lt;br /&gt;
&lt;br /&gt;
    brew install homebrew/php/php56-solr&lt;br /&gt;
&lt;br /&gt;
==== Windows ====&lt;br /&gt;
&lt;br /&gt;
Install the pecl package as usual. (This has not yet been tested.)&lt;br /&gt;
&lt;br /&gt;
==== The Solr server ====&lt;br /&gt;
&lt;br /&gt;
Moodle 3.1 supports Solr server from 4.0 onwards, although you can only use the Solr schema setup script that we provide with Moodle from Solr 5. The latest Solr 5 available version is the recommended one; the same will apply to Solr 6 once it is released. &lt;br /&gt;
&lt;br /&gt;
The following example snippet (feel free to copy &amp;amp; paste into a .sh script with execution permissions) will download Solr 5.4.1 (replace it with latest 5.x) in the current directory, start the solr server and create an index in it named &#039;&#039;&#039;moodle&#039;&#039;&#039; to add moodle data to it.&lt;br /&gt;
&lt;br /&gt;
    #!/bin/bash&lt;br /&gt;
    set -e&lt;br /&gt;
    SOLRVERSION=5.4.1&lt;br /&gt;
    SOLRNAME=solr-$SOLRVERSION&lt;br /&gt;
    SOLRTAR=$SOLRNAME&#039;.tgz&#039;&lt;br /&gt;
    INDEXNAME=moodle&lt;br /&gt;
    if [ -d $SOLRNAME ]; then&lt;br /&gt;
        echo &amp;quot;Error: Directory $SOLRNAME already exists, remove it before starting the setup again.&amp;quot;&lt;br /&gt;
        exit 1&lt;br /&gt;
    fi&lt;br /&gt;
    if [ ! -f $SOLRTAR ]; then&lt;br /&gt;
        wget http://apache.mirror.digitalpacific.com.au/lucene/solr/$SOLRVERSION/$SOLRTAR&lt;br /&gt;
    fi&lt;br /&gt;
    tar -xvzf $SOLRTAR&lt;br /&gt;
    cd $SOLRNAME&lt;br /&gt;
    bin/solr start&lt;br /&gt;
    bin/solr create -c $INDEXNAME&lt;br /&gt;
    # After setting it up and creating the index use:&lt;br /&gt;
    # - &amp;quot;/yourdirectory/solrdir/bin/solr start&amp;quot; from CLI to start the server&lt;br /&gt;
    # - &amp;quot;/yourdirectory/solrdir/bin/solr stop&amp;quot; from CLI to stop the server.&lt;br /&gt;
&lt;br /&gt;
=====Solr 5/6 schema setup=====&lt;br /&gt;
&lt;br /&gt;
Moodle will use Solr&#039;s managed schema interface to install the required fields, you will be directed on what to do from the Manage global search page.&lt;br /&gt;
&lt;br /&gt;
For very large or busy sites, it is recommended that you manually remove the &#039;&#039;&#039;_text_&#039;&#039;&#039; field, and associated copy directive from, the default Solr schema. This field is not used by Moodle, and will significantly slow indexing, and increase the size of the resulting Solr core.&lt;br /&gt;
&lt;br /&gt;
=====Solr 4 schema setup=====&lt;br /&gt;
&lt;br /&gt;
You cannot  use the schema setup script when using a Solr 4 server. If you really want to use the Solr 4x branch, here are the field types descriptions:&lt;br /&gt;
&lt;br /&gt;
Extracted from search/classes/document.php&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;nicetable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Field name&lt;br /&gt;
! Field type&lt;br /&gt;
! Stored&lt;br /&gt;
! Indexed&lt;br /&gt;
! Query field&lt;br /&gt;
|-&lt;br /&gt;
| id&lt;br /&gt;
| org.apache.solr.schema.StrField&lt;br /&gt;
| true&lt;br /&gt;
| false&lt;br /&gt;
| false&lt;br /&gt;
|-&lt;br /&gt;
| itemid&lt;br /&gt;
| org.apache.solr.schema.TrieIntField&lt;br /&gt;
| true&lt;br /&gt;
| true&lt;br /&gt;
| false&lt;br /&gt;
|-&lt;br /&gt;
| title&lt;br /&gt;
| org.apache.solr.schema.TextField&lt;br /&gt;
| true&lt;br /&gt;
| true&lt;br /&gt;
| true&lt;br /&gt;
|-&lt;br /&gt;
| content&lt;br /&gt;
| org.apache.solr.schema.TextField&lt;br /&gt;
| true&lt;br /&gt;
| true&lt;br /&gt;
| true&lt;br /&gt;
|-&lt;br /&gt;
| contextid&lt;br /&gt;
| org.apache.solr.schema.TrieIntField&lt;br /&gt;
| true&lt;br /&gt;
| true&lt;br /&gt;
| false&lt;br /&gt;
|-&lt;br /&gt;
| areaid&lt;br /&gt;
| org.apache.solr.schema.StrField&lt;br /&gt;
| true&lt;br /&gt;
| true&lt;br /&gt;
| false&lt;br /&gt;
|-&lt;br /&gt;
| type&lt;br /&gt;
| org.apache.solr.schema.TrieIntField&lt;br /&gt;
| true&lt;br /&gt;
| true&lt;br /&gt;
| false&lt;br /&gt;
|-&lt;br /&gt;
| courseid&lt;br /&gt;
| org.apache.solr.schema.TrieIntField&lt;br /&gt;
| true&lt;br /&gt;
| true&lt;br /&gt;
| false&lt;br /&gt;
|-&lt;br /&gt;
| owneruserid&lt;br /&gt;
| org.apache.solr.schema.TrieIntField&lt;br /&gt;
| true&lt;br /&gt;
| true&lt;br /&gt;
| false&lt;br /&gt;
|-&lt;br /&gt;
| modified&lt;br /&gt;
| org.apache.solr.schema.TrieDateField&lt;br /&gt;
| true&lt;br /&gt;
| true&lt;br /&gt;
| false&lt;br /&gt;
|-&lt;br /&gt;
| userid&lt;br /&gt;
| org.apache.solr.schema.TrieIntField&lt;br /&gt;
| true&lt;br /&gt;
| true&lt;br /&gt;
| false&lt;br /&gt;
|-&lt;br /&gt;
| description1&lt;br /&gt;
| org.apache.solr.schema.TextField&lt;br /&gt;
| true&lt;br /&gt;
| true&lt;br /&gt;
| true&lt;br /&gt;
|-&lt;br /&gt;
| description2&lt;br /&gt;
| org.apache.solr.schema.TextField&lt;br /&gt;
| true&lt;br /&gt;
| true&lt;br /&gt;
| true&lt;br /&gt;
|-&lt;br /&gt;
| solr_filegroupingid&lt;br /&gt;
| org.apache.solr.schema.StrField&lt;br /&gt;
| true&lt;br /&gt;
| true&lt;br /&gt;
| false&lt;br /&gt;
|-&lt;br /&gt;
| solr_fileid&lt;br /&gt;
| org.apache.solr.schema.StrField&lt;br /&gt;
| true&lt;br /&gt;
| true&lt;br /&gt;
| false&lt;br /&gt;
|-&lt;br /&gt;
| solr_filecontenthash&lt;br /&gt;
| org.apache.solr.schema.StrField&lt;br /&gt;
| true&lt;br /&gt;
| true&lt;br /&gt;
| false&lt;br /&gt;
|-&lt;br /&gt;
| solr_fileindexstatus&lt;br /&gt;
| org.apache.solr.schema.TrieIntField&lt;br /&gt;
| true&lt;br /&gt;
| true&lt;br /&gt;
| false&lt;br /&gt;
|-&lt;br /&gt;
| solr_filecontent&lt;br /&gt;
| org.apache.solr.schema.TextField&lt;br /&gt;
| false&lt;br /&gt;
| true&lt;br /&gt;
| true&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[es:Búsqueda global]]&lt;/div&gt;</summary>
		<author><name>Emerrill</name></author>
	</entry>
	<entry>
		<id>https://docs.moodle.org/39/en/index.php?title=Global_search&amp;diff=123408</id>
		<title>Global search</title>
		<link rel="alternate" type="text/html" href="https://docs.moodle.org/39/en/index.php?title=Global_search&amp;diff=123408"/>
		<updated>2016-05-12T13:43:28Z</updated>

		<summary type="html">&lt;p&gt;Emerrill: Include infor about SSL and Solr 5/6 schema&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{New features}}&lt;br /&gt;
==What is Global search?==&lt;br /&gt;
*Global search lets you search everywhere on the Moodle site that you have access to. A student can search their courses for particular lecture notes, for example, or a teacher could search for subject-related activities.&lt;br /&gt;
*The feature needs to be enabled by the administrator and a search box is then available next to the user menu.&lt;br /&gt;
&lt;br /&gt;
[[File:NFGlobalsearchbox.png|thumb|center|480px|Searching the site (when global search is enabled)]]&lt;br /&gt;
&lt;br /&gt;
*A [[Global search block]] may also be added to course pages.&lt;br /&gt;
&lt;br /&gt;
==How does it work?==&lt;br /&gt;
*Click the search icon by the user menu and type a search term into the box that appears, or type into the box in the [[Global search block]] if enabled.&lt;br /&gt;
*On the next screen, you can simply click the search button to search everywhere, or expand the Filter to search in specific areas:&lt;br /&gt;
&lt;br /&gt;
[[File:NFFilteringGlobalSearch.png|thumb|center|600px|Filtering the search]]&lt;br /&gt;
&lt;br /&gt;
*You will then see results displayed from all areas of Moodle you have access to:&lt;br /&gt;
&lt;br /&gt;
[[File:31GSResults2.png|thumb|center|600px|Search results]]&lt;br /&gt;
&lt;br /&gt;
==How is it set up?==&lt;br /&gt;
&lt;br /&gt;
{{Note|Global search needs a search engine. Instructions for the installing the PHP Solr extension and a Solr server are below. See the [https://docs.moodle.org/dev/Search_engines Developer docs on Search engine plugins] if you wish to write your own.}}&lt;br /&gt;
&lt;br /&gt;
# Enable Global search in &#039;&#039;Site administration &amp;gt; Advanced features&#039;&#039;&lt;br /&gt;
# Set the feature up in &#039;&#039;Site administration &amp;gt; Plugins &amp;gt;Search &amp;gt; Manage global search&#039;&#039; by selecting Solr as the search engine and ticking search area checkboxes as required&lt;br /&gt;
# In &#039;&#039;Site administration &amp;gt; Plugins &amp;gt; Search &amp;gt; Solr&#039;&#039;, set &#039;&#039;&#039;Host name&#039;&#039;&#039; to localhost, &#039;&#039;&#039;Port&#039;&#039;&#039; to 8983 and &#039;&#039;&#039;Index name&#039;&#039;&#039; to &#039;moodle&#039; (the name of the index in Solr)&lt;br /&gt;
&lt;br /&gt;
If you are using Solr with SSL encryption, you will need to configure Moodle as such:&lt;br /&gt;
# You will need a separate key file and cacert file, both in pem format, located on your server Moodle, and readable by the PHP process.&lt;br /&gt;
# In the Moodle Solr config page:&lt;br /&gt;
## Enable Secure&lt;br /&gt;
## SSL certificate: /path/to/certs/solr-ssl.cacert.pem&lt;br /&gt;
## SSL key: /path/to/certs/solr-ssl.key.pem&lt;br /&gt;
## SSL key Password: The password used to lock the SSL Key&lt;br /&gt;
## SSL CA certificates name: /path/to/certs/solr-ssl.cacert.pem&lt;br /&gt;
# Save&lt;br /&gt;
# On the search management page it still indicates it can connect to Solr.&lt;br /&gt;
&lt;br /&gt;
===How to install Solr===&lt;br /&gt;
&lt;br /&gt;
You need PHP Solr extension installed. You can download the official latest versions from [http://pecl.php.net/package/solr](http://pecl.php.net/package/solr) The minimum required version is PECL Solr 2.1 for PHP 5 branch and PECL Solr 2.4 for PHP 7 branch.&lt;br /&gt;
&lt;br /&gt;
Basic installation steps (using apache web server):&lt;br /&gt;
&lt;br /&gt;
==== Linux (Debian/Ubuntu) ====&lt;br /&gt;
&lt;br /&gt;
    sudo apt-get install libpcre3-dev libxml2-dev libcurl4-openssl-dev&lt;br /&gt;
    sudo apt-get install php5-dev&lt;br /&gt;
    sudo apt-get install php-pear&lt;br /&gt;
    sudo pecl install solr&lt;br /&gt;
    sudo service apache2 restart&lt;br /&gt;
    sudo sh -c &amp;quot;echo &#039;extension=solr.so&#039; &amp;gt; /etc/php5/apache2/conf.d/solr.ini&amp;quot;&lt;br /&gt;
    sudo sh -c &amp;quot;echo &#039;extension=solr.so&#039; &amp;gt; /etc/php5/cli/conf.d/solr.ini&amp;quot;&lt;br /&gt;
&lt;br /&gt;
==== OSX using macports ====&lt;br /&gt;
&lt;br /&gt;
    sudo port install apache-solr4&lt;br /&gt;
    sudo port install php54-solr&lt;br /&gt;
&lt;br /&gt;
==== OSX using homebrew ====&lt;br /&gt;
&lt;br /&gt;
    brew install homebrew/php/php56-solr&lt;br /&gt;
&lt;br /&gt;
==== Windows ====&lt;br /&gt;
&lt;br /&gt;
Install the pecl package as usual. (This has not yet been tested.)&lt;br /&gt;
&lt;br /&gt;
==== The Solr server ====&lt;br /&gt;
&lt;br /&gt;
Moodle 3.1 supports Solr server from 4.0 onwards, although you can only use the Solr schema setup script that we provide with Moodle from Solr 5. The latest Solr 5 available version is the recommended one; the same will apply to Solr 6 once it is released. &lt;br /&gt;
&lt;br /&gt;
The following example snippet (feel free to copy &amp;amp; paste into a .sh script with execution permissions) will download Solr 5.4.1 (replace it with latest 5.x) in the current directory, start the solr server and create an index in it named &#039;&#039;&#039;moodle&#039;&#039;&#039; to add moodle data to it.&lt;br /&gt;
&lt;br /&gt;
    #!/bin/bash&lt;br /&gt;
    set -e&lt;br /&gt;
    SOLRVERSION=5.4.1&lt;br /&gt;
    SOLRNAME=solr-$SOLRVERSION&lt;br /&gt;
    SOLRTAR=$SOLRNAME&#039;.tgz&#039;&lt;br /&gt;
    INDEXNAME=moodle&lt;br /&gt;
    if [ -d $SOLRNAME ]; then&lt;br /&gt;
        echo &amp;quot;Error: Directory $SOLRNAME already exists, remove it before starting the setup again.&amp;quot;&lt;br /&gt;
        exit 1&lt;br /&gt;
    fi&lt;br /&gt;
    if [ ! -f $SOLRTAR ]; then&lt;br /&gt;
        wget http://apache.mirror.digitalpacific.com.au/lucene/solr/$SOLRVERSION/$SOLRTAR&lt;br /&gt;
    fi&lt;br /&gt;
    tar -xvzf $SOLRTAR&lt;br /&gt;
    cd $SOLRNAME&lt;br /&gt;
    bin/solr start&lt;br /&gt;
    bin/solr create -c $INDEXNAME&lt;br /&gt;
    # After setting it up and creating the index use:&lt;br /&gt;
    # - &amp;quot;/yourdirectory/solrdir/bin/solr start&amp;quot; from CLI to start the server&lt;br /&gt;
    # - &amp;quot;/yourdirectory/solrdir/bin/solr stop&amp;quot; from CLI to stop the server.&lt;br /&gt;
&lt;br /&gt;
=====Solr 5/6 schema setup=====&lt;br /&gt;
&lt;br /&gt;
Moodle will use Solr&#039;s managed schema interface to install the required fields, you will be directed on what to do from the Manage global search page.&lt;br /&gt;
&lt;br /&gt;
For very large or busy sites, it is recommended that you manually remove the &#039;&#039;&#039;_text_&#039;&#039;&#039; field, and associated copy directive from, the default Solr schema. This field is not used by Moodle, and will significantly slow indexing, and increase the size of the resulting Solr core.&lt;br /&gt;
&lt;br /&gt;
=====Solr 4 schema setup=====&lt;br /&gt;
&lt;br /&gt;
You cannot  use the schema setup script when using a Solr 4 server. If you really want to use the Solr 4x branch, here are the field types descriptions:&lt;br /&gt;
&lt;br /&gt;
Extracted from search/classes/document.php&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;nicetable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Field name&lt;br /&gt;
! Field type&lt;br /&gt;
! Stored&lt;br /&gt;
! Indexed&lt;br /&gt;
! Query field&lt;br /&gt;
|-&lt;br /&gt;
| id&lt;br /&gt;
| org.apache.solr.schema.StrField&lt;br /&gt;
| true&lt;br /&gt;
| false&lt;br /&gt;
| false&lt;br /&gt;
|-&lt;br /&gt;
| itemid&lt;br /&gt;
| org.apache.solr.schema.TrieIntField&lt;br /&gt;
| true&lt;br /&gt;
| true&lt;br /&gt;
| false&lt;br /&gt;
|-&lt;br /&gt;
| title&lt;br /&gt;
| org.apache.solr.schema.TextField&lt;br /&gt;
| true&lt;br /&gt;
| true&lt;br /&gt;
| true&lt;br /&gt;
|-&lt;br /&gt;
| content&lt;br /&gt;
| org.apache.solr.schema.TextField&lt;br /&gt;
| true&lt;br /&gt;
| true&lt;br /&gt;
| true&lt;br /&gt;
|-&lt;br /&gt;
| contextid&lt;br /&gt;
| org.apache.solr.schema.TrieIntField&lt;br /&gt;
| true&lt;br /&gt;
| true&lt;br /&gt;
| false&lt;br /&gt;
|-&lt;br /&gt;
| areaid&lt;br /&gt;
| org.apache.solr.schema.StrField&lt;br /&gt;
| true&lt;br /&gt;
| true&lt;br /&gt;
| false&lt;br /&gt;
|-&lt;br /&gt;
| type&lt;br /&gt;
| org.apache.solr.schema.TrieIntField&lt;br /&gt;
| true&lt;br /&gt;
| true&lt;br /&gt;
| false&lt;br /&gt;
|-&lt;br /&gt;
| courseid&lt;br /&gt;
| org.apache.solr.schema.TrieIntField&lt;br /&gt;
| true&lt;br /&gt;
| true&lt;br /&gt;
| false&lt;br /&gt;
|-&lt;br /&gt;
| owneruserid&lt;br /&gt;
| org.apache.solr.schema.TrieIntField&lt;br /&gt;
| true&lt;br /&gt;
| true&lt;br /&gt;
| false&lt;br /&gt;
|-&lt;br /&gt;
| modified&lt;br /&gt;
| org.apache.solr.schema.TrieDateField&lt;br /&gt;
| true&lt;br /&gt;
| true&lt;br /&gt;
| false&lt;br /&gt;
|-&lt;br /&gt;
| userid&lt;br /&gt;
| org.apache.solr.schema.TrieIntField&lt;br /&gt;
| true&lt;br /&gt;
| true&lt;br /&gt;
| false&lt;br /&gt;
|-&lt;br /&gt;
| description1&lt;br /&gt;
| org.apache.solr.schema.TextField&lt;br /&gt;
| true&lt;br /&gt;
| true&lt;br /&gt;
| true&lt;br /&gt;
|-&lt;br /&gt;
| description2&lt;br /&gt;
| org.apache.solr.schema.TextField&lt;br /&gt;
| true&lt;br /&gt;
| true&lt;br /&gt;
| true&lt;br /&gt;
|-&lt;br /&gt;
| solr_filegroupingid&lt;br /&gt;
| org.apache.solr.schema.StrField&lt;br /&gt;
| true&lt;br /&gt;
| true&lt;br /&gt;
| false&lt;br /&gt;
|-&lt;br /&gt;
| solr_fileid&lt;br /&gt;
| org.apache.solr.schema.StrField&lt;br /&gt;
| true&lt;br /&gt;
| true&lt;br /&gt;
| false&lt;br /&gt;
|-&lt;br /&gt;
| solr_filecontenthash&lt;br /&gt;
| org.apache.solr.schema.StrField&lt;br /&gt;
| true&lt;br /&gt;
| true&lt;br /&gt;
| false&lt;br /&gt;
|-&lt;br /&gt;
| solr_fileindexstatus&lt;br /&gt;
| org.apache.solr.schema.TrieIntField&lt;br /&gt;
| true&lt;br /&gt;
| true&lt;br /&gt;
| false&lt;br /&gt;
|-&lt;br /&gt;
| solr_filecontent&lt;br /&gt;
| org.apache.solr.schema.TextField&lt;br /&gt;
| false&lt;br /&gt;
| true&lt;br /&gt;
| true&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[es:Búsqueda global]]&lt;/div&gt;</summary>
		<author><name>Emerrill</name></author>
	</entry>
	<entry>
		<id>https://docs.moodle.org/39/en/index.php?title=Badges_FAQ&amp;diff=115090</id>
		<title>Badges FAQ</title>
		<link rel="alternate" type="text/html" href="https://docs.moodle.org/39/en/index.php?title=Badges_FAQ&amp;diff=115090"/>
		<updated>2014-09-29T16:26:19Z</updated>

		<summary type="html">&lt;p&gt;Emerrill: /* What size is a badge? */ Clarify image size&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Badges}}&lt;br /&gt;
==How can teachers award site badges?==&lt;br /&gt;
By default, teachers can only award course badges. Only users with capabilities to manage badges in the system are able to do this, so if you wish teachers to award site badges you need to create a new, global role.&lt;br /&gt;
#Go to &#039;&#039;Administration &amp;gt; Site administration &amp;gt; Users &amp;gt; Permissions &amp;gt; Define roles&#039;&#039; and add a new role called for example &amp;quot;Site badge awarder&amp;quot;&lt;br /&gt;
#Add it to the &amp;quot;System&amp;quot; context&lt;br /&gt;
#Set the following capabilities to &amp;quot;allow&amp;quot;: moodle/badges:awardbadge, moodle/badges:viewbadges, moodle/badges:configurecriteria&lt;br /&gt;
#Assign this role to the teachers you wish to award site badges.&lt;br /&gt;
&lt;br /&gt;
The teacher with the role &amp;quot;Site badge awarder&amp;quot; will see a link to Badges in the Administration block.&lt;br /&gt;
&lt;br /&gt;
==Can more than one teacher in a course award the same  badge?==&lt;br /&gt;
&#039;&#039;(copied from MDL-39189&#039;&#039;) It&#039;s not the user who issues the badge, but a role. Users with multiple roles will have an option to use both of them to issue badges. If the badge is awarded twice by different roles, both roles are displayed and criteria (ALL/ANY) is given. In some cases it will be required for a badge to be awarded by several different roles. When there are, let&#039;s say, three teachers in the course and they go to award a badge as a teacher, each of them will see the list of users who already got the badge from a teacher, so they won&#039;t need to award the badge again.&lt;br /&gt;
==What&#039;s the difference between a backpack and a collection?==&lt;br /&gt;
When you upload a badge to the [http://backpack.openbadges.org/ Openbadges site] you are adding it to your backpack, which is the general area you put your badges in. (Like a backpack!) You then organise them into collections (like separate little bags in your backpack) and you choose which to display on your Moodle profile. So a badge may be in your backpack and not in a collection, but it must be in your backpack before it can be in a collection. (Note the &#039;public&#039; box must be ticked too.) Collections allow you to control which badges you share with people.&lt;br /&gt;
{|&lt;br /&gt;
|[[File:mozillabackpack.png|thumb|A users&#039;s online backpack]]&lt;br /&gt;
|[[File:collections.png|thumb|Drag badges into a new collection to display on Moodle]]&lt;br /&gt;
|}&lt;br /&gt;
==What size is a badge?==&lt;br /&gt;
&lt;br /&gt;
A badge is displayed with dimensions 100 X 100 pixels. However, a larger image may be uploaded, which will then be cropped to be a square, and then resized.&lt;br /&gt;
&lt;br /&gt;
See also [https://moodle.org/mod/forum/discuss.php?d=230591 Badge image size] discussion.&lt;br /&gt;
&lt;br /&gt;
==Can I award a badge based on a specific grade?==&lt;br /&gt;
&lt;br /&gt;
There are two ways of awarding a badge based on a specific grade.&lt;br /&gt;
&lt;br /&gt;
Method 1:&lt;br /&gt;
&lt;br /&gt;
Set a passing grade for the quiz or assignment in the gradebook, as explained in section 1.3 of [[Activity completion settings]].&lt;br /&gt;
&lt;br /&gt;
Method 2:&lt;br /&gt;
&lt;br /&gt;
# Create a page resource and set the restrict access conditions so that it only appears if the user obtains a certain grade in the quiz or assignment&lt;br /&gt;
# Set the activity completion for the page as &amp;quot;view&amp;quot;&lt;br /&gt;
# Set the badge criteria such that the page has to be completed (i.e. viewed) &lt;br /&gt;
&lt;br /&gt;
==Do I have to use my Moodle email for my backpack?==&lt;br /&gt;
No, but you have to log in via your Persona account to authenticate via your backpack, in order to ensure you are only displaying badges belonging to you.&lt;br /&gt;
&lt;br /&gt;
==Which roles can see which badges?==&lt;br /&gt;
See this [https://moodle.org/mod/forum/discuss.php?d=234155&amp;amp;parent=1017187#p1017363 forum post on viewing badges]&lt;br /&gt;
&lt;br /&gt;
==Can I change a badge images once awarded?==&lt;br /&gt;
The short answer is &#039;no&#039;, but see this forum post on [https://moodle.org/mod/forum/discuss.php?d=228553 changing badge images] for more information.&lt;br /&gt;
&lt;br /&gt;
==Can I revoke a badge once it has been awarded?==&lt;br /&gt;
See the section on deleting badges in [[Managing badges]]&lt;br /&gt;
&lt;br /&gt;
==See also==&lt;br /&gt;
&lt;br /&gt;
* Moodle in English [https://moodle.org/mod/forum/view.php?id=8085 Badges forum]&lt;br /&gt;
* [http://www.somerandomthoughts.com/blog/2013/05/06/open-badges-and-moodle/ Open Badges and Moodle] blog post from Gavin Henrick&lt;br /&gt;
* [http://badg.us/en-US/ badg.us] - a service for creating and issuing badges&lt;br /&gt;
* [https://p2pu.org/en/groups/how-do-i-make-a-badge/ P2PU Badge Maker] - a step by step guide on how to make a badge &lt;br /&gt;
* [https://www.openbadges.me/ OpenBadges.me] - An open-access image creator from MyKnowledgeMap to support all of your Open Badge building needs.&lt;br /&gt;
* [http://moodlebadges.com/ Badges For Your Moodle] - CC-licensed badges available for free download&lt;br /&gt;
&lt;br /&gt;
Forum discussions:&lt;br /&gt;
* [https://moodle.org/mod/forum/discuss.php?d=252377 Badges Backup Requires &amp;quot;Include Enrolled Users&amp;quot;?]&lt;br /&gt;
&lt;br /&gt;
[[Category:FAQ]]&lt;br /&gt;
&lt;br /&gt;
[[es:Insignias FAQ]]&lt;br /&gt;
[[ja:バッジFAQ]]&lt;/div&gt;</summary>
		<author><name>Emerrill</name></author>
	</entry>
	<entry>
		<id>https://docs.moodle.org/39/en/index.php?title=Session_handling&amp;diff=114322</id>
		<title>Session handling</title>
		<link rel="alternate" type="text/html" href="https://docs.moodle.org/39/en/index.php?title=Session_handling&amp;diff=114322"/>
		<updated>2014-08-26T19:04:32Z</updated>

		<summary type="html">&lt;p&gt;Emerrill: Update memcached version to reflect true versions.&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Server settings}}&lt;br /&gt;
An administrator can change the following settings in &#039;&#039;Administration &amp;gt; Site administration &amp;gt; Server &amp;gt; Session Handling&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
Once someone logs in to your Moodle server, the server starts a session. The session data allows the server to track users as they access different pages.&lt;br /&gt;
&lt;br /&gt;
==Use database for session information==&lt;br /&gt;
&lt;br /&gt;
Moodle needs to store the session data in some storage. By default either file or database session storage is selected, this option allows admin to change it. Large installation should use memcached driver described below.&lt;br /&gt;
&lt;br /&gt;
Note that this option disappears after setting the $CFG-&amp;gt;session_handler_class in config.php file.&lt;br /&gt;
&lt;br /&gt;
==Timeout==&lt;br /&gt;
&lt;br /&gt;
If users don&#039;t load a new page during the amount of time set here, Moodle will end their session and log them out.&lt;br /&gt;
&lt;br /&gt;
Be sure this time frame is long enough to cover the longest test your teachers may offer. If a student is logged out while they are taking a test, their responses to the test questions may be lost.&lt;br /&gt;
&lt;br /&gt;
==Cookie prefix==&lt;br /&gt;
&lt;br /&gt;
Most of the time, you can leave this blank, unless you are running more than one Moodle site on the same server. In this case, you will want to customize the name of the cookie each Moodle site uses to track the session. This enables you to be logged into more than one Moodle site at the same time.&lt;br /&gt;
&lt;br /&gt;
Note: If you change &amp;quot;Cookie prefix&amp;quot; or &amp;quot;Cookie path&amp;quot; you will need to login again as the changes take effect immediately.&lt;br /&gt;
&lt;br /&gt;
==Cookie path==&lt;br /&gt;
&lt;br /&gt;
The relative path to this Moodle installation, this may be used to force sending of Moodle session cookie to parent directories. Invalid values are ignored automatically.&lt;br /&gt;
&lt;br /&gt;
==Cookie domain==&lt;br /&gt;
&lt;br /&gt;
This can be used to send session cookies to higher domains instead of just the server domain. This may be useful for some SSO solutions. Invalid values are ignored automatically.&lt;br /&gt;
&lt;br /&gt;
==Session drivers==&lt;br /&gt;
User sessions may be stored in different backends. Session drivers can be configured only in config.php file - see examples in config-dist.php file.&lt;br /&gt;
&lt;br /&gt;
===Memcached===&lt;br /&gt;
Memcached session driver is the fastest driver, it requires external memcached server and memcached PHP extension. Server cluster nodes must use shared session storage.&lt;br /&gt;
&lt;br /&gt;
Configuration options in config.php:&lt;br /&gt;
&amp;lt;code php&amp;gt;&lt;br /&gt;
$CFG-&amp;gt;session_handler_class = &#039;\core\session\memcached&#039;;&lt;br /&gt;
$CFG-&amp;gt;session_memcached_save_path = &#039;127.0.0.1:11211&#039;;&lt;br /&gt;
$CFG-&amp;gt;session_memcached_prefix = &#039;memc.sess.key.&#039;;&lt;br /&gt;
$CFG-&amp;gt;session_memcached_acquire_lock_timeout = 120;&lt;br /&gt;
$CFG-&amp;gt;session_memcached_lock_expire = 7200;       // Ignored if memcached extension &amp;lt;= 2.1.0&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Notes:&lt;br /&gt;
* Make sure the memcached server has enough memory.&lt;br /&gt;
* Use different prefix when storing sessions from multiple Moodles in one server.&lt;br /&gt;
* If PECL memcached extension version installed is less that 2.2.0, the locking works differently from other drivers - the lock is expired/released at the end of timeout - see MDL-42485.&lt;br /&gt;
* Don&#039;t use the same memcached server for both sessions and MUC. Events triggering MUC caches to be purged leads to MUC purging the memcached server.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
For windows users, PHP.net only supplies binaries for memcache, (and not memcached). (http://windows.php.net/downloads/pecl/releases/)&lt;br /&gt;
&lt;br /&gt;
(As of 2.7, two different contribs exist for memcache session handling - see MDL-42011 - it seems the OU one doesn&#039;t use prefix/lock_expire for some reason... possibly better to use the catalyst patch, where the only difference to the above config.php is the spelling of memcache(d))&lt;br /&gt;
&lt;br /&gt;
===Files===&lt;br /&gt;
This driver is used by default in new installation.&lt;br /&gt;
&lt;br /&gt;
Configuration options in config.php:&lt;br /&gt;
&amp;lt;code php&amp;gt;&lt;br /&gt;
$CFG-&amp;gt;session_handler_class = &#039;\core\session\file&#039;;&lt;br /&gt;
$CFG-&amp;gt;session_file_save_path = $CFG-&amp;gt;dataroot.&#039;/sessions&#039;;&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Notes:&lt;br /&gt;
* File based sessions require file system that supports file locking.&lt;br /&gt;
&lt;br /&gt;
===Database===&lt;br /&gt;
This type of driver was used by default in Moodle 2.0-2.5&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code php&amp;gt;&lt;br /&gt;
$CFG-&amp;gt;session_handler_class = &#039;\core\session\database&#039;;&lt;br /&gt;
$CFG-&amp;gt;session_database_acquire_lock_timeout = 120;&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Notes:&lt;br /&gt;
* DB sessions are not compatible with MyISAM database engine.&lt;br /&gt;
* If you are using MySQL/MariaDB make sure that \&#039;max_allowed_packet\&#039; in my.cnf (or my.ini) is at least 4M.&lt;br /&gt;
* The performance is relatively low, it is not recommended for large sites.&lt;br /&gt;
&lt;br /&gt;
==See also==&lt;br /&gt;
&lt;br /&gt;
*[[Sessions FAQ]]&lt;br /&gt;
&lt;br /&gt;
[[cs:admin/setting/sessionhandling]]&lt;br /&gt;
[[ja:セッションハンドリング]]&lt;br /&gt;
[[de:Sitzungsinformationen]]&lt;/div&gt;</summary>
		<author><name>Emerrill</name></author>
	</entry>
	<entry>
		<id>https://docs.moodle.org/39/en/index.php?title=Capabilities/moodle/course:reviewotherusers&amp;diff=112194</id>
		<title>Capabilities/moodle/course:reviewotherusers</title>
		<link rel="alternate" type="text/html" href="https://docs.moodle.org/39/en/index.php?title=Capabilities/moodle/course:reviewotherusers&amp;diff=112194"/>
		<updated>2014-04-29T16:40:15Z</updated>

		<summary type="html">&lt;p&gt;Emerrill: Create page for new capability&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Capabilities}}&lt;br /&gt;
*This allows a user to view the Other users page in a course, independent of their ability to assign roles.&lt;br /&gt;
*This capability is allowed for the default roles of manager and teacher&lt;br /&gt;
&lt;br /&gt;
[[Category:Capabilities|Backup]]&lt;br /&gt;
[[Category:Backup]]&lt;br /&gt;
&lt;br /&gt;
[[fr:Capabilities/moodle/backup:userinfo]]&lt;br /&gt;
[[de:Capabilities/moodle/backup:userinfo]]&lt;br /&gt;
[[es:Capabilities/moodle/backup:userinfo]]&lt;/div&gt;</summary>
		<author><name>Emerrill</name></author>
	</entry>
	<entry>
		<id>https://docs.moodle.org/39/en/index.php?title=Mobile_app_Push_Notifications&amp;diff=110670</id>
		<title>Mobile app Push Notifications</title>
		<link rel="alternate" type="text/html" href="https://docs.moodle.org/39/en/index.php?title=Mobile_app_Push_Notifications&amp;diff=110670"/>
		<updated>2014-03-04T16:37:48Z</updated>

		<summary type="html">&lt;p&gt;Emerrill: Fix capitalization of app&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Starting version 1.4 Moodle Mobile support Push Notifications initially only for iOS devices (iPhone, iPad, iPod)&lt;br /&gt;
&lt;br /&gt;
1.  Install [https://moodle.org/plugins/view.php?plugin=message_airnotifier this plugin] in 2.6* (or simply enable it in 2.7)  &lt;br /&gt;
&lt;br /&gt;
2.  Connect it to a mesaging server, you can use ours in case your Moodle site is registered. Go to Site administration /Plugins /Message outputs /Mobile Notifications and click in Request access key&lt;br /&gt;
&lt;br /&gt;
3.  Users need to connect at least once with the latest version of the app to register their phones with your site.   &lt;br /&gt;
&lt;br /&gt;
4)  Users can configure notificiations in the Moodle messaging preferences (Administration / My profile settings / Messaging)&lt;br /&gt;
&lt;br /&gt;
* Only for Moodle 2.6: If you upgrade your Moodle installation, you will have to reinstall the plugin since it add a couple of functions to the core Moodle Mobile service. See https://tracker.moodle.org/browse/MDLSITE-2815?focusedCommentId=273741&amp;amp;page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#comment-273741 for more information&lt;br /&gt;
&lt;br /&gt;
== Installing your own Notifications infrastructure ==&lt;br /&gt;
&lt;br /&gt;
If you have a customized version of the Mobile app, or you want to use your own Notifications infrastructure then you have to install a private Airnotifier (backend server for notifciations)&lt;br /&gt;
&lt;br /&gt;
https://github.com/dongsheng/airnotifier&lt;br /&gt;
&lt;br /&gt;
You have to add your app certificates there, see https://github.com/dongsheng/airnotifier/wiki/Installation&lt;br /&gt;
&lt;br /&gt;
The message Airnotifier plugin allow you to point to your custom airnotifier instance using your own access keys&lt;br /&gt;
&lt;br /&gt;
== See also ==&lt;br /&gt;
&lt;br /&gt;
https://github.com/jleyva/moodle-message_airnotifier&lt;br /&gt;
[[Category: Mobile]]&lt;/div&gt;</summary>
		<author><name>Emerrill</name></author>
	</entry>
	<entry>
		<id>https://docs.moodle.org/39/en/index.php?title=Legacy_course_files&amp;diff=107143</id>
		<title>Legacy course files</title>
		<link rel="alternate" type="text/html" href="https://docs.moodle.org/39/en/index.php?title=Legacy_course_files&amp;diff=107143"/>
		<updated>2013-10-22T20:02:40Z</updated>

		<summary type="html">&lt;p&gt;Emerrill: /* Is there a way to prevent new additions to legacy files? */ Fix typo&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Repositories}}&lt;br /&gt;
&amp;lt;p class=&amp;quot;note&amp;quot;&amp;gt;Note: This page only applies to sites which have been upgraded from Moodle 1.9.&amp;lt;/p&amp;gt;&lt;br /&gt;
In Moodle 2.0 onwards, files are stored in separate areas, rather than together in the course files area. See [[Course files]] for a detailed explanation. When a site is upgraded from 1.9, the course files area is renamed &#039;Legacy course files&#039;. By default, this area is not available in new courses.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;It is recommended that teachers make use of the new [[Repositories|repositories]] in Moodle 2.0 for storing course files, rather than saving them in the legacy course files area&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
==Enabling legacy course files areas==&lt;br /&gt;
&lt;br /&gt;
To enable a legacy course files area in a new course&lt;br /&gt;
&lt;br /&gt;
# Enable the legacy course files repository plugin in &#039;&#039;Settings &amp;gt; Site administration &amp;gt; Plugins &amp;gt; Repositories &amp;gt; [[Manage repositories]]&#039;&#039;.&lt;br /&gt;
# Check the legacyfilesinnewcourses box in the Manage repositories common settings then click the &#039;Save changes&#039; button.&lt;br /&gt;
# Set &#039;Legacy course files&#039; to Yes in the course settings.&lt;br /&gt;
&lt;br /&gt;
A legacy course files link will then appear in the &#039;&#039;Settings &amp;gt; Course administration&#039;&#039; area.&lt;br /&gt;
&lt;br /&gt;
==Repository capabilities==&lt;br /&gt;
&lt;br /&gt;
The capabilities [[Capabilities/repository/coursefiles:view|Use course files repository plugin]] and [[Capabilities/moodle/course:managefiles|Manage files]] are both required for users to access the legacy course files area.&lt;br /&gt;
&lt;br /&gt;
==FAQs==&lt;br /&gt;
===Can you find out disk volume of legacy files?===&lt;br /&gt;
No.  You will need a custom report of some kind.  See http://moodle.org/mod/forum/discuss.php?d=201601&lt;br /&gt;
&lt;br /&gt;
===Where are legacy files stored?===&lt;br /&gt;
For one explanation, see http://moodle.org/mod/forum/discuss.php?d=164544&lt;br /&gt;
&lt;br /&gt;
===Is there a way to delete legacy files en mass?===&lt;br /&gt;
Not at the moment.  Tracker item: http://tracker.moodle.org/browse/MDL-36008 and discussion: https://moodle.org/mod/forum/discuss.php?d=209353&lt;br /&gt;
&lt;br /&gt;
See also a comment here: https://moodle.org/mod/forum/discuss.php?d=234922#p1020379&lt;br /&gt;
&lt;br /&gt;
===Is there a way to prevent new additions to legacy files?===&lt;br /&gt;
{{New features}}&lt;br /&gt;
Yes. Unchecking [[Managing_repositories#Allow adding to legacy course files|Allow adding to legacy course files]] in &#039;&#039;Site Administration &amp;gt; Plugins &amp;gt; Repositories &amp;gt; Common repository settings&#039;&#039; will prevent users from adding new files and directories to legacy course files, but they will still be able to delete files.&lt;br /&gt;
&lt;br /&gt;
===What happens if you switch legacy files off in a site that has been upgraded and has a lot of legacy files?===&lt;br /&gt;
Unsure.&lt;br /&gt;
&lt;br /&gt;
===Can you migrate a course from 1.9 to 2+ and NOT end up with a legacy files repository?===&lt;br /&gt;
Yes, you can. If you restore as a Teacher into the course you&#039;re currently present in (best if it&#039;s empty) and don&#039;t override any settings then the Legacy Files will not be added as a Repository.&lt;br /&gt;
&lt;br /&gt;
===What happens to the Legacy files in a course imported from 1.9 to 2.x that is re-imported into another 2.x?===&lt;br /&gt;
&lt;br /&gt;
===In backups, are legacy files included with a course?===&lt;br /&gt;
Seems to be the case: http://moodle.org/mod/forum/discuss.php?d=194981&lt;br /&gt;
&lt;br /&gt;
===Long term, will there be any problem keeping a large number of Legacy files?===&lt;br /&gt;
Possibly if you want to import (as opposed to restore) you may lose legacy files.  See &lt;br /&gt;
*http://tracker.moodle.org/browse/MDL-25631&lt;br /&gt;
*http://tracker.moodle.org/browse/MDL-32598&lt;br /&gt;
&lt;br /&gt;
===What happens if legacy files were previously enabled and then the legacy course files repository is disabled?===&lt;br /&gt;
&lt;br /&gt;
Legacy course files are displayed if they have ever been enabled on the course, but can be disabled at the course level in the course settings. Any new courses created will not have a legacy course files area.&lt;br /&gt;
&lt;br /&gt;
==Also see==&lt;br /&gt;
*http://moodle.org/mod/forum/discuss.php?d=172559&lt;br /&gt;
*http://moodle.org/mod/forum/discuss.php?d=197746&lt;br /&gt;
*&lt;br /&gt;
&lt;br /&gt;
[[ja: レガシーコースファイル]]&lt;br /&gt;
[[de:Legacy-Kursdateien]]&lt;/div&gt;</summary>
		<author><name>Emerrill</name></author>
	</entry>
	<entry>
		<id>https://docs.moodle.org/39/en/index.php?title=Legacy_course_files&amp;diff=107142</id>
		<title>Legacy course files</title>
		<link rel="alternate" type="text/html" href="https://docs.moodle.org/39/en/index.php?title=Legacy_course_files&amp;diff=107142"/>
		<updated>2013-10-22T18:14:39Z</updated>

		<summary type="html">&lt;p&gt;Emerrill: /* FAQs */ MDL-41940 New FAQ item for preventing addition of legacy files&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Repositories}}&lt;br /&gt;
&amp;lt;p class=&amp;quot;note&amp;quot;&amp;gt;Note: This page only applies to sites which have been upgraded from Moodle 1.9.&amp;lt;/p&amp;gt;&lt;br /&gt;
In Moodle 2.0 onwards, files are stored in separate areas, rather than together in the course files area. See [[Course files]] for a detailed explanation. When a site is upgraded from 1.9, the course files area is renamed &#039;Legacy course files&#039;. By default, this area is not available in new courses.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;It is recommended that teachers make use of the new [[Repositories|repositories]] in Moodle 2.0 for storing course files, rather than saving them in the legacy course files area&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
==Enabling legacy course files areas==&lt;br /&gt;
&lt;br /&gt;
To enable a legacy course files area in a new course&lt;br /&gt;
&lt;br /&gt;
# Enable the legacy course files repository plugin in &#039;&#039;Settings &amp;gt; Site administration &amp;gt; Plugins &amp;gt; Repositories &amp;gt; [[Manage repositories]]&#039;&#039;.&lt;br /&gt;
# Check the legacyfilesinnewcourses box in the Manage repositories common settings then click the &#039;Save changes&#039; button.&lt;br /&gt;
# Set &#039;Legacy course files&#039; to Yes in the course settings.&lt;br /&gt;
&lt;br /&gt;
A legacy course files link will then appear in the &#039;&#039;Settings &amp;gt; Course administration&#039;&#039; area.&lt;br /&gt;
&lt;br /&gt;
==Repository capabilities==&lt;br /&gt;
&lt;br /&gt;
The capabilities [[Capabilities/repository/coursefiles:view|Use course files repository plugin]] and [[Capabilities/moodle/course:managefiles|Manage files]] are both required for users to access the legacy course files area.&lt;br /&gt;
&lt;br /&gt;
==FAQs==&lt;br /&gt;
===Can you find out disk volume of legacy files?===&lt;br /&gt;
No.  You will need a custom report of some kind.  See http://moodle.org/mod/forum/discuss.php?d=201601&lt;br /&gt;
&lt;br /&gt;
===Where are legacy files stored?===&lt;br /&gt;
For one explanation, see http://moodle.org/mod/forum/discuss.php?d=164544&lt;br /&gt;
&lt;br /&gt;
===Is there a way to delete legacy files en mass?===&lt;br /&gt;
Not at the moment.  Tracker item: http://tracker.moodle.org/browse/MDL-36008 and discussion: https://moodle.org/mod/forum/discuss.php?d=209353&lt;br /&gt;
&lt;br /&gt;
See also a comment here: https://moodle.org/mod/forum/discuss.php?d=234922#p1020379&lt;br /&gt;
&lt;br /&gt;
===Is there a way to prevent new additions to legacy files?===&lt;br /&gt;
{{New features}}&lt;br /&gt;
Yes. Unchecking [Managing_repositories#Allow adding to legacy course files|Allow adding to legacy course files] in &#039;&#039;Site Administration &amp;gt; Plugins &amp;gt; Repositories &amp;gt; Common repository settings&#039;&#039; will prevent users from adding new files and directories to legacy course files, but they will still be able to delete files.&lt;br /&gt;
&lt;br /&gt;
===What happens if you switch legacy files off in a site that has been upgraded and has a lot of legacy files?===&lt;br /&gt;
Unsure.&lt;br /&gt;
&lt;br /&gt;
===Can you migrate a course from 1.9 to 2+ and NOT end up with a legacy files repository?===&lt;br /&gt;
Yes, you can. If you restore as a Teacher into the course you&#039;re currently present in (best if it&#039;s empty) and don&#039;t override any settings then the Legacy Files will not be added as a Repository.&lt;br /&gt;
&lt;br /&gt;
===What happens to the Legacy files in a course imported from 1.9 to 2.x that is re-imported into another 2.x?===&lt;br /&gt;
&lt;br /&gt;
===In backups, are legacy files included with a course?===&lt;br /&gt;
Seems to be the case: http://moodle.org/mod/forum/discuss.php?d=194981&lt;br /&gt;
&lt;br /&gt;
===Long term, will there be any problem keeping a large number of Legacy files?===&lt;br /&gt;
Possibly if you want to import (as opposed to restore) you may lose legacy files.  See &lt;br /&gt;
*http://tracker.moodle.org/browse/MDL-25631&lt;br /&gt;
*http://tracker.moodle.org/browse/MDL-32598&lt;br /&gt;
&lt;br /&gt;
===What happens if legacy files were previously enabled and then the legacy course files repository is disabled?===&lt;br /&gt;
&lt;br /&gt;
Legacy course files are displayed if they have ever been enabled on the course, but can be disabled at the course level in the course settings. Any new courses created will not have a legacy course files area.&lt;br /&gt;
&lt;br /&gt;
==Also see==&lt;br /&gt;
*http://moodle.org/mod/forum/discuss.php?d=172559&lt;br /&gt;
*http://moodle.org/mod/forum/discuss.php?d=197746&lt;br /&gt;
*&lt;br /&gt;
&lt;br /&gt;
[[ja: レガシーコースファイル]]&lt;br /&gt;
[[de:Legacy-Kursdateien]]&lt;/div&gt;</summary>
		<author><name>Emerrill</name></author>
	</entry>
	<entry>
		<id>https://docs.moodle.org/39/en/index.php?title=Managing_repositories&amp;diff=107141</id>
		<title>Managing repositories</title>
		<link rel="alternate" type="text/html" href="https://docs.moodle.org/39/en/index.php?title=Managing_repositories&amp;diff=107141"/>
		<updated>2013-10-22T18:06:28Z</updated>

		<summary type="html">&lt;p&gt;Emerrill: /* Common repository settings */ MDL-41940 New setting to control adding files to legacy course files&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Repositories}}&lt;br /&gt;
==Enabling repositories==&lt;br /&gt;
&lt;br /&gt;
Repositories can be enabled by an administrator in &#039;&#039;Settings &amp;gt; Site administration &amp;gt; Plugins &amp;gt; Repositories &amp;gt; Manage repositories&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
A repository plugin may be set to&lt;br /&gt;
&lt;br /&gt;
* Enabled and visible - appears in the file picker&lt;br /&gt;
* Enabled and hidden&lt;br /&gt;
* Disabled - default setting&lt;br /&gt;
&lt;br /&gt;
The order in which repositories are shown in the [[File picker|file picker]] may be set using the up and down arrows.&lt;br /&gt;
&lt;br /&gt;
==Vocabulary==&lt;br /&gt;
&#039;&#039;&#039;Repository plugin&#039;&#039;&#039;: it is also called a repository type. It can be named Box.net, Flickr, Mahara, Youtube... Adding a plugin allow users to create instances of this plugin. Only instances are displayed into the file picker. Type only exist in order to let a Moodle administrator to deactivate/delete all instances of a type in one click.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Repository instance&#039;&#039;&#039;: An instance is displayed into the file picker and it is the access point to an external repository. An instance can have specific settings (for example be linked to a personal account).&lt;br /&gt;
 &lt;br /&gt;
*First case: when you add the plugin, an instance is automatically created and can not be edited. The Moodle administrator cannot change the instance name. The instance name displayed into the file picker will be exactly the same as the plugin name. For example Youtube, Box.net...&lt;br /&gt;
*Second case: the plugin allow the Moodle administrator to add multiple instances. An instance has a name for example Flickr Public access to Martin account, Martin&#039;s Mahara... &amp;lt;br/&amp;gt;For this second case it is important to identify two different kind of instances:&lt;br /&gt;
#Common instances: The instances set by Moodle administrator in these same administration pages will be available into any file picker.&lt;br /&gt;
#Private instance: A teacher can set some instances available only for a course, and an user can set some instances only available for himself. In order to set instances for a course the teacher will go to the course page, and in order to set instances for a personal use, a user will go on his profile page. An administrator cannot add/edit private instances from the administration pages.&lt;br /&gt;
&lt;br /&gt;
==Common repository settings==&lt;br /&gt;
&lt;br /&gt;
Common repository settings can be set by an administrator in &#039;&#039;Settings &amp;gt; Site administration &amp;gt; Plugins &amp;gt; Repositories &amp;gt; Common Repository settings&#039;&#039;:&lt;br /&gt;
&lt;br /&gt;
===Cache Expire===&lt;br /&gt;
&lt;br /&gt;
You can specify how long in seconds file listings are cached locally when browsing external repositories.&lt;br /&gt;
&lt;br /&gt;
===Allow external links===&lt;br /&gt;
&lt;br /&gt;
With some repositories such as Flickr, users can have the choice whether to copy the media into Moodle (the preferred solution) or to make a link to it instead.&lt;br /&gt;
&lt;br /&gt;
===Legacy course files in new courses===&lt;br /&gt;
&lt;br /&gt;
This repository is not normally available in new courses as it is designed for upgraded 1.9 courses. However, if it is checked here then it will appear when new courses are created - but certain backup and restore features won&#039;t work with it. See [[Legacy course files]] for more details.&lt;br /&gt;
&lt;br /&gt;
===Allow adding to legacy course files===&lt;br /&gt;
{{New features}}&lt;br /&gt;
&lt;br /&gt;
When &#039;Legacy course files&#039; is available in a course, this setting controls if users are able to add new files to it. When enabled, users will be able to add files and directories, as well as delete. When disabled, users will not be able to add files and directories.&lt;br /&gt;
&lt;br /&gt;
==Repository capabilities==&lt;br /&gt;
&lt;br /&gt;
*[[Capabilities/repository/alfresco:view|View alfresco repository]]&lt;br /&gt;
*[[Capabilities/repository/boxnet:view|View box.net repository]]&lt;br /&gt;
*[[Capabilities/repository/coursefiles:view|Use course files repository plugin]]&lt;br /&gt;
*[[Capabilities/repository/dropbox:view|View a Dropbox folder]]&lt;br /&gt;
*[[Capabilities/repository/filesystem:view|View file system repository]]&lt;br /&gt;
*[[Capabilities/repository/flickr:view|View Flickr repository]]&lt;br /&gt;
*[[Capabilities/repository/flickr public:view|Use Flickr public repository in file picker]]&lt;br /&gt;
*[[Capabilities/repository/googledocs:view|View google docs repository]]&lt;br /&gt;
*[[Capabilities/repository/local:view|View server repository]]&lt;br /&gt;
*[[Capabilities/repository/merlot:view|View the Merlot repository]]&lt;br /&gt;
*[[Capabilities/repository/picasa:view|View picasa repository]]&lt;br /&gt;
*[[Capabilities/repository/recent:view|View recent files]]&lt;br /&gt;
*[[Capabilities/repository/s3:view|View amazon s3 repository]]&lt;br /&gt;
*[[Capabilities/repository/upload:view|Use uploading in file picker]]&lt;br /&gt;
*[[Capabilities/repository/url:view|Use URL downloader in file picker]]&lt;br /&gt;
*[[Capabilities/repository/user:view|View user private files]]&lt;br /&gt;
*[[Capabilities/repository/webdav:view|View WebDav repository]]&lt;br /&gt;
*[[Capabilities/repository/wikimedia:view|View wikimedia repository]]&lt;br /&gt;
*[[Capabilities/repository/youtube:view|Use youtube in file picker]]&lt;br /&gt;
&lt;br /&gt;
[[de:Repositories verwalten]]&lt;/div&gt;</summary>
		<author><name>Emerrill</name></author>
	</entry>
	<entry>
		<id>https://docs.moodle.org/39/en/index.php?title=Forum_settings&amp;diff=107140</id>
		<title>Forum settings</title>
		<link rel="alternate" type="text/html" href="https://docs.moodle.org/39/en/index.php?title=Forum_settings&amp;diff=107140"/>
		<updated>2013-10-22T17:46:46Z</updated>

		<summary type="html">&lt;p&gt;Emerrill: /* Read tracking */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Forum}}&lt;br /&gt;
==Adding and editing a forum==&lt;br /&gt;
#With the editing turned on, in the section you wish to add your forum, click the &amp;quot;Add an activity or resource&amp;quot; link (or, if not present, the &amp;quot;Add an activity&amp;quot; drop down menu )and choose &#039;&#039;Forum&#039;&#039;.&lt;br /&gt;
# This will take you to the forum settings page titled &amp;quot;Adding a new forum&amp;quot;. &lt;br /&gt;
&lt;br /&gt;
You can access an existing forum by clicking the configure icon or clicking on the forum and then &#039;&#039;Administration &amp;gt; Forum administration &amp;gt; Edit settings&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
==General==&lt;br /&gt;
{|&lt;br /&gt;
|[[File:forumgeneral25.png|thumb|The General settings, expanded by default.]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
===Forum name===&lt;br /&gt;
A short name of the forum (e.g. &amp;quot;Favourite colour&amp;quot;), which will be displayed on the course homepage.&lt;br /&gt;
===Description===&lt;br /&gt;
Provide instructions for your students here so they are clear what they have to do. Click &amp;quot;Show editing tools&amp;quot; to display the rich text editor and drag the bottom right of the text box out to expand it.&lt;br /&gt;
===Display description on course page===&lt;br /&gt;
Enabling this will display the description on the course page just below the link to the forum.&lt;br /&gt;
===Forum type===&lt;br /&gt;
There are five forum types to choose from:&lt;br /&gt;
&lt;br /&gt;
*A single simple discussion - A single topic discussion developed on one page, which is useful for short focused discussions (cannot be used with separate groups)&lt;br /&gt;
*Standard forum for general use - An open forum where anyone can start a new topic at any time; this is the best general-purpose forum&lt;br /&gt;
*Each person posts one discussion - Each person can post exactly one new discussion topic (everyone can reply to them though); this is useful when you want each student to start a discussion about, say, their reflections on the week&#039;s topic, and everyone else responds to these&lt;br /&gt;
*Q and A Forum - Instead of initiating discussions participants pose a question in the initial post of a discussion. Students may reply with an answer, but they will not see the replies of other Students to the question in that discussion until they have themselves replied to the same discussion.&lt;br /&gt;
*Standard forum displayed in a blog-like format&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Note&#039;&#039;&#039;: [[News forum]] is a special type of forum that is automatically created with a new course.&lt;br /&gt;
&lt;br /&gt;
==Attachments and word count==&lt;br /&gt;
(This setting is collapsed by default)&lt;br /&gt;
&lt;br /&gt;
{|&lt;br /&gt;
|[[File:attachmentsandwordcount.png|thumb|Attachments and word count settings expanded]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Maximum attachment size===&lt;br /&gt;
&lt;br /&gt;
The maximum file size that may be attached to a forum post will first be determined by the Moodle site settings. The teacher may want a smaller size limit for the forum. Server file capacity, student downloading speeds and discouraging images in a document centered discussion are a few reasons to limit file size.&lt;br /&gt;
&lt;br /&gt;
===Maximum number of attachments===&lt;br /&gt;
The maximum number of attachments a user can add to their forum post (from 0 to 100) can be specified here.&lt;br /&gt;
&lt;br /&gt;
===Display word count===&lt;br /&gt;
&lt;br /&gt;
If &amp;quot;Display word count&amp;quot;  is enabled, then the number of words in forum posts will be shown at the bottom of each post.&lt;br /&gt;
&lt;br /&gt;
==Subscription and tracking==&lt;br /&gt;
(This setting is collapsed by default)&lt;br /&gt;
&lt;br /&gt;
{|&lt;br /&gt;
|[[File:subscriptionandtracking.png|thumb|Subscription and tracking settings expanded]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
===Subscription mode===&lt;br /&gt;
&lt;br /&gt;
When a user is subscribed to a forum it means that they will receive notification (via popup and/or email, depending on the user’s messaging settings preferences) of each new posting. By default, posts are recorded about 30 minutes after the post was first written. Depending upon the email settings of each forum member, they may be sent an email immediately after the 30 minute edit window is closed, or in a batch at a time fixed by the site administrator (see below).&lt;br /&gt;
&lt;br /&gt;
People can usually choose whether or not they want to be subscribed to each forum. However, the teacher can choose to force subscription on a particular forum then all course users will be subscribed automatically, even those that enrol at a later time. &lt;br /&gt;
&lt;br /&gt;
There are 4 subscription mode options:&lt;br /&gt;
* Optional subscription - Participants can choose whether to be subscribed&lt;br /&gt;
* Forced subscription - Everyone is subscribed and cannot unsubscribe&lt;br /&gt;
* Auto subscription - Everyone is subscribed initially but can choose to unsubscribe at any time&lt;br /&gt;
* Subscription disabled - Subscriptions are not allowed.  &lt;br /&gt;
&lt;br /&gt;
The subscription mode and subscribe or unsubscribe links appear in&#039;&#039; Navigation&amp;gt;Forum administration&#039;&#039; when viewing the forum.  teachers can quickly change the mode via the &#039;Subscription mode&#039; options and view the current subscribers via the &#039;Show/edit current subscribers&#039; link.&lt;br /&gt;
&lt;br /&gt;
Tips:&lt;br /&gt;
* Forcing everyone to subscribe is especially useful in the news forum and in forums towards the beginning of the course (before everyone has worked out that they can subscribe to these emails themselves).&lt;br /&gt;
* Changing the setting from &amp;quot;Yes, initially&amp;quot; to &amp;quot;No&amp;quot; will not unsubscribe existing users; it will only affect those who enrol in the course in the future. Similarly changing &amp;quot;Yes, initially&amp;quot; will not subscribe existing course users but only those enrolling later.&lt;br /&gt;
* There is also a &amp;quot;Subscriptions not allowed&amp;quot; setting which prevents Students from subscribing to a Forum. Teachers may choose to subscribe to a forum if they wish.&lt;br /&gt;
&lt;br /&gt;
===Read tracking for this forum?===&lt;br /&gt;
&lt;br /&gt;
&amp;quot;Read tracking&amp;quot; for a forum allows users to track read and unread forum posts. &lt;br /&gt;
{|&lt;br /&gt;
|[[File:forum administration.png|thumb|Don&#039;t track unread posts link]]&lt;br /&gt;
|}&lt;br /&gt;
There are three options for this setting:&lt;br /&gt;
* Optional - Students can turn tracking on or off for the forum via a link &#039;Track / Don&#039;t track unread posts&#039; in &#039;&#039;Administration &amp;gt; Forum administration&#039;&#039;, or via their profile &#039;Forum Tracking&#039; option.&lt;br /&gt;
* Off - It is not possible to track unread forum posts&lt;br /&gt;
* Forced - Tracking is always on in this forum, regardless of user preference or setting. No link in is present in &#039;&#039;Administration &amp;gt; Forum administration&#039;&#039;. This setting is only available when the &#039;Allow forced read tracking&#039; administrative setting is enabled.&lt;br /&gt;
&lt;br /&gt;
==RSS==&lt;br /&gt;
(This setting is collapsed by default and will only appear if RSS has been enabled sitewide and for forums)&lt;br /&gt;
&lt;br /&gt;
{|&lt;br /&gt;
|[[File:rss25.png|thumb|RSS settings expanded]]&lt;br /&gt;
|}&lt;br /&gt;
===RSS feed for this activity===&lt;br /&gt;
&lt;br /&gt;
This turns RSS on or off for this forum. When set to “None,” RSS is disabled. When set to “Discussions,” the RSS feed will send out new discussions to subscribers. When set to “Posts,” the RSS feed will send out any new posts to subscribers. &lt;br /&gt;
&lt;br /&gt;
===Number of RSS recent articles===&lt;br /&gt;
&lt;br /&gt;
This number sets the number of articles that go out via RSS. If this number is set to 5, then the 5 most recent articles will be sent to subscribers. As new posts (or discussions) get added, the oldest post/discussion gets replaced on the RSS feed. If your forum gets a lot of posts every day, you will want to set this number high.&lt;br /&gt;
&lt;br /&gt;
The administrative cron (admin/cron.php) must run after the forum is created and posts or discussions have been made.  Otherwise the user will receive an error &amp;quot;Error reading RSS data&amp;quot;&lt;br /&gt;
&lt;br /&gt;
==Post threshold for blocking==&lt;br /&gt;
(This setting is collapsed by default)&lt;br /&gt;
&lt;br /&gt;
{|&lt;br /&gt;
|[[File:postthresholdforblocking.png|thumb|Post threshold for blocking settings expanded]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
===Time period for blocking===&lt;br /&gt;
Choose here the time period in which can be blocked from posting more than a given number of posts. (To make a user exempt, give them the capability &#039;&#039;mod/forum:postwithoutthrottling&#039;&#039;)&lt;br /&gt;
===Post threshold for blocking===&lt;br /&gt;
Set the number of posts here that users may add before they are blocked.&lt;br /&gt;
===Post threshold for warning===&lt;br /&gt;
Set the number of posts here after which users will be warned they are about to be blocked.&lt;br /&gt;
&lt;br /&gt;
==Grade==&lt;br /&gt;
(This setting is collapsed by default)&lt;br /&gt;
Choose the category in which this forum will appear if ratings are enabled.&lt;br /&gt;
&lt;br /&gt;
==Ratings==&lt;br /&gt;
(This setting is collapsed by default)&lt;br /&gt;
&lt;br /&gt;
{|&lt;br /&gt;
|[[File:ratings25.png|thumb|Ratings settings expanded]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
===Roles with permissions to rate===&lt;br /&gt;
Forum posts can be rated using a [[Scales|scale]]. By default, only teachers can rate forum posts, though students can be given permission to do so if desired (see Forum permissions below). This is a useful tool for giving students participation grades. Any ratings given in the forum are recorded in the [[Gradebook|gradebook]].&lt;br /&gt;
&lt;br /&gt;
===Aggregate type===&lt;br /&gt;
&lt;br /&gt;
You can set an aggregate type, in other words, decide how all the ratings given to posts in a forum are combined to form the final grade (for each post and for the whole forum activity). Some scales do not lend themselves to certain types of aggregates. There are five options:&lt;br /&gt;
&lt;br /&gt;
* Average of ratings (default) - This is the mean of all the ratings given to posts in that forum. It is especially useful with peer grading when there are a lot of ratings being made.&lt;br /&gt;
* Count of ratings - The counts the number of rated posts which becomes the final grade. This is useful when the number of posts is important. Note that the total can not exceed the maximum grade allowed for the forum. A count may be used if the teacher simply wants to acknowledge that a reply was given in the case students being required to make a certain number of posts in the discussion. Note: Count of ratings does not work for the &amp;quot;Separate or Connected Ways of Knowing&amp;quot; scale or custom scales due to the limitation imposed by the max grade.&lt;br /&gt;
* Maximum rating - The highest rating is returned as the final grade. This method is useful for emphasising the best work from participants, allowing them to post one high-quality post as well as a number of more casual responses to others.&lt;br /&gt;
* Minimum rating - The smallest rating is returned as the final grade. This method promotes a culture of high quality for all posts.&lt;br /&gt;
* Sum of ratings - All the ratings for a particular user are added together. Note that the total is not allowed to exceed the maximum grade for the forum. Note: Sum of ratings does not work for the &amp;quot;Separate or Connected Ways of Knowing&amp;quot; scale or custom scales due to the limitation imposed by the max grade.&lt;br /&gt;
&lt;br /&gt;
===Restrict ratings to items with dates in this range===&lt;br /&gt;
The teacher can allow only posts within a certain date range to be rated. This is useful if the teacher wants to keep students focused on the most recent content and maintain a specific pace within the forum or course.&lt;br /&gt;
&lt;br /&gt;
===RSS feed for this activity===&lt;br /&gt;
&lt;br /&gt;
This turns RSS on or off for this forum. When set to “None,” RSS is disabled. When set to “Discussions,” the RSS feed will send out new discussions to subscribers. When set to “Posts,” the RSS feed will send out any new posts to subscribers. &lt;br /&gt;
&lt;br /&gt;
===Number of RSS recent articles===&lt;br /&gt;
&lt;br /&gt;
This number sets the number of articles that go out via RSS. If this number is set to 5, then the 5 most recent articles will be sent to subscribers. As new posts (or discussions) get added, the oldest post/discussion gets replaced on the RSS feed. If your forum gets a lot of posts every day, you will want to set this number high.&lt;br /&gt;
&lt;br /&gt;
The administrative cron (admin/cron.php) must run after the forum is created and posts or discussions have been made.  Otherwise the user will receive an error &amp;quot;Error reading RSS data&amp;quot;&lt;br /&gt;
&lt;br /&gt;
Note: [[RSS feeds]] must be enabled for the site and for forums in order for the RSS settings to appear.&lt;br /&gt;
&lt;br /&gt;
==Common module settings==&lt;br /&gt;
(These settings are collapsed by default)&lt;br /&gt;
&lt;br /&gt;
{|&lt;br /&gt;
|[[File:cm25.png|thumb|Common module settings expanded]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
See [[Common module settings]] for more information, but note the details below relating specifically to use of forums with groups.&lt;br /&gt;
&lt;br /&gt;
===Group mode===&lt;br /&gt;
&lt;br /&gt;
The &#039;&#039;&#039;group mode&#039;&#039;&#039; setting has three options:&lt;br /&gt;
&lt;br /&gt;
# No groups&lt;br /&gt;
# Separate groups - each group can only see their own group; others are invisible&lt;br /&gt;
# Visible groups - each group works in their own group, but can also see other groups&lt;br /&gt;
&lt;br /&gt;
If the group mode is set to separate groups:&lt;br /&gt;
{|&lt;br /&gt;
|[[File:groupsforum.gif|401x|thumb|Adding a new discussion topic to a forum set to separate groups]]&lt;br /&gt;
|}&lt;br /&gt;
* Teachers are given the option of adding a new discussion topic for all participants or for a selected group. If a teacher adds a new discussion topic for a selected group, then only group members can reply to it. If a teacher adds a new discussion topic for all participants, then students can&#039;t reply to it. (This is to ensure that groups are kept separate.)&lt;br /&gt;
* Students can only start discussions for their own group.&lt;br /&gt;
* Students can only reply to discussions started by other group members or discussions for their own group started by a teacher.&lt;br /&gt;
&lt;br /&gt;
If the group mode is set to visible groups:&lt;br /&gt;
&lt;br /&gt;
* Teachers are given the option of adding a new discussion topic for all participants or for a selected group. If a teacher adds a new discussion topic for a selected group, then only group members can reply to it.&lt;br /&gt;
* Students can only start discussions for their own group.&lt;br /&gt;
* Students can only reply to discussions started by other group members or teachers.&lt;br /&gt;
&lt;br /&gt;
Teachers, and other users with the capability [[Capabilities/moodle/site:accessallgroups|moodle/site:accessallgroups]] set to allow, can view and post in all forum discussions, regardless of the group mode setting.&lt;br /&gt;
&lt;br /&gt;
:&#039;&#039;Note&#039;&#039;: Single simple discussions cannot be set to separate groups (as this feature is not implemented). Instead, a standard forum should be used, with the teacher copying and pasting the same discussion topic for each separate group. If required, a permissions override may be set to prevent students from starting new discussions.&lt;br /&gt;
&lt;br /&gt;
==Restrict access/Activity completion==&lt;br /&gt;
(These settings are collapsed by default)&lt;br /&gt;
&lt;br /&gt;
These settings are visible if [[Conditional activities]] and [[Activity completion]] have been enabled in the site and the course.&lt;br /&gt;
&lt;br /&gt;
==Locally assigned roles==&lt;br /&gt;
&lt;br /&gt;
In &#039;&#039;Administration &amp;gt; Forum administration &amp;gt; Locally assigned roles&#039;&#039; selected users can be given additional roles in the activity.&lt;br /&gt;
&lt;br /&gt;
===Forum moderator===&lt;br /&gt;
&lt;br /&gt;
A student can be given the rights to moderate a forum by assigning them the role of non-editing teacher in the forum.&lt;br /&gt;
&lt;br /&gt;
# In &#039;&#039;Settings &amp;gt; Forum administration &amp;gt; Locally assigned roles&#039;&#039; click on student&lt;br /&gt;
# Select the student from the potential users list on the right, and use the Add button to add them to the existing users list on the left. Multiple users may be selected by holding down the Apple or Ctrl key whilst clicking on the users&#039; names. &lt;br /&gt;
&lt;br /&gt;
See also [[Forum moderator role]].&lt;br /&gt;
&lt;br /&gt;
==Forum permissions==&lt;br /&gt;
&lt;br /&gt;
Role permissions for the activity can be changed in &#039;&#039;Administration &amp;gt; Forum administration &amp;gt; Permissions&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
[[File:Forum permissions.png|Frame|]]&lt;br /&gt;
&lt;br /&gt;
Common permissions changes include:&lt;br /&gt;
&lt;br /&gt;
===Enabling students to rate posts===&lt;br /&gt;
&lt;br /&gt;
Click the Allow icon (+) opposite the capability to rate posts and allow the role of student.&lt;br /&gt;
&lt;br /&gt;
===Archiving a forum===&lt;br /&gt;
&lt;br /&gt;
A forum can be closed / archived so that students may no longer start new discussions, nor add replies, but can still read all the discussions by clicking the Prevent icon (X) for the student role for the capabilities &#039;Start new discussions&#039; and &#039;Reply to posts&#039;.&lt;br /&gt;
&lt;br /&gt;
===Guests and posting in a forum===&lt;br /&gt;
&lt;br /&gt;
There are certain things, such as posting in a forum, that guests are never allowed to do, despite the permissions interface suggesting otherwise.&lt;br /&gt;
&lt;br /&gt;
The guest role has some special functionality, for example when a guest user attempts to post in a forum, they obtain the message &amp;quot;Sorry, guests are not allowed to post. Would you like to log in now with a full user account?&amp;quot;&lt;br /&gt;
&lt;br /&gt;
(Note: If guests don&#039;t obtain the  &amp;quot;Sorry, guests are not allowed to post&amp;quot; message because they have no reply link, then self enrolment needs enabling in &#039;&#039;Settings &amp;gt; Course administration &amp;gt; Users &amp;gt; Enrolment methods&#039;&#039;.)&lt;br /&gt;
&lt;br /&gt;
If you wish guests to be able to post in a forum, you can [[Manage roles|create a similar role]], say &amp;quot;visitor&amp;quot; with very few permissions allowed, then create an account and assign it the role of visitor. Guests can then share this visitor account.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Anything else you&#039;d like to achieve with a forum permissions change? Please add your suggestions to [[Talk:Forum settings]]!&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
==User administration settings==&lt;br /&gt;
&lt;br /&gt;
Users can choose whether or not to track unread posts in their profile settings under &#039;Forum tracking&#039;. The settings are:&lt;br /&gt;
&lt;br /&gt;
* Yes: highlight new posts for me&lt;br /&gt;
* No: don&#039;t keep track of posts I have seen&lt;br /&gt;
&lt;br /&gt;
If the user chooses &#039;Yes: highlight new posts for me&#039; and the forum administrator has set the &#039;Read tracking for this forum?&#039; to On or Optional then the user will have new posts highlighted for them. The posts will be highlighted in the following places:&lt;br /&gt;
&lt;br /&gt;
* My home page&lt;br /&gt;
* Course page&lt;br /&gt;
* Within the forum itself&lt;br /&gt;
* In forum discussion threads&lt;br /&gt;
&lt;br /&gt;
[[Image:MoodleDocs forum_show_unread_behaviour.png|frame|center|Show unread on forum page]]&lt;br /&gt;
&lt;br /&gt;
==Site administration settings==&lt;br /&gt;
&lt;br /&gt;
The forum module has additional settings which may be changed by an administrator in &#039;&#039;Administration &amp;gt; Site administration &amp;gt; Plugins &amp;gt; Activity modules &amp;gt; Forum&#039;&#039; and, for &#039;Maximum time to edit posts&#039;, in &#039;&#039;Administration &amp;gt; Site administration &amp;gt; Security &amp;gt; Site policies&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
===Use email address in reply===&lt;br /&gt;
&lt;br /&gt;
By default, a user&#039;s email is set as the &#039;From&#039; address for forum notifications (unless the user has hidden their email address in their profile) so that recipients can choose to reply personally rather than via the forum. To set noreply@yourmoodlesite.org as &#039;From&#039; address for all forum notification emails, untick the forum_replytouser checkbox.&lt;br /&gt;
&lt;br /&gt;
===Long and short posts===&lt;br /&gt;
&lt;br /&gt;
The long and short post setting determine how forum posts on the site front page, social format course pages, and user profiles are displayed. (Note: There is currently an unresolved issue - &amp;quot;Site news - forum length setting has no effect for certain users&amp;quot; - MDL-4781.)&lt;br /&gt;
&lt;br /&gt;
===Enabling timed posts===&lt;br /&gt;
&lt;br /&gt;
Timed forum posts may be enabled i.e. having the option to set a display start and end date for a new discussion. Timed posts can then be created by users with the [[Capabilities/mod/forum:viewhiddentimedposts|capability to view hidden timed posts]] (normally admins and teachers).&lt;br /&gt;
&lt;br /&gt;
===Maximum time to edit posts===&lt;br /&gt;
&lt;br /&gt;
This specifies the amount of time people have to re-edit forum postings, glossary comments etc. Usually 30 minutes is a good value. The setting may be changed by an administrator in &#039;&#039;Administration &amp;gt; Site administration &amp;gt; Security &amp;gt; Site policies&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
===Read tracking===&lt;br /&gt;
{{New features}}&lt;br /&gt;
&lt;br /&gt;
Sets the default &#039;Read tracking&#039; selection when creating new forums. If &#039;Forced&#039; is selected here, but [[#Allow forced read tracking|Allow forced read tracking]] is not enabled, &#039;Optional&#039; will be the default setting.&lt;br /&gt;
&lt;br /&gt;
===Allow forced read tracking===&lt;br /&gt;
{{New features}}&lt;br /&gt;
&lt;br /&gt;
With this option set, &amp;quot;Forced&amp;quot; will be an option for &amp;quot;Read tracking&amp;quot; when creating or editing Forums. Forced forums have read tracking enabled regardless of user preference.&lt;br /&gt;
&lt;br /&gt;
This setting can place additional load on servers. With this setting disabled, users who set their profile setting to not track read posts see faster load times of courses pages. With this setting enabled, that performance increase is lost, and all course views see the same performance as if the users personal setting was on.&lt;br /&gt;
&lt;br /&gt;
When disabled, any forums previously set to &amp;quot;Forced&amp;quot; (or &amp;quot;On&amp;quot; prior to Moodle 2.6) will be treated as optional.&lt;br /&gt;
&lt;br /&gt;
===Mark post read after &#039;X&#039; days===&lt;br /&gt;
&lt;br /&gt;
This setting is forum_oldpostdays and specifies the number of days after which any post is considered to be read. E.g. If this is set to 14 days then any post older than 14 days will be considered read. If you set this to 0 then &#039;&#039;&#039;ALL&#039;&#039;&#039; posts are instantly considered to be read. If you don&#039;t want any posts to be considered read without the user reading them then set a high figure (e.g. 1000) &lt;br /&gt;
&lt;br /&gt;
[[de:Forum konfigurieren]]&lt;br /&gt;
[[fr:Ajouter/modifier un forum]]&lt;br /&gt;
[[ja:フォーラムの追加/編集]]&lt;/div&gt;</summary>
		<author><name>Emerrill</name></author>
	</entry>
	<entry>
		<id>https://docs.moodle.org/39/en/index.php?title=Forum_settings&amp;diff=107139</id>
		<title>Forum settings</title>
		<link rel="alternate" type="text/html" href="https://docs.moodle.org/39/en/index.php?title=Forum_settings&amp;diff=107139"/>
		<updated>2013-10-22T17:45:40Z</updated>

		<summary type="html">&lt;p&gt;Emerrill: /* Site administration settings */ MDL-41933 Document new read tracking default admin option&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Forum}}&lt;br /&gt;
==Adding and editing a forum==&lt;br /&gt;
#With the editing turned on, in the section you wish to add your forum, click the &amp;quot;Add an activity or resource&amp;quot; link (or, if not present, the &amp;quot;Add an activity&amp;quot; drop down menu )and choose &#039;&#039;Forum&#039;&#039;.&lt;br /&gt;
# This will take you to the forum settings page titled &amp;quot;Adding a new forum&amp;quot;. &lt;br /&gt;
&lt;br /&gt;
You can access an existing forum by clicking the configure icon or clicking on the forum and then &#039;&#039;Administration &amp;gt; Forum administration &amp;gt; Edit settings&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
==General==&lt;br /&gt;
{|&lt;br /&gt;
|[[File:forumgeneral25.png|thumb|The General settings, expanded by default.]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
===Forum name===&lt;br /&gt;
A short name of the forum (e.g. &amp;quot;Favourite colour&amp;quot;), which will be displayed on the course homepage.&lt;br /&gt;
===Description===&lt;br /&gt;
Provide instructions for your students here so they are clear what they have to do. Click &amp;quot;Show editing tools&amp;quot; to display the rich text editor and drag the bottom right of the text box out to expand it.&lt;br /&gt;
===Display description on course page===&lt;br /&gt;
Enabling this will display the description on the course page just below the link to the forum.&lt;br /&gt;
===Forum type===&lt;br /&gt;
There are five forum types to choose from:&lt;br /&gt;
&lt;br /&gt;
*A single simple discussion - A single topic discussion developed on one page, which is useful for short focused discussions (cannot be used with separate groups)&lt;br /&gt;
*Standard forum for general use - An open forum where anyone can start a new topic at any time; this is the best general-purpose forum&lt;br /&gt;
*Each person posts one discussion - Each person can post exactly one new discussion topic (everyone can reply to them though); this is useful when you want each student to start a discussion about, say, their reflections on the week&#039;s topic, and everyone else responds to these&lt;br /&gt;
*Q and A Forum - Instead of initiating discussions participants pose a question in the initial post of a discussion. Students may reply with an answer, but they will not see the replies of other Students to the question in that discussion until they have themselves replied to the same discussion.&lt;br /&gt;
*Standard forum displayed in a blog-like format&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Note&#039;&#039;&#039;: [[News forum]] is a special type of forum that is automatically created with a new course.&lt;br /&gt;
&lt;br /&gt;
==Attachments and word count==&lt;br /&gt;
(This setting is collapsed by default)&lt;br /&gt;
&lt;br /&gt;
{|&lt;br /&gt;
|[[File:attachmentsandwordcount.png|thumb|Attachments and word count settings expanded]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Maximum attachment size===&lt;br /&gt;
&lt;br /&gt;
The maximum file size that may be attached to a forum post will first be determined by the Moodle site settings. The teacher may want a smaller size limit for the forum. Server file capacity, student downloading speeds and discouraging images in a document centered discussion are a few reasons to limit file size.&lt;br /&gt;
&lt;br /&gt;
===Maximum number of attachments===&lt;br /&gt;
The maximum number of attachments a user can add to their forum post (from 0 to 100) can be specified here.&lt;br /&gt;
&lt;br /&gt;
===Display word count===&lt;br /&gt;
&lt;br /&gt;
If &amp;quot;Display word count&amp;quot;  is enabled, then the number of words in forum posts will be shown at the bottom of each post.&lt;br /&gt;
&lt;br /&gt;
==Subscription and tracking==&lt;br /&gt;
(This setting is collapsed by default)&lt;br /&gt;
&lt;br /&gt;
{|&lt;br /&gt;
|[[File:subscriptionandtracking.png|thumb|Subscription and tracking settings expanded]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
===Subscription mode===&lt;br /&gt;
&lt;br /&gt;
When a user is subscribed to a forum it means that they will receive notification (via popup and/or email, depending on the user’s messaging settings preferences) of each new posting. By default, posts are recorded about 30 minutes after the post was first written. Depending upon the email settings of each forum member, they may be sent an email immediately after the 30 minute edit window is closed, or in a batch at a time fixed by the site administrator (see below).&lt;br /&gt;
&lt;br /&gt;
People can usually choose whether or not they want to be subscribed to each forum. However, the teacher can choose to force subscription on a particular forum then all course users will be subscribed automatically, even those that enrol at a later time. &lt;br /&gt;
&lt;br /&gt;
There are 4 subscription mode options:&lt;br /&gt;
* Optional subscription - Participants can choose whether to be subscribed&lt;br /&gt;
* Forced subscription - Everyone is subscribed and cannot unsubscribe&lt;br /&gt;
* Auto subscription - Everyone is subscribed initially but can choose to unsubscribe at any time&lt;br /&gt;
* Subscription disabled - Subscriptions are not allowed.  &lt;br /&gt;
&lt;br /&gt;
The subscription mode and subscribe or unsubscribe links appear in&#039;&#039; Navigation&amp;gt;Forum administration&#039;&#039; when viewing the forum.  teachers can quickly change the mode via the &#039;Subscription mode&#039; options and view the current subscribers via the &#039;Show/edit current subscribers&#039; link.&lt;br /&gt;
&lt;br /&gt;
Tips:&lt;br /&gt;
* Forcing everyone to subscribe is especially useful in the news forum and in forums towards the beginning of the course (before everyone has worked out that they can subscribe to these emails themselves).&lt;br /&gt;
* Changing the setting from &amp;quot;Yes, initially&amp;quot; to &amp;quot;No&amp;quot; will not unsubscribe existing users; it will only affect those who enrol in the course in the future. Similarly changing &amp;quot;Yes, initially&amp;quot; will not subscribe existing course users but only those enrolling later.&lt;br /&gt;
* There is also a &amp;quot;Subscriptions not allowed&amp;quot; setting which prevents Students from subscribing to a Forum. Teachers may choose to subscribe to a forum if they wish.&lt;br /&gt;
&lt;br /&gt;
===Read tracking for this forum?===&lt;br /&gt;
&lt;br /&gt;
&amp;quot;Read tracking&amp;quot; for a forum allows users to track read and unread forum posts. &lt;br /&gt;
{|&lt;br /&gt;
|[[File:forum administration.png|thumb|Don&#039;t track unread posts link]]&lt;br /&gt;
|}&lt;br /&gt;
There are three options for this setting:&lt;br /&gt;
* Optional - Students can turn tracking on or off for the forum via a link &#039;Track / Don&#039;t track unread posts&#039; in &#039;&#039;Administration &amp;gt; Forum administration&#039;&#039;, or via their profile &#039;Forum Tracking&#039; option.&lt;br /&gt;
* Off - It is not possible to track unread forum posts&lt;br /&gt;
* Forced - Tracking is always on in this forum, regardless of user preference or setting. No link in is present in &#039;&#039;Administration &amp;gt; Forum administration&#039;&#039;. This setting is only available when the &#039;Allow forced read tracking&#039; administrative setting is enabled.&lt;br /&gt;
&lt;br /&gt;
==RSS==&lt;br /&gt;
(This setting is collapsed by default and will only appear if RSS has been enabled sitewide and for forums)&lt;br /&gt;
&lt;br /&gt;
{|&lt;br /&gt;
|[[File:rss25.png|thumb|RSS settings expanded]]&lt;br /&gt;
|}&lt;br /&gt;
===RSS feed for this activity===&lt;br /&gt;
&lt;br /&gt;
This turns RSS on or off for this forum. When set to “None,” RSS is disabled. When set to “Discussions,” the RSS feed will send out new discussions to subscribers. When set to “Posts,” the RSS feed will send out any new posts to subscribers. &lt;br /&gt;
&lt;br /&gt;
===Number of RSS recent articles===&lt;br /&gt;
&lt;br /&gt;
This number sets the number of articles that go out via RSS. If this number is set to 5, then the 5 most recent articles will be sent to subscribers. As new posts (or discussions) get added, the oldest post/discussion gets replaced on the RSS feed. If your forum gets a lot of posts every day, you will want to set this number high.&lt;br /&gt;
&lt;br /&gt;
The administrative cron (admin/cron.php) must run after the forum is created and posts or discussions have been made.  Otherwise the user will receive an error &amp;quot;Error reading RSS data&amp;quot;&lt;br /&gt;
&lt;br /&gt;
==Post threshold for blocking==&lt;br /&gt;
(This setting is collapsed by default)&lt;br /&gt;
&lt;br /&gt;
{|&lt;br /&gt;
|[[File:postthresholdforblocking.png|thumb|Post threshold for blocking settings expanded]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
===Time period for blocking===&lt;br /&gt;
Choose here the time period in which can be blocked from posting more than a given number of posts. (To make a user exempt, give them the capability &#039;&#039;mod/forum:postwithoutthrottling&#039;&#039;)&lt;br /&gt;
===Post threshold for blocking===&lt;br /&gt;
Set the number of posts here that users may add before they are blocked.&lt;br /&gt;
===Post threshold for warning===&lt;br /&gt;
Set the number of posts here after which users will be warned they are about to be blocked.&lt;br /&gt;
&lt;br /&gt;
==Grade==&lt;br /&gt;
(This setting is collapsed by default)&lt;br /&gt;
Choose the category in which this forum will appear if ratings are enabled.&lt;br /&gt;
&lt;br /&gt;
==Ratings==&lt;br /&gt;
(This setting is collapsed by default)&lt;br /&gt;
&lt;br /&gt;
{|&lt;br /&gt;
|[[File:ratings25.png|thumb|Ratings settings expanded]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
===Roles with permissions to rate===&lt;br /&gt;
Forum posts can be rated using a [[Scales|scale]]. By default, only teachers can rate forum posts, though students can be given permission to do so if desired (see Forum permissions below). This is a useful tool for giving students participation grades. Any ratings given in the forum are recorded in the [[Gradebook|gradebook]].&lt;br /&gt;
&lt;br /&gt;
===Aggregate type===&lt;br /&gt;
&lt;br /&gt;
You can set an aggregate type, in other words, decide how all the ratings given to posts in a forum are combined to form the final grade (for each post and for the whole forum activity). Some scales do not lend themselves to certain types of aggregates. There are five options:&lt;br /&gt;
&lt;br /&gt;
* Average of ratings (default) - This is the mean of all the ratings given to posts in that forum. It is especially useful with peer grading when there are a lot of ratings being made.&lt;br /&gt;
* Count of ratings - The counts the number of rated posts which becomes the final grade. This is useful when the number of posts is important. Note that the total can not exceed the maximum grade allowed for the forum. A count may be used if the teacher simply wants to acknowledge that a reply was given in the case students being required to make a certain number of posts in the discussion. Note: Count of ratings does not work for the &amp;quot;Separate or Connected Ways of Knowing&amp;quot; scale or custom scales due to the limitation imposed by the max grade.&lt;br /&gt;
* Maximum rating - The highest rating is returned as the final grade. This method is useful for emphasising the best work from participants, allowing them to post one high-quality post as well as a number of more casual responses to others.&lt;br /&gt;
* Minimum rating - The smallest rating is returned as the final grade. This method promotes a culture of high quality for all posts.&lt;br /&gt;
* Sum of ratings - All the ratings for a particular user are added together. Note that the total is not allowed to exceed the maximum grade for the forum. Note: Sum of ratings does not work for the &amp;quot;Separate or Connected Ways of Knowing&amp;quot; scale or custom scales due to the limitation imposed by the max grade.&lt;br /&gt;
&lt;br /&gt;
===Restrict ratings to items with dates in this range===&lt;br /&gt;
The teacher can allow only posts within a certain date range to be rated. This is useful if the teacher wants to keep students focused on the most recent content and maintain a specific pace within the forum or course.&lt;br /&gt;
&lt;br /&gt;
===RSS feed for this activity===&lt;br /&gt;
&lt;br /&gt;
This turns RSS on or off for this forum. When set to “None,” RSS is disabled. When set to “Discussions,” the RSS feed will send out new discussions to subscribers. When set to “Posts,” the RSS feed will send out any new posts to subscribers. &lt;br /&gt;
&lt;br /&gt;
===Number of RSS recent articles===&lt;br /&gt;
&lt;br /&gt;
This number sets the number of articles that go out via RSS. If this number is set to 5, then the 5 most recent articles will be sent to subscribers. As new posts (or discussions) get added, the oldest post/discussion gets replaced on the RSS feed. If your forum gets a lot of posts every day, you will want to set this number high.&lt;br /&gt;
&lt;br /&gt;
The administrative cron (admin/cron.php) must run after the forum is created and posts or discussions have been made.  Otherwise the user will receive an error &amp;quot;Error reading RSS data&amp;quot;&lt;br /&gt;
&lt;br /&gt;
Note: [[RSS feeds]] must be enabled for the site and for forums in order for the RSS settings to appear.&lt;br /&gt;
&lt;br /&gt;
==Common module settings==&lt;br /&gt;
(These settings are collapsed by default)&lt;br /&gt;
&lt;br /&gt;
{|&lt;br /&gt;
|[[File:cm25.png|thumb|Common module settings expanded]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
See [[Common module settings]] for more information, but note the details below relating specifically to use of forums with groups.&lt;br /&gt;
&lt;br /&gt;
===Group mode===&lt;br /&gt;
&lt;br /&gt;
The &#039;&#039;&#039;group mode&#039;&#039;&#039; setting has three options:&lt;br /&gt;
&lt;br /&gt;
# No groups&lt;br /&gt;
# Separate groups - each group can only see their own group; others are invisible&lt;br /&gt;
# Visible groups - each group works in their own group, but can also see other groups&lt;br /&gt;
&lt;br /&gt;
If the group mode is set to separate groups:&lt;br /&gt;
{|&lt;br /&gt;
|[[File:groupsforum.gif|401x|thumb|Adding a new discussion topic to a forum set to separate groups]]&lt;br /&gt;
|}&lt;br /&gt;
* Teachers are given the option of adding a new discussion topic for all participants or for a selected group. If a teacher adds a new discussion topic for a selected group, then only group members can reply to it. If a teacher adds a new discussion topic for all participants, then students can&#039;t reply to it. (This is to ensure that groups are kept separate.)&lt;br /&gt;
* Students can only start discussions for their own group.&lt;br /&gt;
* Students can only reply to discussions started by other group members or discussions for their own group started by a teacher.&lt;br /&gt;
&lt;br /&gt;
If the group mode is set to visible groups:&lt;br /&gt;
&lt;br /&gt;
* Teachers are given the option of adding a new discussion topic for all participants or for a selected group. If a teacher adds a new discussion topic for a selected group, then only group members can reply to it.&lt;br /&gt;
* Students can only start discussions for their own group.&lt;br /&gt;
* Students can only reply to discussions started by other group members or teachers.&lt;br /&gt;
&lt;br /&gt;
Teachers, and other users with the capability [[Capabilities/moodle/site:accessallgroups|moodle/site:accessallgroups]] set to allow, can view and post in all forum discussions, regardless of the group mode setting.&lt;br /&gt;
&lt;br /&gt;
:&#039;&#039;Note&#039;&#039;: Single simple discussions cannot be set to separate groups (as this feature is not implemented). Instead, a standard forum should be used, with the teacher copying and pasting the same discussion topic for each separate group. If required, a permissions override may be set to prevent students from starting new discussions.&lt;br /&gt;
&lt;br /&gt;
==Restrict access/Activity completion==&lt;br /&gt;
(These settings are collapsed by default)&lt;br /&gt;
&lt;br /&gt;
These settings are visible if [[Conditional activities]] and [[Activity completion]] have been enabled in the site and the course.&lt;br /&gt;
&lt;br /&gt;
==Locally assigned roles==&lt;br /&gt;
&lt;br /&gt;
In &#039;&#039;Administration &amp;gt; Forum administration &amp;gt; Locally assigned roles&#039;&#039; selected users can be given additional roles in the activity.&lt;br /&gt;
&lt;br /&gt;
===Forum moderator===&lt;br /&gt;
&lt;br /&gt;
A student can be given the rights to moderate a forum by assigning them the role of non-editing teacher in the forum.&lt;br /&gt;
&lt;br /&gt;
# In &#039;&#039;Settings &amp;gt; Forum administration &amp;gt; Locally assigned roles&#039;&#039; click on student&lt;br /&gt;
# Select the student from the potential users list on the right, and use the Add button to add them to the existing users list on the left. Multiple users may be selected by holding down the Apple or Ctrl key whilst clicking on the users&#039; names. &lt;br /&gt;
&lt;br /&gt;
See also [[Forum moderator role]].&lt;br /&gt;
&lt;br /&gt;
==Forum permissions==&lt;br /&gt;
&lt;br /&gt;
Role permissions for the activity can be changed in &#039;&#039;Administration &amp;gt; Forum administration &amp;gt; Permissions&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
[[File:Forum permissions.png|Frame|]]&lt;br /&gt;
&lt;br /&gt;
Common permissions changes include:&lt;br /&gt;
&lt;br /&gt;
===Enabling students to rate posts===&lt;br /&gt;
&lt;br /&gt;
Click the Allow icon (+) opposite the capability to rate posts and allow the role of student.&lt;br /&gt;
&lt;br /&gt;
===Archiving a forum===&lt;br /&gt;
&lt;br /&gt;
A forum can be closed / archived so that students may no longer start new discussions, nor add replies, but can still read all the discussions by clicking the Prevent icon (X) for the student role for the capabilities &#039;Start new discussions&#039; and &#039;Reply to posts&#039;.&lt;br /&gt;
&lt;br /&gt;
===Guests and posting in a forum===&lt;br /&gt;
&lt;br /&gt;
There are certain things, such as posting in a forum, that guests are never allowed to do, despite the permissions interface suggesting otherwise.&lt;br /&gt;
&lt;br /&gt;
The guest role has some special functionality, for example when a guest user attempts to post in a forum, they obtain the message &amp;quot;Sorry, guests are not allowed to post. Would you like to log in now with a full user account?&amp;quot;&lt;br /&gt;
&lt;br /&gt;
(Note: If guests don&#039;t obtain the  &amp;quot;Sorry, guests are not allowed to post&amp;quot; message because they have no reply link, then self enrolment needs enabling in &#039;&#039;Settings &amp;gt; Course administration &amp;gt; Users &amp;gt; Enrolment methods&#039;&#039;.)&lt;br /&gt;
&lt;br /&gt;
If you wish guests to be able to post in a forum, you can [[Manage roles|create a similar role]], say &amp;quot;visitor&amp;quot; with very few permissions allowed, then create an account and assign it the role of visitor. Guests can then share this visitor account.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Anything else you&#039;d like to achieve with a forum permissions change? Please add your suggestions to [[Talk:Forum settings]]!&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
==User administration settings==&lt;br /&gt;
&lt;br /&gt;
Users can choose whether or not to track unread posts in their profile settings under &#039;Forum tracking&#039;. The settings are:&lt;br /&gt;
&lt;br /&gt;
* Yes: highlight new posts for me&lt;br /&gt;
* No: don&#039;t keep track of posts I have seen&lt;br /&gt;
&lt;br /&gt;
If the user chooses &#039;Yes: highlight new posts for me&#039; and the forum administrator has set the &#039;Read tracking for this forum?&#039; to On or Optional then the user will have new posts highlighted for them. The posts will be highlighted in the following places:&lt;br /&gt;
&lt;br /&gt;
* My home page&lt;br /&gt;
* Course page&lt;br /&gt;
* Within the forum itself&lt;br /&gt;
* In forum discussion threads&lt;br /&gt;
&lt;br /&gt;
[[Image:MoodleDocs forum_show_unread_behaviour.png|frame|center|Show unread on forum page]]&lt;br /&gt;
&lt;br /&gt;
==Site administration settings==&lt;br /&gt;
&lt;br /&gt;
The forum module has additional settings which may be changed by an administrator in &#039;&#039;Administration &amp;gt; Site administration &amp;gt; Plugins &amp;gt; Activity modules &amp;gt; Forum&#039;&#039; and, for &#039;Maximum time to edit posts&#039;, in &#039;&#039;Administration &amp;gt; Site administration &amp;gt; Security &amp;gt; Site policies&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
===Use email address in reply===&lt;br /&gt;
&lt;br /&gt;
By default, a user&#039;s email is set as the &#039;From&#039; address for forum notifications (unless the user has hidden their email address in their profile) so that recipients can choose to reply personally rather than via the forum. To set noreply@yourmoodlesite.org as &#039;From&#039; address for all forum notification emails, untick the forum_replytouser checkbox.&lt;br /&gt;
&lt;br /&gt;
===Long and short posts===&lt;br /&gt;
&lt;br /&gt;
The long and short post setting determine how forum posts on the site front page, social format course pages, and user profiles are displayed. (Note: There is currently an unresolved issue - &amp;quot;Site news - forum length setting has no effect for certain users&amp;quot; - MDL-4781.)&lt;br /&gt;
&lt;br /&gt;
===Enabling timed posts===&lt;br /&gt;
&lt;br /&gt;
Timed forum posts may be enabled i.e. having the option to set a display start and end date for a new discussion. Timed posts can then be created by users with the [[Capabilities/mod/forum:viewhiddentimedposts|capability to view hidden timed posts]] (normally admins and teachers).&lt;br /&gt;
&lt;br /&gt;
===Maximum time to edit posts===&lt;br /&gt;
&lt;br /&gt;
This specifies the amount of time people have to re-edit forum postings, glossary comments etc. Usually 30 minutes is a good value. The setting may be changed by an administrator in &#039;&#039;Administration &amp;gt; Site administration &amp;gt; Security &amp;gt; Site policies&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
===Read tracking===&lt;br /&gt;
{{New features}}&lt;br /&gt;
&lt;br /&gt;
Sets the default read tracking selection when creating new forums. If &#039;Forced&#039; is selected here, but [[#Allow forced read tracking|Allow forced read tracking]] is not enabled, &#039;Optional&#039; will be the default setting.&lt;br /&gt;
&lt;br /&gt;
===Allow forced read tracking===&lt;br /&gt;
{{New features}}&lt;br /&gt;
&lt;br /&gt;
With this option set, &amp;quot;Forced&amp;quot; will be an option for &amp;quot;Read tracking&amp;quot; when creating or editing Forums. Forced forums have read tracking enabled regardless of user preference.&lt;br /&gt;
&lt;br /&gt;
This setting can place additional load on servers. With this setting disabled, users who set their profile setting to not track read posts see faster load times of courses pages. With this setting enabled, that performance increase is lost, and all course views see the same performance as if the users personal setting was on.&lt;br /&gt;
&lt;br /&gt;
When disabled, any forums previously set to &amp;quot;Forced&amp;quot; (or &amp;quot;On&amp;quot; prior to Moodle 2.6) will be treated as optional.&lt;br /&gt;
&lt;br /&gt;
===Mark post read after &#039;X&#039; days===&lt;br /&gt;
&lt;br /&gt;
This setting is forum_oldpostdays and specifies the number of days after which any post is considered to be read. E.g. If this is set to 14 days then any post older than 14 days will be considered read. If you set this to 0 then &#039;&#039;&#039;ALL&#039;&#039;&#039; posts are instantly considered to be read. If you don&#039;t want any posts to be considered read without the user reading them then set a high figure (e.g. 1000) &lt;br /&gt;
&lt;br /&gt;
[[de:Forum konfigurieren]]&lt;br /&gt;
[[fr:Ajouter/modifier un forum]]&lt;br /&gt;
[[ja:フォーラムの追加/編集]]&lt;/div&gt;</summary>
		<author><name>Emerrill</name></author>
	</entry>
	<entry>
		<id>https://docs.moodle.org/39/en/index.php?title=Forum_settings&amp;diff=107137</id>
		<title>Forum settings</title>
		<link rel="alternate" type="text/html" href="https://docs.moodle.org/39/en/index.php?title=Forum_settings&amp;diff=107137"/>
		<updated>2013-10-22T17:09:15Z</updated>

		<summary type="html">&lt;p&gt;Emerrill: /* Read tracking for this forum? */ MDL-29663 Update read tracking options&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Forum}}&lt;br /&gt;
==Adding and editing a forum==&lt;br /&gt;
#With the editing turned on, in the section you wish to add your forum, click the &amp;quot;Add an activity or resource&amp;quot; link (or, if not present, the &amp;quot;Add an activity&amp;quot; drop down menu )and choose &#039;&#039;Forum&#039;&#039;.&lt;br /&gt;
# This will take you to the forum settings page titled &amp;quot;Adding a new forum&amp;quot;. &lt;br /&gt;
&lt;br /&gt;
You can access an existing forum by clicking the configure icon or clicking on the forum and then &#039;&#039;Administration &amp;gt; Forum administration &amp;gt; Edit settings&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
==General==&lt;br /&gt;
{|&lt;br /&gt;
|[[File:forumgeneral25.png|thumb|The General settings, expanded by default.]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
===Forum name===&lt;br /&gt;
A short name of the forum (e.g. &amp;quot;Favourite colour&amp;quot;), which will be displayed on the course homepage.&lt;br /&gt;
===Description===&lt;br /&gt;
Provide instructions for your students here so they are clear what they have to do. Click &amp;quot;Show editing tools&amp;quot; to display the rich text editor and drag the bottom right of the text box out to expand it.&lt;br /&gt;
===Display description on course page===&lt;br /&gt;
Enabling this will display the description on the course page just below the link to the forum.&lt;br /&gt;
===Forum type===&lt;br /&gt;
There are five forum types to choose from:&lt;br /&gt;
&lt;br /&gt;
*A single simple discussion - A single topic discussion developed on one page, which is useful for short focused discussions (cannot be used with separate groups)&lt;br /&gt;
*Standard forum for general use - An open forum where anyone can start a new topic at any time; this is the best general-purpose forum&lt;br /&gt;
*Each person posts one discussion - Each person can post exactly one new discussion topic (everyone can reply to them though); this is useful when you want each student to start a discussion about, say, their reflections on the week&#039;s topic, and everyone else responds to these&lt;br /&gt;
*Q and A Forum - Instead of initiating discussions participants pose a question in the initial post of a discussion. Students may reply with an answer, but they will not see the replies of other Students to the question in that discussion until they have themselves replied to the same discussion.&lt;br /&gt;
*Standard forum displayed in a blog-like format&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Note&#039;&#039;&#039;: [[News forum]] is a special type of forum that is automatically created with a new course.&lt;br /&gt;
&lt;br /&gt;
==Attachments and word count==&lt;br /&gt;
(This setting is collapsed by default)&lt;br /&gt;
&lt;br /&gt;
{|&lt;br /&gt;
|[[File:attachmentsandwordcount.png|thumb|Attachments and word count settings expanded]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Maximum attachment size===&lt;br /&gt;
&lt;br /&gt;
The maximum file size that may be attached to a forum post will first be determined by the Moodle site settings. The teacher may want a smaller size limit for the forum. Server file capacity, student downloading speeds and discouraging images in a document centered discussion are a few reasons to limit file size.&lt;br /&gt;
&lt;br /&gt;
===Maximum number of attachments===&lt;br /&gt;
The maximum number of attachments a user can add to their forum post (from 0 to 100) can be specified here.&lt;br /&gt;
&lt;br /&gt;
===Display word count===&lt;br /&gt;
&lt;br /&gt;
If &amp;quot;Display word count&amp;quot;  is enabled, then the number of words in forum posts will be shown at the bottom of each post.&lt;br /&gt;
&lt;br /&gt;
==Subscription and tracking==&lt;br /&gt;
(This setting is collapsed by default)&lt;br /&gt;
&lt;br /&gt;
{|&lt;br /&gt;
|[[File:subscriptionandtracking.png|thumb|Subscription and tracking settings expanded]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
===Subscription mode===&lt;br /&gt;
&lt;br /&gt;
When a user is subscribed to a forum it means that they will receive notification (via popup and/or email, depending on the user’s messaging settings preferences) of each new posting. By default, posts are recorded about 30 minutes after the post was first written. Depending upon the email settings of each forum member, they may be sent an email immediately after the 30 minute edit window is closed, or in a batch at a time fixed by the site administrator (see below).&lt;br /&gt;
&lt;br /&gt;
People can usually choose whether or not they want to be subscribed to each forum. However, the teacher can choose to force subscription on a particular forum then all course users will be subscribed automatically, even those that enrol at a later time. &lt;br /&gt;
&lt;br /&gt;
There are 4 subscription mode options:&lt;br /&gt;
* Optional subscription - Participants can choose whether to be subscribed&lt;br /&gt;
* Forced subscription - Everyone is subscribed and cannot unsubscribe&lt;br /&gt;
* Auto subscription - Everyone is subscribed initially but can choose to unsubscribe at any time&lt;br /&gt;
* Subscription disabled - Subscriptions are not allowed.  &lt;br /&gt;
&lt;br /&gt;
The subscription mode and subscribe or unsubscribe links appear in&#039;&#039; Navigation&amp;gt;Forum administration&#039;&#039; when viewing the forum.  teachers can quickly change the mode via the &#039;Subscription mode&#039; options and view the current subscribers via the &#039;Show/edit current subscribers&#039; link.&lt;br /&gt;
&lt;br /&gt;
Tips:&lt;br /&gt;
* Forcing everyone to subscribe is especially useful in the news forum and in forums towards the beginning of the course (before everyone has worked out that they can subscribe to these emails themselves).&lt;br /&gt;
* Changing the setting from &amp;quot;Yes, initially&amp;quot; to &amp;quot;No&amp;quot; will not unsubscribe existing users; it will only affect those who enrol in the course in the future. Similarly changing &amp;quot;Yes, initially&amp;quot; will not subscribe existing course users but only those enrolling later.&lt;br /&gt;
* There is also a &amp;quot;Subscriptions not allowed&amp;quot; setting which prevents Students from subscribing to a Forum. Teachers may choose to subscribe to a forum if they wish.&lt;br /&gt;
&lt;br /&gt;
===Read tracking for this forum?===&lt;br /&gt;
&lt;br /&gt;
&amp;quot;Read tracking&amp;quot; for a forum allows users to track read and unread forum posts. &lt;br /&gt;
[[File:forum administration.png|thumb|Don&#039;t track unread posts link]]&lt;br /&gt;
There are three options for this setting:&lt;br /&gt;
* Optional - Students can turn tracking on or off for the forum via a link &#039;Track / Don&#039;t track unread posts&#039; in &#039;&#039;Administration &amp;gt; Forum administration&#039;&#039;, or via their profile &#039;Forum Tracking&#039; option.&lt;br /&gt;
* Off - It is not possible to track unread forum posts&lt;br /&gt;
* Forced - Tracking is always on in this forum, regardless of user preference or setting. No link in is present in &#039;&#039;Administration &amp;gt; Forum administration&#039;&#039;. This setting is only available when the &#039;Allow forced read tracking&#039; administrative setting is enabled.&lt;br /&gt;
&lt;br /&gt;
==RSS==&lt;br /&gt;
(This setting is collapsed by default and will only appear if RSS has been enabled sitewide and for forums)&lt;br /&gt;
&lt;br /&gt;
{|&lt;br /&gt;
|[[File:rss25.png|thumb|RSS settings expanded]]&lt;br /&gt;
|}&lt;br /&gt;
===RSS feed for this activity===&lt;br /&gt;
&lt;br /&gt;
This turns RSS on or off for this forum. When set to “None,” RSS is disabled. When set to “Discussions,” the RSS feed will send out new discussions to subscribers. When set to “Posts,” the RSS feed will send out any new posts to subscribers. &lt;br /&gt;
&lt;br /&gt;
===Number of RSS recent articles===&lt;br /&gt;
&lt;br /&gt;
This number sets the number of articles that go out via RSS. If this number is set to 5, then the 5 most recent articles will be sent to subscribers. As new posts (or discussions) get added, the oldest post/discussion gets replaced on the RSS feed. If your forum gets a lot of posts every day, you will want to set this number high.&lt;br /&gt;
&lt;br /&gt;
The administrative cron (admin/cron.php) must run after the forum is created and posts or discussions have been made.  Otherwise the user will receive an error &amp;quot;Error reading RSS data&amp;quot;&lt;br /&gt;
&lt;br /&gt;
==Post threshold for blocking==&lt;br /&gt;
(This setting is collapsed by default)&lt;br /&gt;
&lt;br /&gt;
{|&lt;br /&gt;
|[[File:postthresholdforblocking.png|thumb|Post threshold for blocking settings expanded]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
===Time period for blocking===&lt;br /&gt;
Choose here the time period in which can be blocked from posting more than a given number of posts. (To make a user exempt, give them the capability &#039;&#039;mod/forum:postwithoutthrottling&#039;&#039;)&lt;br /&gt;
===Post threshold for blocking===&lt;br /&gt;
Set the number of posts here that users may add before they are blocked.&lt;br /&gt;
===Post threshold for warning===&lt;br /&gt;
Set the number of posts here after which users will be warned they are about to be blocked.&lt;br /&gt;
&lt;br /&gt;
==Grade==&lt;br /&gt;
(This setting is collapsed by default)&lt;br /&gt;
Choose the category in which this forum will appear if ratings are enabled.&lt;br /&gt;
&lt;br /&gt;
==Ratings==&lt;br /&gt;
(This setting is collapsed by default)&lt;br /&gt;
&lt;br /&gt;
{|&lt;br /&gt;
|[[File:ratings25.png|thumb|Ratings settings expanded]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
===Roles with permissions to rate===&lt;br /&gt;
Forum posts can be rated using a [[Scales|scale]]. By default, only teachers can rate forum posts, though students can be given permission to do so if desired (see Forum permissions below). This is a useful tool for giving students participation grades. Any ratings given in the forum are recorded in the [[Gradebook|gradebook]].&lt;br /&gt;
&lt;br /&gt;
===Aggregate type===&lt;br /&gt;
&lt;br /&gt;
You can set an aggregate type, in other words, decide how all the ratings given to posts in a forum are combined to form the final grade (for each post and for the whole forum activity). Some scales do not lend themselves to certain types of aggregates. There are five options:&lt;br /&gt;
&lt;br /&gt;
* Average of ratings (default) - This is the mean of all the ratings given to posts in that forum. It is especially useful with peer grading when there are a lot of ratings being made.&lt;br /&gt;
* Count of ratings - The counts the number of rated posts which becomes the final grade. This is useful when the number of posts is important. Note that the total can not exceed the maximum grade allowed for the forum. A count may be used if the teacher simply wants to acknowledge that a reply was given in the case students being required to make a certain number of posts in the discussion. Note: Count of ratings does not work for the &amp;quot;Separate or Connected Ways of Knowing&amp;quot; scale or custom scales due to the limitation imposed by the max grade.&lt;br /&gt;
* Maximum rating - The highest rating is returned as the final grade. This method is useful for emphasising the best work from participants, allowing them to post one high-quality post as well as a number of more casual responses to others.&lt;br /&gt;
* Minimum rating - The smallest rating is returned as the final grade. This method promotes a culture of high quality for all posts.&lt;br /&gt;
* Sum of ratings - All the ratings for a particular user are added together. Note that the total is not allowed to exceed the maximum grade for the forum. Note: Sum of ratings does not work for the &amp;quot;Separate or Connected Ways of Knowing&amp;quot; scale or custom scales due to the limitation imposed by the max grade.&lt;br /&gt;
&lt;br /&gt;
===Restrict ratings to items with dates in this range===&lt;br /&gt;
The teacher can allow only posts within a certain date range to be rated. This is useful if the teacher wants to keep students focused on the most recent content and maintain a specific pace within the forum or course.&lt;br /&gt;
&lt;br /&gt;
===RSS feed for this activity===&lt;br /&gt;
&lt;br /&gt;
This turns RSS on or off for this forum. When set to “None,” RSS is disabled. When set to “Discussions,” the RSS feed will send out new discussions to subscribers. When set to “Posts,” the RSS feed will send out any new posts to subscribers. &lt;br /&gt;
&lt;br /&gt;
===Number of RSS recent articles===&lt;br /&gt;
&lt;br /&gt;
This number sets the number of articles that go out via RSS. If this number is set to 5, then the 5 most recent articles will be sent to subscribers. As new posts (or discussions) get added, the oldest post/discussion gets replaced on the RSS feed. If your forum gets a lot of posts every day, you will want to set this number high.&lt;br /&gt;
&lt;br /&gt;
The administrative cron (admin/cron.php) must run after the forum is created and posts or discussions have been made.  Otherwise the user will receive an error &amp;quot;Error reading RSS data&amp;quot;&lt;br /&gt;
&lt;br /&gt;
Note: [[RSS feeds]] must be enabled for the site and for forums in order for the RSS settings to appear.&lt;br /&gt;
&lt;br /&gt;
==Common module settings==&lt;br /&gt;
(These settings are collapsed by default)&lt;br /&gt;
&lt;br /&gt;
{|&lt;br /&gt;
|[[File:cm25.png|thumb|Common module settings expanded]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
See [[Common module settings]] for more information, but note the details below relating specifically to use of forums with groups.&lt;br /&gt;
&lt;br /&gt;
===Group mode===&lt;br /&gt;
&lt;br /&gt;
The &#039;&#039;&#039;group mode&#039;&#039;&#039; setting has three options:&lt;br /&gt;
&lt;br /&gt;
# No groups&lt;br /&gt;
# Separate groups - each group can only see their own group; others are invisible&lt;br /&gt;
# Visible groups - each group works in their own group, but can also see other groups&lt;br /&gt;
&lt;br /&gt;
If the group mode is set to separate groups:&lt;br /&gt;
{|&lt;br /&gt;
|[[File:groupsforum.gif|401x|thumb|Adding a new discussion topic to a forum set to separate groups]]&lt;br /&gt;
|}&lt;br /&gt;
* Teachers are given the option of adding a new discussion topic for all participants or for a selected group. If a teacher adds a new discussion topic for a selected group, then only group members can reply to it. If a teacher adds a new discussion topic for all participants, then students can&#039;t reply to it. (This is to ensure that groups are kept separate.)&lt;br /&gt;
* Students can only start discussions for their own group.&lt;br /&gt;
* Students can only reply to discussions started by other group members or discussions for their own group started by a teacher.&lt;br /&gt;
&lt;br /&gt;
If the group mode is set to visible groups:&lt;br /&gt;
&lt;br /&gt;
* Teachers are given the option of adding a new discussion topic for all participants or for a selected group. If a teacher adds a new discussion topic for a selected group, then only group members can reply to it.&lt;br /&gt;
* Students can only start discussions for their own group.&lt;br /&gt;
* Students can only reply to discussions started by other group members or teachers.&lt;br /&gt;
&lt;br /&gt;
Teachers, and other users with the capability [[Capabilities/moodle/site:accessallgroups|moodle/site:accessallgroups]] set to allow, can view and post in all forum discussions, regardless of the group mode setting.&lt;br /&gt;
&lt;br /&gt;
:&#039;&#039;Note&#039;&#039;: Single simple discussions cannot be set to separate groups (as this feature is not implemented). Instead, a standard forum should be used, with the teacher copying and pasting the same discussion topic for each separate group. If required, a permissions override may be set to prevent students from starting new discussions.&lt;br /&gt;
&lt;br /&gt;
==Restrict access/Activity completion==&lt;br /&gt;
(These settings are collapsed by default)&lt;br /&gt;
&lt;br /&gt;
These settings are visible if [[Conditional activities]] and [[Activity completion]] have been enabled in the site and the course.&lt;br /&gt;
&lt;br /&gt;
==Locally assigned roles==&lt;br /&gt;
&lt;br /&gt;
In &#039;&#039;Administration &amp;gt; Forum administration &amp;gt; Locally assigned roles&#039;&#039; selected users can be given additional roles in the activity.&lt;br /&gt;
&lt;br /&gt;
===Forum moderator===&lt;br /&gt;
&lt;br /&gt;
A student can be given the rights to moderate a forum by assigning them the role of non-editing teacher in the forum.&lt;br /&gt;
&lt;br /&gt;
# In &#039;&#039;Settings &amp;gt; Forum administration &amp;gt; Locally assigned roles&#039;&#039; click on student&lt;br /&gt;
# Select the student from the potential users list on the right, and use the Add button to add them to the existing users list on the left. Multiple users may be selected by holding down the Apple or Ctrl key whilst clicking on the users&#039; names. &lt;br /&gt;
&lt;br /&gt;
See also [[Forum moderator role]].&lt;br /&gt;
&lt;br /&gt;
==Forum permissions==&lt;br /&gt;
&lt;br /&gt;
Role permissions for the activity can be changed in &#039;&#039;Administration &amp;gt; Forum administration &amp;gt; Permissions&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
[[File:Forum permissions.png|Frame|]]&lt;br /&gt;
&lt;br /&gt;
Common permissions changes include:&lt;br /&gt;
&lt;br /&gt;
===Enabling students to rate posts===&lt;br /&gt;
&lt;br /&gt;
Click the Allow icon (+) opposite the capability to rate posts and allow the role of student.&lt;br /&gt;
&lt;br /&gt;
===Archiving a forum===&lt;br /&gt;
&lt;br /&gt;
A forum can be closed / archived so that students may no longer start new discussions, nor add replies, but can still read all the discussions by clicking the Prevent icon (X) for the student role for the capabilities &#039;Start new discussions&#039; and &#039;Reply to posts&#039;.&lt;br /&gt;
&lt;br /&gt;
===Guests and posting in a forum===&lt;br /&gt;
&lt;br /&gt;
There are certain things, such as posting in a forum, that guests are never allowed to do, despite the permissions interface suggesting otherwise.&lt;br /&gt;
&lt;br /&gt;
The guest role has some special functionality, for example when a guest user attempts to post in a forum, they obtain the message &amp;quot;Sorry, guests are not allowed to post. Would you like to log in now with a full user account?&amp;quot;&lt;br /&gt;
&lt;br /&gt;
(Note: If guests don&#039;t obtain the  &amp;quot;Sorry, guests are not allowed to post&amp;quot; message because they have no reply link, then self enrolment needs enabling in &#039;&#039;Settings &amp;gt; Course administration &amp;gt; Users &amp;gt; Enrolment methods&#039;&#039;.)&lt;br /&gt;
&lt;br /&gt;
If you wish guests to be able to post in a forum, you can [[Manage roles|create a similar role]], say &amp;quot;visitor&amp;quot; with very few permissions allowed, then create an account and assign it the role of visitor. Guests can then share this visitor account.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Anything else you&#039;d like to achieve with a forum permissions change? Please add your suggestions to [[Talk:Forum settings]]!&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
==User administration settings==&lt;br /&gt;
&lt;br /&gt;
Users can choose whether or not to track unread posts in their profile settings under &#039;Forum tracking&#039;. The settings are:&lt;br /&gt;
&lt;br /&gt;
* Yes: highlight new posts for me&lt;br /&gt;
* No: don&#039;t keep track of posts I have seen&lt;br /&gt;
&lt;br /&gt;
If the user chooses &#039;Yes: highlight new posts for me&#039; and the forum administrator has set the &#039;Read tracking for this forum?&#039; to On or Optional then the user will have new posts highlighted for them. The posts will be highlighted in the following places:&lt;br /&gt;
&lt;br /&gt;
* My home page&lt;br /&gt;
* Course page&lt;br /&gt;
* Within the forum itself&lt;br /&gt;
* In forum discussion threads&lt;br /&gt;
&lt;br /&gt;
[[Image:MoodleDocs forum_show_unread_behaviour.png|frame|center|Show unread on forum page]]&lt;br /&gt;
&lt;br /&gt;
==Site administration settings==&lt;br /&gt;
&lt;br /&gt;
The forum module has additional settings which may be changed by an administrator in &#039;&#039;Administration &amp;gt; Site administration &amp;gt; Plugins &amp;gt; Activity modules &amp;gt; Forum&#039;&#039; and, for &#039;Maximum time to edit posts&#039;, in &#039;&#039;Administration &amp;gt; Site administration &amp;gt; Security &amp;gt; Site policies&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
===Use email address in reply===&lt;br /&gt;
&lt;br /&gt;
By default, a user&#039;s email is set as the &#039;From&#039; address for forum notifications (unless the user has hidden their email address in their profile) so that recipients can choose to reply personally rather than via the forum. To set noreply@yourmoodlesite.org as &#039;From&#039; address for all forum notification emails, untick the forum_replytouser checkbox.&lt;br /&gt;
&lt;br /&gt;
===Long and short posts===&lt;br /&gt;
&lt;br /&gt;
The long and short post setting determine how forum posts on the site front page, social format course pages, and user profiles are displayed. (Note: There is currently an unresolved issue - &amp;quot;Site news - forum length setting has no effect for certain users&amp;quot; - MDL-4781.)&lt;br /&gt;
&lt;br /&gt;
===Enabling timed posts===&lt;br /&gt;
&lt;br /&gt;
Timed forum posts may be enabled i.e. having the option to set a display start and end date for a new discussion. Timed posts can then be created by users with the [[Capabilities/mod/forum:viewhiddentimedposts|capability to view hidden timed posts]] (normally admins and teachers).&lt;br /&gt;
&lt;br /&gt;
===Maximum time to edit posts===&lt;br /&gt;
&lt;br /&gt;
This specifies the amount of time people have to re-edit forum postings, glossary comments etc. Usually 30 minutes is a good value. The setting may be changed by an administrator in &#039;&#039;Administration &amp;gt; Site administration &amp;gt; Security &amp;gt; Site policies&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
===Allow forced read tracking===&lt;br /&gt;
{{New features}}&lt;br /&gt;
&lt;br /&gt;
With this option set, &amp;quot;Forced&amp;quot; will be an option for &amp;quot;Read tracking&amp;quot; when creating or editing Forums. Forced forums have read tracking enabled regardless of user preference.&lt;br /&gt;
&lt;br /&gt;
This setting can place additional load on servers. With this setting disabled, users who set their profile setting to not track read posts see faster load times of courses pages. With this setting enabled, that performance increase is lost, and all course views see the same performance as if the users personal setting was on.&lt;br /&gt;
&lt;br /&gt;
When disabled, any forums previously set to &amp;quot;Forced&amp;quot; (or &amp;quot;On&amp;quot; prior to Moodle 2.6) will be treated as optional.&lt;br /&gt;
&lt;br /&gt;
===Mark post read after &#039;X&#039; days===&lt;br /&gt;
&lt;br /&gt;
This setting is forum_oldpostdays and specifies the number of days after which any post is considered to be read. E.g. If this is set to 14 days then any post older than 14 days will be considered read. If you set this to 0 then &#039;&#039;&#039;ALL&#039;&#039;&#039; posts are instantly considered to be read. If you don&#039;t want any posts to be considered read without the user reading them then set a high figure (e.g. 1000) &lt;br /&gt;
&lt;br /&gt;
[[de:Forum konfigurieren]]&lt;br /&gt;
[[fr:Ajouter/modifier un forum]]&lt;br /&gt;
[[ja:フォーラムの追加/編集]]&lt;/div&gt;</summary>
		<author><name>Emerrill</name></author>
	</entry>
	<entry>
		<id>https://docs.moodle.org/39/en/index.php?title=Forum_settings&amp;diff=107135</id>
		<title>Forum settings</title>
		<link rel="alternate" type="text/html" href="https://docs.moodle.org/39/en/index.php?title=Forum_settings&amp;diff=107135"/>
		<updated>2013-10-22T17:00:11Z</updated>

		<summary type="html">&lt;p&gt;Emerrill: /* Site administration settings */ MDL-29663 New admin setting for forced read tracking&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Forum}}&lt;br /&gt;
==Adding and editing a forum==&lt;br /&gt;
#With the editing turned on, in the section you wish to add your forum, click the &amp;quot;Add an activity or resource&amp;quot; link (or, if not present, the &amp;quot;Add an activity&amp;quot; drop down menu )and choose &#039;&#039;Forum&#039;&#039;.&lt;br /&gt;
# This will take you to the forum settings page titled &amp;quot;Adding a new forum&amp;quot;. &lt;br /&gt;
&lt;br /&gt;
You can access an existing forum by clicking the configure icon or clicking on the forum and then &#039;&#039;Administration &amp;gt; Forum administration &amp;gt; Edit settings&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
==General==&lt;br /&gt;
{|&lt;br /&gt;
|[[File:forumgeneral25.png|thumb|The General settings, expanded by default.]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
===Forum name===&lt;br /&gt;
A short name of the forum (e.g. &amp;quot;Favourite colour&amp;quot;), which will be displayed on the course homepage.&lt;br /&gt;
===Description===&lt;br /&gt;
Provide instructions for your students here so they are clear what they have to do. Click &amp;quot;Show editing tools&amp;quot; to display the rich text editor and drag the bottom right of the text box out to expand it.&lt;br /&gt;
===Display description on course page===&lt;br /&gt;
Enabling this will display the description on the course page just below the link to the forum.&lt;br /&gt;
===Forum type===&lt;br /&gt;
There are five forum types to choose from:&lt;br /&gt;
&lt;br /&gt;
*A single simple discussion - A single topic discussion developed on one page, which is useful for short focused discussions (cannot be used with separate groups)&lt;br /&gt;
*Standard forum for general use - An open forum where anyone can start a new topic at any time; this is the best general-purpose forum&lt;br /&gt;
*Each person posts one discussion - Each person can post exactly one new discussion topic (everyone can reply to them though); this is useful when you want each student to start a discussion about, say, their reflections on the week&#039;s topic, and everyone else responds to these&lt;br /&gt;
*Q and A Forum - Instead of initiating discussions participants pose a question in the initial post of a discussion. Students may reply with an answer, but they will not see the replies of other Students to the question in that discussion until they have themselves replied to the same discussion.&lt;br /&gt;
*Standard forum displayed in a blog-like format&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Note&#039;&#039;&#039;: [[News forum]] is a special type of forum that is automatically created with a new course.&lt;br /&gt;
&lt;br /&gt;
==Attachments and word count==&lt;br /&gt;
(This setting is collapsed by default)&lt;br /&gt;
&lt;br /&gt;
{|&lt;br /&gt;
|[[File:attachmentsandwordcount.png|thumb|Attachments and word count settings expanded]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Maximum attachment size===&lt;br /&gt;
&lt;br /&gt;
The maximum file size that may be attached to a forum post will first be determined by the Moodle site settings. The teacher may want a smaller size limit for the forum. Server file capacity, student downloading speeds and discouraging images in a document centered discussion are a few reasons to limit file size.&lt;br /&gt;
&lt;br /&gt;
===Maximum number of attachments===&lt;br /&gt;
The maximum number of attachments a user can add to their forum post (from 0 to 100) can be specified here.&lt;br /&gt;
&lt;br /&gt;
===Display word count===&lt;br /&gt;
&lt;br /&gt;
If &amp;quot;Display word count&amp;quot;  is enabled, then the number of words in forum posts will be shown at the bottom of each post.&lt;br /&gt;
&lt;br /&gt;
==Subscription and tracking==&lt;br /&gt;
(This setting is collapsed by default)&lt;br /&gt;
&lt;br /&gt;
{|&lt;br /&gt;
|[[File:subscriptionandtracking.png|thumb|Subscription and tracking settings expanded]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
===Subscription mode===&lt;br /&gt;
&lt;br /&gt;
When a user is subscribed to a forum it means that they will receive notification (via popup and/or email, depending on the user’s messaging settings preferences) of each new posting. By default, posts are recorded about 30 minutes after the post was first written. Depending upon the email settings of each forum member, they may be sent an email immediately after the 30 minute edit window is closed, or in a batch at a time fixed by the site administrator (see below).&lt;br /&gt;
&lt;br /&gt;
People can usually choose whether or not they want to be subscribed to each forum. However, the teacher can choose to force subscription on a particular forum then all course users will be subscribed automatically, even those that enrol at a later time. &lt;br /&gt;
&lt;br /&gt;
There are 4 subscription mode options:&lt;br /&gt;
* Optional subscription - Participants can choose whether to be subscribed&lt;br /&gt;
* Forced subscription - Everyone is subscribed and cannot unsubscribe&lt;br /&gt;
* Auto subscription - Everyone is subscribed initially but can choose to unsubscribe at any time&lt;br /&gt;
* Subscription disabled - Subscriptions are not allowed.  &lt;br /&gt;
&lt;br /&gt;
The subscription mode and subscribe or unsubscribe links appear in&#039;&#039; Navigation&amp;gt;Forum administration&#039;&#039; when viewing the forum.  teachers can quickly change the mode via the &#039;Subscription mode&#039; options and view the current subscribers via the &#039;Show/edit current subscribers&#039; link.&lt;br /&gt;
&lt;br /&gt;
Tips:&lt;br /&gt;
* Forcing everyone to subscribe is especially useful in the news forum and in forums towards the beginning of the course (before everyone has worked out that they can subscribe to these emails themselves).&lt;br /&gt;
* Changing the setting from &amp;quot;Yes, initially&amp;quot; to &amp;quot;No&amp;quot; will not unsubscribe existing users; it will only affect those who enrol in the course in the future. Similarly changing &amp;quot;Yes, initially&amp;quot; will not subscribe existing course users but only those enrolling later.&lt;br /&gt;
* There is also a &amp;quot;Subscriptions not allowed&amp;quot; setting which prevents Students from subscribing to a Forum. Teachers may choose to subscribe to a forum if they wish.&lt;br /&gt;
&lt;br /&gt;
===Read tracking for this forum?===&lt;br /&gt;
&lt;br /&gt;
&amp;quot;Read tracking&amp;quot; for a forum allows users to track read and unread forum posts. &lt;br /&gt;
[[File:forum administration.png|thumb|Don&#039;t track unread posts link]]&lt;br /&gt;
There are three options for this setting:&lt;br /&gt;
* Optional (default) - Students can turn tracking on or off for the forum via a link &#039;Track / Don&#039;t track unread posts&#039; in &#039;&#039;Administration &amp;gt; Forum administration&#039;&#039;&lt;br /&gt;
* On - Tracking is always on in this forum (so no link in &#039;&#039;Administration &amp;gt; Forum administration&#039;&#039;)&lt;br /&gt;
* Off - It is not possible to track unread forum posts&lt;br /&gt;
&lt;br /&gt;
Note: The first two options require users to also have forum tracking set to yes in their profile settings. Currently the forum tracking profile setting overrides the read tracking forum setting. This problem has been reported in the tracker as MDL-29663.&lt;br /&gt;
&lt;br /&gt;
==RSS==&lt;br /&gt;
(This setting is collapsed by default and will only appear if RSS has been enabled sitewide and for forums)&lt;br /&gt;
&lt;br /&gt;
{|&lt;br /&gt;
|[[File:rss25.png|thumb|RSS settings expanded]]&lt;br /&gt;
|}&lt;br /&gt;
===RSS feed for this activity===&lt;br /&gt;
&lt;br /&gt;
This turns RSS on or off for this forum. When set to “None,” RSS is disabled. When set to “Discussions,” the RSS feed will send out new discussions to subscribers. When set to “Posts,” the RSS feed will send out any new posts to subscribers. &lt;br /&gt;
&lt;br /&gt;
===Number of RSS recent articles===&lt;br /&gt;
&lt;br /&gt;
This number sets the number of articles that go out via RSS. If this number is set to 5, then the 5 most recent articles will be sent to subscribers. As new posts (or discussions) get added, the oldest post/discussion gets replaced on the RSS feed. If your forum gets a lot of posts every day, you will want to set this number high.&lt;br /&gt;
&lt;br /&gt;
The administrative cron (admin/cron.php) must run after the forum is created and posts or discussions have been made.  Otherwise the user will receive an error &amp;quot;Error reading RSS data&amp;quot;&lt;br /&gt;
&lt;br /&gt;
==Post threshold for blocking==&lt;br /&gt;
(This setting is collapsed by default)&lt;br /&gt;
&lt;br /&gt;
{|&lt;br /&gt;
|[[File:postthresholdforblocking.png|thumb|Post threshold for blocking settings expanded]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
===Time period for blocking===&lt;br /&gt;
Choose here the time period in which can be blocked from posting more than a given number of posts. (To make a user exempt, give them the capability &#039;&#039;mod/forum:postwithoutthrottling&#039;&#039;)&lt;br /&gt;
===Post threshold for blocking===&lt;br /&gt;
Set the number of posts here that users may add before they are blocked.&lt;br /&gt;
===Post threshold for warning===&lt;br /&gt;
Set the number of posts here after which users will be warned they are about to be blocked.&lt;br /&gt;
&lt;br /&gt;
==Grade==&lt;br /&gt;
(This setting is collapsed by default)&lt;br /&gt;
Choose the category in which this forum will appear if ratings are enabled.&lt;br /&gt;
&lt;br /&gt;
==Ratings==&lt;br /&gt;
(This setting is collapsed by default)&lt;br /&gt;
&lt;br /&gt;
{|&lt;br /&gt;
|[[File:ratings25.png|thumb|Ratings settings expanded]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
===Roles with permissions to rate===&lt;br /&gt;
Forum posts can be rated using a [[Scales|scale]]. By default, only teachers can rate forum posts, though students can be given permission to do so if desired (see Forum permissions below). This is a useful tool for giving students participation grades. Any ratings given in the forum are recorded in the [[Gradebook|gradebook]].&lt;br /&gt;
&lt;br /&gt;
===Aggregate type===&lt;br /&gt;
&lt;br /&gt;
You can set an aggregate type, in other words, decide how all the ratings given to posts in a forum are combined to form the final grade (for each post and for the whole forum activity). Some scales do not lend themselves to certain types of aggregates. There are five options:&lt;br /&gt;
&lt;br /&gt;
* Average of ratings (default) - This is the mean of all the ratings given to posts in that forum. It is especially useful with peer grading when there are a lot of ratings being made.&lt;br /&gt;
* Count of ratings - The counts the number of rated posts which becomes the final grade. This is useful when the number of posts is important. Note that the total can not exceed the maximum grade allowed for the forum. A count may be used if the teacher simply wants to acknowledge that a reply was given in the case students being required to make a certain number of posts in the discussion. Note: Count of ratings does not work for the &amp;quot;Separate or Connected Ways of Knowing&amp;quot; scale or custom scales due to the limitation imposed by the max grade.&lt;br /&gt;
* Maximum rating - The highest rating is returned as the final grade. This method is useful for emphasising the best work from participants, allowing them to post one high-quality post as well as a number of more casual responses to others.&lt;br /&gt;
* Minimum rating - The smallest rating is returned as the final grade. This method promotes a culture of high quality for all posts.&lt;br /&gt;
* Sum of ratings - All the ratings for a particular user are added together. Note that the total is not allowed to exceed the maximum grade for the forum. Note: Sum of ratings does not work for the &amp;quot;Separate or Connected Ways of Knowing&amp;quot; scale or custom scales due to the limitation imposed by the max grade.&lt;br /&gt;
&lt;br /&gt;
===Restrict ratings to items with dates in this range===&lt;br /&gt;
The teacher can allow only posts within a certain date range to be rated. This is useful if the teacher wants to keep students focused on the most recent content and maintain a specific pace within the forum or course.&lt;br /&gt;
&lt;br /&gt;
===RSS feed for this activity===&lt;br /&gt;
&lt;br /&gt;
This turns RSS on or off for this forum. When set to “None,” RSS is disabled. When set to “Discussions,” the RSS feed will send out new discussions to subscribers. When set to “Posts,” the RSS feed will send out any new posts to subscribers. &lt;br /&gt;
&lt;br /&gt;
===Number of RSS recent articles===&lt;br /&gt;
&lt;br /&gt;
This number sets the number of articles that go out via RSS. If this number is set to 5, then the 5 most recent articles will be sent to subscribers. As new posts (or discussions) get added, the oldest post/discussion gets replaced on the RSS feed. If your forum gets a lot of posts every day, you will want to set this number high.&lt;br /&gt;
&lt;br /&gt;
The administrative cron (admin/cron.php) must run after the forum is created and posts or discussions have been made.  Otherwise the user will receive an error &amp;quot;Error reading RSS data&amp;quot;&lt;br /&gt;
&lt;br /&gt;
Note: [[RSS feeds]] must be enabled for the site and for forums in order for the RSS settings to appear.&lt;br /&gt;
&lt;br /&gt;
==Common module settings==&lt;br /&gt;
(These settings are collapsed by default)&lt;br /&gt;
&lt;br /&gt;
{|&lt;br /&gt;
|[[File:cm25.png|thumb|Common module settings expanded]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
See [[Common module settings]] for more information, but note the details below relating specifically to use of forums with groups.&lt;br /&gt;
&lt;br /&gt;
===Group mode===&lt;br /&gt;
&lt;br /&gt;
The &#039;&#039;&#039;group mode&#039;&#039;&#039; setting has three options:&lt;br /&gt;
&lt;br /&gt;
# No groups&lt;br /&gt;
# Separate groups - each group can only see their own group; others are invisible&lt;br /&gt;
# Visible groups - each group works in their own group, but can also see other groups&lt;br /&gt;
&lt;br /&gt;
If the group mode is set to separate groups:&lt;br /&gt;
{|&lt;br /&gt;
|[[File:groupsforum.gif|401x|thumb|Adding a new discussion topic to a forum set to separate groups]]&lt;br /&gt;
|}&lt;br /&gt;
* Teachers are given the option of adding a new discussion topic for all participants or for a selected group. If a teacher adds a new discussion topic for a selected group, then only group members can reply to it. If a teacher adds a new discussion topic for all participants, then students can&#039;t reply to it. (This is to ensure that groups are kept separate.)&lt;br /&gt;
* Students can only start discussions for their own group.&lt;br /&gt;
* Students can only reply to discussions started by other group members or discussions for their own group started by a teacher.&lt;br /&gt;
&lt;br /&gt;
If the group mode is set to visible groups:&lt;br /&gt;
&lt;br /&gt;
* Teachers are given the option of adding a new discussion topic for all participants or for a selected group. If a teacher adds a new discussion topic for a selected group, then only group members can reply to it.&lt;br /&gt;
* Students can only start discussions for their own group.&lt;br /&gt;
* Students can only reply to discussions started by other group members or teachers.&lt;br /&gt;
&lt;br /&gt;
Teachers, and other users with the capability [[Capabilities/moodle/site:accessallgroups|moodle/site:accessallgroups]] set to allow, can view and post in all forum discussions, regardless of the group mode setting.&lt;br /&gt;
&lt;br /&gt;
:&#039;&#039;Note&#039;&#039;: Single simple discussions cannot be set to separate groups (as this feature is not implemented). Instead, a standard forum should be used, with the teacher copying and pasting the same discussion topic for each separate group. If required, a permissions override may be set to prevent students from starting new discussions.&lt;br /&gt;
&lt;br /&gt;
==Restrict access/Activity completion==&lt;br /&gt;
(These settings are collapsed by default)&lt;br /&gt;
&lt;br /&gt;
These settings are visible if [[Conditional activities]] and [[Activity completion]] have been enabled in the site and the course.&lt;br /&gt;
&lt;br /&gt;
==Locally assigned roles==&lt;br /&gt;
&lt;br /&gt;
In &#039;&#039;Administration &amp;gt; Forum administration &amp;gt; Locally assigned roles&#039;&#039; selected users can be given additional roles in the activity.&lt;br /&gt;
&lt;br /&gt;
===Forum moderator===&lt;br /&gt;
&lt;br /&gt;
A student can be given the rights to moderate a forum by assigning them the role of non-editing teacher in the forum.&lt;br /&gt;
&lt;br /&gt;
# In &#039;&#039;Settings &amp;gt; Forum administration &amp;gt; Locally assigned roles&#039;&#039; click on student&lt;br /&gt;
# Select the student from the potential users list on the right, and use the Add button to add them to the existing users list on the left. Multiple users may be selected by holding down the Apple or Ctrl key whilst clicking on the users&#039; names. &lt;br /&gt;
&lt;br /&gt;
See also [[Forum moderator role]].&lt;br /&gt;
&lt;br /&gt;
==Forum permissions==&lt;br /&gt;
&lt;br /&gt;
Role permissions for the activity can be changed in &#039;&#039;Administration &amp;gt; Forum administration &amp;gt; Permissions&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
[[File:Forum permissions.png|Frame|]]&lt;br /&gt;
&lt;br /&gt;
Common permissions changes include:&lt;br /&gt;
&lt;br /&gt;
===Enabling students to rate posts===&lt;br /&gt;
&lt;br /&gt;
Click the Allow icon (+) opposite the capability to rate posts and allow the role of student.&lt;br /&gt;
&lt;br /&gt;
===Archiving a forum===&lt;br /&gt;
&lt;br /&gt;
A forum can be closed / archived so that students may no longer start new discussions, nor add replies, but can still read all the discussions by clicking the Prevent icon (X) for the student role for the capabilities &#039;Start new discussions&#039; and &#039;Reply to posts&#039;.&lt;br /&gt;
&lt;br /&gt;
===Guests and posting in a forum===&lt;br /&gt;
&lt;br /&gt;
There are certain things, such as posting in a forum, that guests are never allowed to do, despite the permissions interface suggesting otherwise.&lt;br /&gt;
&lt;br /&gt;
The guest role has some special functionality, for example when a guest user attempts to post in a forum, they obtain the message &amp;quot;Sorry, guests are not allowed to post. Would you like to log in now with a full user account?&amp;quot;&lt;br /&gt;
&lt;br /&gt;
(Note: If guests don&#039;t obtain the  &amp;quot;Sorry, guests are not allowed to post&amp;quot; message because they have no reply link, then self enrolment needs enabling in &#039;&#039;Settings &amp;gt; Course administration &amp;gt; Users &amp;gt; Enrolment methods&#039;&#039;.)&lt;br /&gt;
&lt;br /&gt;
If you wish guests to be able to post in a forum, you can [[Manage roles|create a similar role]], say &amp;quot;visitor&amp;quot; with very few permissions allowed, then create an account and assign it the role of visitor. Guests can then share this visitor account.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Anything else you&#039;d like to achieve with a forum permissions change? Please add your suggestions to [[Talk:Forum settings]]!&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
==User administration settings==&lt;br /&gt;
&lt;br /&gt;
Users can choose whether or not to track unread posts in their profile settings under &#039;Forum tracking&#039;. The settings are:&lt;br /&gt;
&lt;br /&gt;
* Yes: highlight new posts for me&lt;br /&gt;
* No: don&#039;t keep track of posts I have seen&lt;br /&gt;
&lt;br /&gt;
If the user chooses &#039;Yes: highlight new posts for me&#039; and the forum administrator has set the &#039;Read tracking for this forum?&#039; to On or Optional then the user will have new posts highlighted for them. The posts will be highlighted in the following places:&lt;br /&gt;
&lt;br /&gt;
* My home page&lt;br /&gt;
* Course page&lt;br /&gt;
* Within the forum itself&lt;br /&gt;
* In forum discussion threads&lt;br /&gt;
&lt;br /&gt;
[[Image:MoodleDocs forum_show_unread_behaviour.png|frame|center|Show unread on forum page]]&lt;br /&gt;
&lt;br /&gt;
==Site administration settings==&lt;br /&gt;
&lt;br /&gt;
The forum module has additional settings which may be changed by an administrator in &#039;&#039;Administration &amp;gt; Site administration &amp;gt; Plugins &amp;gt; Activity modules &amp;gt; Forum&#039;&#039; and, for &#039;Maximum time to edit posts&#039;, in &#039;&#039;Administration &amp;gt; Site administration &amp;gt; Security &amp;gt; Site policies&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
===Use email address in reply===&lt;br /&gt;
&lt;br /&gt;
By default, a user&#039;s email is set as the &#039;From&#039; address for forum notifications (unless the user has hidden their email address in their profile) so that recipients can choose to reply personally rather than via the forum. To set noreply@yourmoodlesite.org as &#039;From&#039; address for all forum notification emails, untick the forum_replytouser checkbox.&lt;br /&gt;
&lt;br /&gt;
===Long and short posts===&lt;br /&gt;
&lt;br /&gt;
The long and short post setting determine how forum posts on the site front page, social format course pages, and user profiles are displayed. (Note: There is currently an unresolved issue - &amp;quot;Site news - forum length setting has no effect for certain users&amp;quot; - MDL-4781.)&lt;br /&gt;
&lt;br /&gt;
===Enabling timed posts===&lt;br /&gt;
&lt;br /&gt;
Timed forum posts may be enabled i.e. having the option to set a display start and end date for a new discussion. Timed posts can then be created by users with the [[Capabilities/mod/forum:viewhiddentimedposts|capability to view hidden timed posts]] (normally admins and teachers).&lt;br /&gt;
&lt;br /&gt;
===Maximum time to edit posts===&lt;br /&gt;
&lt;br /&gt;
This specifies the amount of time people have to re-edit forum postings, glossary comments etc. Usually 30 minutes is a good value. The setting may be changed by an administrator in &#039;&#039;Administration &amp;gt; Site administration &amp;gt; Security &amp;gt; Site policies&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
===Allow forced read tracking===&lt;br /&gt;
&lt;br /&gt;
With this option set, &amp;quot;Forced&amp;quot; will be an option for &amp;quot;Read tracking&amp;quot; when creating or editing Forums. Forced forums have read tracking enabled regardless of user preference.&lt;br /&gt;
&lt;br /&gt;
This setting can place additional load on servers. With this setting disabled, users who set their profile setting to not track read posts see faster load times of courses pages. With this setting enabled, that performance increase is lost, and all course views see the same performance as if the users personal setting was on.&lt;br /&gt;
&lt;br /&gt;
When disabled, any forums previously set to &amp;quot;Forced&amp;quot; (or &amp;quot;On&amp;quot; prior to Moodle 2.6) will be treated as optional.&lt;br /&gt;
&lt;br /&gt;
===Mark post read after &#039;X&#039; days===&lt;br /&gt;
&lt;br /&gt;
This setting is forum_oldpostdays and specifies the number of days after which any post is considered to be read. E.g. If this is set to 14 days then any post older than 14 days will be considered read. If you set this to 0 then &#039;&#039;&#039;ALL&#039;&#039;&#039; posts are instantly considered to be read. If you don&#039;t want any posts to be considered read without the user reading them then set a high figure (e.g. 1000) &lt;br /&gt;
&lt;br /&gt;
[[de:Forum konfigurieren]]&lt;br /&gt;
[[fr:Ajouter/modifier un forum]]&lt;br /&gt;
[[ja:フォーラムの追加/編集]]&lt;/div&gt;</summary>
		<author><name>Emerrill</name></author>
	</entry>
	<entry>
		<id>https://docs.moodle.org/39/en/index.php?title=Performance_recommendations&amp;diff=106779</id>
		<title>Performance recommendations</title>
		<link rel="alternate" type="text/html" href="https://docs.moodle.org/39/en/index.php?title=Performance_recommendations&amp;diff=106779"/>
		<updated>2013-10-08T20:54:35Z</updated>

		<summary type="html">&lt;p&gt;Emerrill: /* Apache performance */ Delete link that went with the mod_expire caching stuff&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Performance}}&lt;br /&gt;
Moodle can be made to perform very well, at small usage levels or scaling up to many thousands of users. The factors involved in performance are basically the same as for any PHP-based database-driven system. When trying to optimize your server, try to focus on the factor which will make the most difference to the user. For example, if you have relatively more users browsing than accessing the database, look to improve the webserver performance.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Obtain a baseline benchmark==&lt;br /&gt;
&lt;br /&gt;
Before attempting any optimization, you should obtain a baseline benchmark of the component of the system you are trying to improve. For Linux try [http://lbs.sourceforge.net/ LBS] and for Windows use the Performance Monitor. Once you have quantitative data about how your system is performing currently, you&#039;ll be able to determine if the change you have made has had any real impact.&lt;br /&gt;
&lt;br /&gt;
The overall aim of adjustments to improve performance is to use RAM (cacheing) and to reduce disk-based activity. It is especially important to try to eliminate swap file usage as much as you can. If your system starts swapping, this is a sign that you need more RAM. &lt;br /&gt;
&lt;br /&gt;
The &#039;&#039;&#039;optimization order preference&#039;&#039;&#039; is usually: primary storage (more RAM), secondary storage (faster hard disks/improved hard disk configuration), processor (more and faster).&lt;br /&gt;
&lt;br /&gt;
==Scalability==&lt;br /&gt;
&lt;br /&gt;
Moodle&#039;s design (with clear separation of application layers) allows for strongly scalable setups. (Please check the list of [[Large installations|large Moodle installations]].)&lt;br /&gt;
&lt;br /&gt;
Large sites usually separate the web server and database onto separate servers, although for smaller installations this is typically not necessary.&lt;br /&gt;
&lt;br /&gt;
It is possible to load-balance a Moodle installation, for example by using more than one webserver. The separate webservers should query the same database and refer to the same filestore area, but otherwise the separation of the application layers is complete enough to make this kind of clustering feasible. Similarly, the database could be a cluster of servers (e.g. a MySQL cluster), but this is not an easy task and you should seek expert support, e.g. from a Moodle Partner.&lt;br /&gt;
&lt;br /&gt;
===Server cluster===&lt;br /&gt;
&lt;br /&gt;
Using Moodle forum discussions:&lt;br /&gt;
&lt;br /&gt;
*[http://moodle.org/mod/forum/discuss.php?d=57202 Moodle clustering]&lt;br /&gt;
*[http://moodle.org/mod/forum/discuss.php?d=44470 Software load balancing]&lt;br /&gt;
*[http://moodle.org/mod/forum/discuss.php?d=49986 TCP load balancing]&lt;br /&gt;
*[http://moodle.org/mod/forum/discuss.php?d=88214 Installation for 3000 simultaneous users]&lt;br /&gt;
&lt;br /&gt;
==Hardware configuration==&lt;br /&gt;
&#039;&#039;&#039;Note&#039;&#039;&#039;: The fastest and most effective change that you can make to improve performance is to &#039;&#039;&#039;increase the amount of RAM on your web server&#039;&#039;&#039; - get as much as possible (e.g. 4GB or more). Increasing primary memory will reduce the need for processes to swap to disk and will enable your server to handle more users.&lt;br /&gt;
* Better performance is gained by obtaining the best &#039;&#039;&#039;processor capability&#039;&#039;&#039; you can, i.e. dual or dual core processors. A modern BIOS should allow you to enable hyperthreading, but check if this makes a difference to the overall performance of the processors by using a [http://en.wikipedia.org/wiki/Super_PI CPU benchmarking tool].&lt;br /&gt;
* If you can afford them, use &#039;&#039;&#039;SCSI hard disks&#039;&#039;&#039; instead of SATA drives. SATA drives will increase your system&#039;s CPU utilization, whereas SCSI drives have their own integrated processors and come into their own when you have multiple drives. If you must have SATA drives, check that your motherboard and the drives themselves support NCQ (Native Command Queuing).&lt;br /&gt;
* Purchase hard disks with a &#039;&#039;&#039;low seek time&#039;&#039;&#039;. This will improve the overall speed of your system, especially when accessing Moodle&#039;s reports.&lt;br /&gt;
* Size your &#039;&#039;&#039;swap file&#039;&#039;&#039; correctly. The general advice is to set it to 4 x physical RAM.&lt;br /&gt;
* Use a &#039;&#039;&#039;RAID disk system&#039;&#039;&#039;. Although there are many different RAID configurations you can create, the following generally works best:&lt;br /&gt;
** install a hardware RAID controller (if you can)&lt;br /&gt;
** the operating system and swap drive on one set of disks configured as RAID-1.&lt;br /&gt;
** Moodle, Web server and Database server on another set of disks configured as RAID-5.&lt;br /&gt;
* Use &#039;&#039;&#039;gigabit ethernet&#039;&#039;&#039; for improved latency and throughput. This is especially important when you have your webserver and database server separated out on different hosts.&lt;br /&gt;
* Check the settings on your &#039;&#039;&#039;network card&#039;&#039;&#039;. You may get an improvement in performance by increasing the use of buffers and transmit/receive descriptors (balance this with processor and memory overheads) and off-loading TCP checksum calculation onto the card instead of the OS.&lt;br /&gt;
*  Read this [http://moodle.org/mod/forum/discuss.php?d=68579 Case Study] on a server stress test with 300 users.  &lt;br /&gt;
* See this [http://elearning.sgu.ac.jp/doc/PT/ accompanying report] on network traffic and server loads.&lt;br /&gt;
* See the [[Moodle.org configuration]]&lt;br /&gt;
* Also see this SFSU presentation at Educause (using VMWare): [http://www.educause.edu/Resources/AnOpenSourceLMSforaMissionCrit/162843]&lt;br /&gt;
&lt;br /&gt;
==Operating System==&lt;br /&gt;
* You can use [http://en.wikipedia.org/wiki/Linux Linux](recommended), Unix-based, Windows or Mac OS X for the server &#039;&#039;&#039;operating system&#039;&#039;&#039;. *nix operating systems generally require less memory than Mac OS X or Windows servers for doing the same task as the server is configured with just a shell interface. Additionally Linux does not have licensing fees attached, but can have a big learning curve if you&#039;re used to another operating system. If you have a large number of processors running SMP, you may also want to consider using a highly tuned OS such as [http://en.wikipedia.org/wiki/Solaris_Operating_Environment Solaris].&lt;br /&gt;
* Check your own OS and &#039;&#039;&#039;vendor specific instructions&#039;&#039;&#039; for optimization steps.&lt;br /&gt;
** For Linux look at the [http://linuxperf.sourceforge.net/ Linux Performance Team] site. &lt;br /&gt;
** For Linux investigate the hdparm command, e.g. hdparm -m16 -d1 can be used to enable read/write on multiple sectors and DMA. Mount disks with the async and noatime options.&lt;br /&gt;
** For Windows set the sever to be optimized for network applications (Control Panel, Network Connections, LAN connection, Properties, File &amp;amp; Printer Sharing for Microsoft Networks, Properties, Optimization). You can also search the [http://technet.microsoft.com/ Microsoft TechNet site] for optimization documents.&lt;br /&gt;
&lt;br /&gt;
==Web server performance==&lt;br /&gt;
&lt;br /&gt;
Installing [http://www.mozilla.com/en-US/ Firefox] and the [https://addons.mozilla.org/en-US/firefox/addon/1843 firebug] extension will allow you to watch the time it takes for each page component to load. Also, the [https://addons.mozilla.org/en-US/firefox/addon/5369 Yslow] extension will evaluate your page against Yahoo&#039;s [http://www.skrenta.com/2007/05/14_rules_for_fast_web_pages_by_1.html 14 rules], full text [http://developer.yahoo.com/performance/rules.html Best Practices for Speeding Up Your Web Site], &amp;lt;strike&amp;gt;([http://video.yahoo.com/video/play?vid=1040890 video])&amp;lt;/strike&amp;gt; for fast loading websites.&lt;br /&gt;
&lt;br /&gt;
===PHP performance===&lt;br /&gt;
* You are strongly recommended to use a &#039;&#039;&#039;PHP accelerator&#039;&#039;&#039; to ease CPU load, such as [http://pecl.php.net/apc APC], [http://www.php-accelerator.co.uk/ PHPA], [http://trac.lighttpd.net/xcache/ Xcache], [http://sourceforge.net/projects/wincache WinCache] or [http://eaccelerator.net/ eAccelerator]. (Take care to choose a PHP accelerator that is known to work well with your version of PHP and note that Turck MMCache is [http://turckmmcache.exeprod.com/TheManifestoEnglish no longer maintained] and can cause failures with PHP 5). &lt;br /&gt;
* Improvements in read/write performance can be improved by putting the cached PHP pages on a [[TMPFS]] filesystem - but remember that you&#039;ll lose the cache contents when there is a power failure or the server is rebooted.&lt;br /&gt;
* Performance of PHP is better when installed as an &#039;&#039;&#039;Apache/IIS6 ISAPI module&#039;&#039;&#039; (rather than a CGI). IIS 7.0/7.5 (Windows Server 2008/R2) users should choose a FastCGI installation for best performance.&lt;br /&gt;
* Also check the &#039;&#039;&#039;memory_limit&#039;&#039;&#039; in php.ini, reduce it to 16M for Moodle version earlier than 1.7 ([http://moodle.org/mod/forum/discuss.php?d=39656 See this forum discussion]). For Moodle 1.7 or later, it is recommended that the value of memory_limit should be 40M. As of [http://www.php.net/ChangeLog-5.php PHP 5.2.1] the default value for the memory_limit directive is 128M.&lt;br /&gt;
* Also see [[PHP_settings_by_Moodle_version]]&lt;br /&gt;
&lt;br /&gt;
===Install HowTo===&lt;br /&gt;
* [http://2bits.com/articles/installing-php-apc-gnulinux-centos-5.html APC on CentOS 5.x (linux)]&lt;br /&gt;
* [http://fplanque.com/dev/linux/install-apc-php-cache-debian-lenny APC on Debian (linux)]&lt;br /&gt;
* [http://www.linuxtuts.net/211-installing-memcached-php5-memcache-module-debian-apache2.html MemCache module on Debian (Apache2 and PHP5) ]&lt;br /&gt;
* [http://noveckg.blogspot.com/2010/03/installing-memcached-on-centos-5x.html Installing Memcache on CentOS 5.x (linux)]&lt;br /&gt;
* [http://noveckg.blogspot.com/2010/02/installing-eaccelerator-cache-for-php.html Installing eAccelerator on CentOS 5.x (linux)]&lt;br /&gt;
* [https://docs.moodle.org/en/Installing_eAccelerator_In_Ubuntu_Server/ Installing eAccelerator on Ubuntu Server (linux)]&lt;br /&gt;
&lt;br /&gt;
===Apache performance===&lt;br /&gt;
* If you are using Apache on a Windows server, use the build from [http://www.apachelounge.com Apache Lounge] which is reported to have [http://moodle.org/mod/forum/discuss.php?d=93358 performance and stability improvements] compared to the official Apache download. Note that this is an unofficial build, so may not keep up with official releases.&lt;br /&gt;
* Set the &#039;&#039;&#039;MaxClients&#039;&#039;&#039; directive correctly. Use this formula to help (which uses 80% of available memory to leave room for spare):&lt;br /&gt;
 MaxClients = Total available memory * 80% / Max memory usage of apache process&lt;br /&gt;
:Memory usage of apache process is usually 10MB but Moodle can easily use up to 100MB per process, so a general rule of thumb is to divide your available memory in megabytes by 100 to get a conservative setting for MaxClients. You are quite likely to find yourself lowering the MaxClients from its default of 150 on a Moodle server. To get a more accurate estimate read the value from the shell command:&lt;br /&gt;
 #ps -ylC httpd --sort:rss&lt;br /&gt;
&lt;br /&gt;
:If you need to increase the value of &#039;&#039;&#039;MaxClients&#039;&#039;&#039; beyond 256, you will also need to set the &#039;&#039;&#039;ServerLimit&#039;&#039;&#039; directive. &lt;br /&gt;
&lt;br /&gt;
:&#039;&#039;&#039;Warning&#039;&#039;&#039;: Do not be tempted to set the value of MaxClients higher than your available memory as your server will consume more RAM than available and start to swap to disk. &lt;br /&gt;
* Consider reducing the &#039;&#039;&#039;number of modules&#039;&#039;&#039; that Apache loads in the httpd.conf file to the minumum necessary to reduce the memory needed. &lt;br /&gt;
* Use the &#039;&#039;&#039;latest version of Apache&#039;&#039;&#039; - Apache 2 has an improved memory model which reduces memory usage further.&lt;br /&gt;
* For Unix/Linux systems, consider lowering &#039;&#039;&#039;MaxRequestsPerChild&#039;&#039;&#039; in httpd.conf to as low as 20-30 (if you set it any lower the overhead of forking begins to outweigh the benefits). &lt;br /&gt;
* For a heavily loaded server, consider setting &#039;&#039;&#039;KeepAlive Off&#039;&#039;&#039; (do this only if your Moodle pages do not contain links to resources or uploaded images) or lowering the &#039;&#039;&#039;KeepAliveTimeout&#039;&#039;&#039; to between 2 and 5. The default is 15 (seconds) - the higher the value the more server processes will be kept waiting for possibly idle connections. A more accurate value for KeepAliveTimeout is obtained by observing how long it takes your users to download a page. After altering any of the KeepAlive variables, monitor your CPU utilization as there may be an additional overhead in initiating more worker processes/threads.&lt;br /&gt;
* As an alternative to using KeepAlive Off, consider setting-up a &#039;&#039;&#039;Reverse Proxy server&#039;&#039;&#039; infront of the Moodle server to cache HTML files with images. You can then return Apache to using keep-alives on the Moodle server.&lt;br /&gt;
* If you do not use a .htaccess file, set the &#039;&#039;&#039;AllowOverride&#039;&#039;&#039; variable to AllowOverride None to prevent .htaccess lookups.&lt;br /&gt;
* Set &#039;&#039;&#039;DirectoryIndex&#039;&#039;&#039; correctly so as to avoid content-negotiation. Here&#039;s an example from a production server:&lt;br /&gt;
 DirectoryIndex index.php index.html index.htm&lt;br /&gt;
* Unless you are doing development work on the server, set &#039;&#039;&#039;ExtendedStatus Off&#039;&#039;&#039; and disable mod_info as well as mod_status.&lt;br /&gt;
* Leave &#039;&#039;&#039;HostnameLookups Off&#039;&#039;&#039; (as default) to reduce DNS latency.&lt;br /&gt;
* Consider reducing the value of &#039;&#039;&#039;TimeOut&#039;&#039;&#039; to between 30 to 60 (seconds). &lt;br /&gt;
* For the &#039;&#039;&#039;Options directive&#039;&#039;&#039;, avoid Options Multiviews as this performs a directory scan. To reduce disk I/O further use&lt;br /&gt;
 Options -Indexes FollowSymLinks&lt;br /&gt;
&lt;br /&gt;
* Compression reduces response times by reducing the size of the HTTP response&lt;br /&gt;
# Install and enable mod_deflate - refer to documentation or man pages&lt;br /&gt;
# Add this code to the virtual server config file within the &amp;lt;directory&amp;gt; section for the root directory (or within the .htaccess file if AllowOverrides is On):&lt;br /&gt;
 &amp;lt;ifModule mod_deflate.c&amp;gt;&lt;br /&gt;
   AddOutputFilterByType DEFLATE text/html text/plain text/xml text/x-js text/javascript text/css application/javascript&lt;br /&gt;
 &amp;lt;/ifmodule&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===IIS performance===&lt;br /&gt;
All alter this location in the registry:&lt;br /&gt;
 HKLM\SYSTEM\CurrentControlSet\Services\Inetinfo\Parameters\&lt;br /&gt;
* The equivalent to KeepAliveTimeout is &#039;&#039;&#039;ListenBackLog&#039;&#039;&#039; (IIS - registry location is HKLM\ SYSTEM\ CurrentControlSet\ Services\ Inetinfo\ Parameters). Set this to between 2 to 5.&lt;br /&gt;
*Change the &#039;&#039;&#039;MemCacheSize&#039;&#039;&#039; value to adjust the amount of memory (Mb) that IIS will use for its file cache (50% of available memory by default).&lt;br /&gt;
*Change the &#039;&#039;&#039;MaxCachedFileSize&#039;&#039;&#039; to adjust the maximum size of a file cached in the file cache in bytes. Default is 262,144 (256K).&lt;br /&gt;
*Create a new DWORD called &#039;&#039;&#039;ObjectCacheTTL&#039;&#039;&#039; to change the length of time (in milliseconds) that objects in the cache are held in memory. Default is 30,000 milliseconds (30 seconds).&lt;br /&gt;
&lt;br /&gt;
===Lighttpd, NginX and Cherokee performance===&lt;br /&gt;
You can increase server performance by using a &#039;&#039;&#039;light-weight&#039;&#039;&#039; webserver like [http://www.lighttpd.net/ lighttpd],  [http://nginx.net/ nginx] or [http://www.cherokee-project.com/ cherokee] in combination with PHP in FastCGI-mode. Lighttpd was originally created as a proof-of-concept[http://www.lighttpd.net/story] to address the [http://www.kegel.com/c10k.html C10k problem] and while primarily recommended for memory-limited servers, its design origins and asynchronous-IO model make it a suitable and proven[http://blog.lighttpd.net/articles/2006/12/28/lighttpd-powers-5-alexa-top-250-sites] alternative HTTP server for high-load websites and web apps, including Moodle. See the [[lighttpd | MoodleDocs Lighttpd page]] for additional information, configuration example and links.&lt;br /&gt;
&lt;br /&gt;
Alternatively, both [http://www.lighttpd.net/ lighttpd] and [http://nginx.net/ nginx] are capable of performing as a load-balancer and/or reverse-proxy to alleviate load on back-end servers[http://www.linuxjournal.com/article/10108], providing benefit without requiring an actual software change on existing servers.&lt;br /&gt;
&lt;br /&gt;
Do note that these are likely to be the least tested server environments of all particularly if you are using advanced features such as web services and/or Moodle Networking. They are probably best considered for heavily used Moodle sites with relatively simple configurations.&lt;br /&gt;
&lt;br /&gt;
==Database performance==&lt;br /&gt;
&lt;br /&gt;
===MySQL performance===&lt;br /&gt;
&lt;br /&gt;
The following are MySQL specific settings which can be adjusted for better performance in your my.cnf (my.ini in Windows). The file contains a list of settings and their values. To see the current values use these commands&lt;br /&gt;
 SHOW STATUS;&lt;br /&gt;
 SHOW VARIABLES; &lt;br /&gt;
&#039;&#039;&#039;Important&#039;&#039;&#039;: You must make backups of your database before attempting to change any MySQL server configuration. After any change to the my.cnf, restart mysqld.&lt;br /&gt;
&lt;br /&gt;
If you are able, the [http://mysqltuner.com/ MySQLTuner] tool can be run against your MySQL server and will calculate appropriate configuration values for most of the following settings based on your current load, status and variables automatically.&lt;br /&gt;
&lt;br /&gt;
* Enable the &#039;&#039;&#039;query cache&#039;&#039;&#039; with &lt;br /&gt;
 query_cache_type = 1. &lt;br /&gt;
For most Moodle installs, set the following:&lt;br /&gt;
 query_cache_size = 36M &lt;br /&gt;
 query_cache_min_res_unit = 2K. &lt;br /&gt;
The query cache will improve performance if you are doing few updates on the database. &lt;br /&gt;
* Set the &#039;&#039;&#039;table cache&#039;&#039;&#039; correctly. For Moodle 1.6 set &lt;br /&gt;
 table_cache = 256 #(table_open_cache in MySQL &amp;gt; 5.1.2)&lt;br /&gt;
(min), and for Moodle 1.7 set &lt;br /&gt;
 table_cache = 512 #(table_open_cache in MySQL &amp;gt; 5.1.2)&lt;br /&gt;
(min). The table cache is used by all threads (connections), so monitor the value of opened_tables to further adjust - if opened_tables &amp;gt; 3 * table_cache(table_open_cache in MySQL &amp;gt; 5.1.2) then increase table_cache upto your OS limit. Note also that the figure for table_cache will also change depending on the number of modules and plugins you have installed. Find the number for your server by executing the mysql statement below. Look at the number returned and set table_cache to this value.&lt;br /&gt;
 mysql&amp;gt;SELECT COUNT(table_name) FROM information_schema.tables WHERE table_schema=&#039;yourmoodledbname&#039;;&lt;br /&gt;
* Set the &#039;&#039;&#039;thread cache&#039;&#039;&#039; correctly. Adjust the value so that your thread cache utilization is as close to 100% as possible by this formula:&lt;br /&gt;
 thread cache utilization (%) = (threads_created / connections) * 100&lt;br /&gt;
* The &#039;&#039;&#039;key buffer&#039;&#039;&#039; can improve the access speed to Moodle&#039;s SELECT queries. The correct size depends on the size of the index files (.myi) and in Moodle 1.6 or later (without any additional modules and plugins), the recommendation for this value is key_buffer_size = 32M. Ideally you want the database to be reading once from the disk for every 100 requests so monitor that the value is suitable for your install by adjusting the value of key_buffer_size so that the following formulas are true:&lt;br /&gt;
 key_read / key_read_requests &amp;lt; 0.01&lt;br /&gt;
 key_write / key_write_requests &amp;lt;= 1.0&lt;br /&gt;
* Set the &#039;&#039;&#039;maximum number of connections&#039;&#039;&#039; so that your users will not see a &amp;quot;Too many connections&amp;quot; message. Be careful that this may have an impact on the total memory used. MySQL connections usually last for milliseconds, so it is unusual even for a heavily loaded server for this value to be over 200.&lt;br /&gt;
* Manage &#039;&#039;&#039;high burst activity&#039;&#039;&#039;. If your Moodle install uses a lot of quizzes and you are experiencing performance problems (check by monitoring the value of threads_connected - it should not be rising) consider increasing the value of back_log.&lt;br /&gt;
* &#039;&#039;&#039;Optimize your tables weekly and after upgrading Moodle&#039;&#039;&#039;. It is good practice to also optimize your tables after performing a large data deletion exercise, e.g. at the end of your semester or academic year. This will ensure that index files are up to date. Backup your database first and then use:&lt;br /&gt;
 mysql&amp;gt;CHECK TABLE mdl_tablename;&lt;br /&gt;
 mysql&amp;gt;OPTIMIZE TABLE mdl_tablename;&lt;br /&gt;
:The common tables in Moodle to check are mdl_course_sections, mdl_forum_posts, mdl_log and mdl_sessions (if using dbsessions). Any errors need to be corrected using REPAIR TABLE (see the [http://dev.mysql.com/doc/refman/5.0/en/repair-table.html MySQL manual] and this [http://moodle.org/mod/forum/discuss.php?d=58208#p279638 forum script]).&lt;br /&gt;
* &#039;&#039;&#039;Maintain the key distribution&#039;&#039;&#039;. Every month or so it is a good idea to stop the mysql server and run these myisamchk commands.&lt;br /&gt;
 #myisamchk -a -S /pathtomysql/data/moodledir/*.MYI&lt;br /&gt;
:&#039;&#039;&#039;Warning&#039;&#039;&#039;: You must stop the mysql database process (mysqld) before running any myisamchk command. If you do not, you risk data loss.&lt;br /&gt;
* Reduce the number of &#039;&#039;&#039;temporary tables saved to disk&#039;&#039;&#039;. Check this with the created_tmp_disk_tables value. If this is relatively large (&amp;gt;5%) increase tmp_table_size until you see a reduction. Note that this will have an impact on RAM usage.&lt;br /&gt;
&lt;br /&gt;
===PostgreSQL performance===&lt;br /&gt;
&lt;br /&gt;
There are some good papers around on tuning PostgreSQL (like [http://wiki.postgresql.org/wiki/Tuning_Your_PostgreSQL_Server this one]), and Moodle&#039;s case does not seem to be different to the general case.&lt;br /&gt;
&lt;br /&gt;
The first thing to recognise is that if you really need to worry about tuning you should be using a separate machine for the database server. If you are not using a separate machine then the answers to many performance questions are substantially muddied by the memory requirements of the rest of the application.&lt;br /&gt;
&lt;br /&gt;
You should probably &#039;&#039;&#039;enable autovacuum&#039;&#039;&#039;, unless you know what you are doing. Many e-learning sites have predictable periods of low use, so disabling autovacuum and running a specific vacuum at those times can be a good option. Or perhaps leave autovacuum running but do a full vacuum weekly in a quiet period.&lt;br /&gt;
&lt;br /&gt;
Set &#039;&#039;&#039;shared_buffers&#039;&#039;&#039; to something reasonable. For versions up to 8.1 my testing has shown that peak performance is almost always obtained with buffers &amp;lt; 10000, so if you are using such a version, and have more than 512M of RAM just set shared_buffers to 10,000 (8MB).&lt;br /&gt;
&lt;br /&gt;
The buffer management had a big overhaul in 8.2 and &amp;quot;reasonable&amp;quot; is now a much larger number. I have not conducted performance tests with 8.2, but the recommendations from others are generally that you should now scale shared_buffers much more with memory and may continue to reap benefits even up to values like 100,000 (80MB). Consider using 1-2% of system RAM.&lt;br /&gt;
&lt;br /&gt;
PostgreSQL will also assume that the operating system is caching its files, so setting &#039;&#039;&#039;effective_cache_size&#039;&#039;&#039; to a reasonable value is also a good idea. A reasonable value will usually be (total RAM - RAM in use by programs). If you are running Linux and leave the system running for a day or two you can look at &#039;free&#039; and under the &#039;cached&#039; column you will see what it currently is. Consider taking that number (which is kB) and dividing it by 10 (i.e. allow 20% for other programs cache needs and then divide by 8 to get pages). If you are not using a dedicated database server you will need to decrease that value to account for usage by other programs.&lt;br /&gt;
&lt;br /&gt;
Some other useful parameters that can have positive effects, and the values I would typically set them to on a machine with 4G RAM, are:&lt;br /&gt;
&lt;br /&gt;
 work_mem = 10240&lt;br /&gt;
&lt;br /&gt;
That&#039;s 10M of RAM to use instead of on-disk sorting and so forth. That can give a big speed increase, but it is per connection and 200 connections * 10M is 2G, so it can theoretically chew up a lot of RAM.&lt;br /&gt;
&lt;br /&gt;
 maintenance_work_mem = 163840&lt;br /&gt;
&lt;br /&gt;
That&#039;s 160M of RAM which will be used by (e.g.) VACUUM, index rebuild, cluster and so forth. This should only be used periodically and should be freed when those processes exit, so I believe it is well worth while.&lt;br /&gt;
&lt;br /&gt;
 max_fsm_pages = 100000&lt;br /&gt;
 max_fsm_relations = 5000&lt;br /&gt;
&lt;br /&gt;
These are used to hold the free-space map, and if they are too small you will see performance degradation after the database has been operating for some time. The exact numbers to set can be gleaned from the output of VACUUM VERBOSE, which prints the required FSM pages at the end of it&#039;s run. The 5x increase seems to be useful for a Moodle installation, from experience.&lt;br /&gt;
&lt;br /&gt;
 wal_buffers = 64&lt;br /&gt;
&lt;br /&gt;
These buffers are used for the write-ahead log, and there have been a number of reports on the PostgreSQL mailing lists of improvement from this level of increase.&lt;br /&gt;
&lt;br /&gt;
This is a little out of date now (version 8.0) but still worth a read: http://www.powerpostgresql.com/Docs&lt;br /&gt;
&lt;br /&gt;
And there is lots of good stuff here as well: http://www.varlena.com/GeneralBits/Tidbits/index.php&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Based on Andrew McMillan&#039;s post at [http://moodle.org/mod/forum/discuss.php?d=68558 Tuning PostgreSQL] forum thread.&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
===Other database performance links===&lt;br /&gt;
* Consider using a &#039;&#039;&#039;distributed cacheing system&#039;&#039;&#039; like [http://en.wikipedia.org/wiki/Memcached memcached] but note that memcached does not have any security features so it should be used behind a firewall.&lt;br /&gt;
* Consider using PostgreSQL. See [[Arguments in favour of PostgreSQL]] and [http://moodle.org/mod/forum/discuss.php?d=49195 how to migrate from MySQL to PostgreSQL] (forum discussion).&lt;br /&gt;
* [http://dev.mysql.com/doc/refman/5.0/en/server-parameters.html General advice on tuning MySQL parameters] (advice from the MySQL manual)&lt;br /&gt;
* [http://www.mysqlperformanceblog.com/2007/11/01/innodb-performance-optimization-basics/ InnoDB performance optimization] taken from the [http://www.mysqlperformanceblog.com/ MySQL performance blog] site.&lt;br /&gt;
&lt;br /&gt;
==Performance of different Moodle modules==&lt;br /&gt;
&lt;br /&gt;
Moodle&#039;s activity modules, filters, and other plugins can be activated/deactivated. If necessary, you may wish to deactivate some features (such as chat) if not required - but this isn&#039;t necessary. Some notes on the performance of certain modules:&lt;br /&gt;
&lt;br /&gt;
* The &#039;&#039;&#039;Chat&#039;&#039;&#039; module is [http://moodle.org/mod/forum/discuss.php?d=37979&amp;amp;parent=175079 said] to be a hog in terms of frequent HTTP requests to the main server. This can be reduced by setting the module to use &#039;&#039;Streamed&#039;&#039; updates, or, if you&#039;re using a Unix-based webserver, by running the chat in daemon mode. When using the Chat module use the configuration settings to tune for your expected load. Pay particular attention to the &#039;&#039;chat_old_ping&#039;&#039; and &#039;&#039;chat_refresh&#039;&#039; parameters as these can have greatest impact on server load.&lt;br /&gt;
* The &#039;&#039;&#039;Quiz&#039;&#039;&#039; module is known to stretch database performance. However, it has been getting better in recent versions, and we don&#039;t know of any good, up-to-date performance measurements. (Here is a [http://moodle.org/mod/forum/discuss.php?d=68579 case study from 2007 with 300 quiz users].)&lt;br /&gt;
* The Moodle &#039;&#039;&#039;Cron&#039;&#039;&#039; task is triggered by calling the script &#039;&#039;cron.php&#039;&#039;. If this is called over HTTP (e.g. using wget or curl) it can take a large amount of memory on large installations. If it is called by directly invoking the php command (e.g. &#039;&#039;php -f /path/to/moodle/directory/admin/cron.php&#039;&#039;) efficiency can be much improved.&lt;br /&gt;
* The &#039;&#039;&#039;Recent activities&#039;&#039;&#039; block is consuming to much resources if you have huge number of records &amp;lt;code&amp;gt;mdl_log&amp;lt;/code&amp;gt;. this is being tested to optimize the SQL query.&lt;br /&gt;
&lt;br /&gt;
==Moodle Image Optimization==&lt;br /&gt;
&lt;br /&gt;
The base images delivered in the original Moodle distribution package provide unoptimized graphics, most of which can benefit from lossless recompression utilizing [http://optipng.sourceforge.net/ optipng] for PNGs, [http://www.lcdf.org/gifsicle/ gifsicle] for GIFs and [http://www.kokkonen.net/tjko/projects.html jpegoptim] for JPGs.  Optimized graphics transfer faster and provide a faster perceived response for clients[http://www.websiteoptimization.com/speed/12/], especially distance learners.  The following example will recursively optimize (without any loss of quality) all the graphics and image files included in a base Moodle installation directory on a server with the above commands installed and available.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
find /example/directory/moodle-1.9 -iname *.png -exec optipng -o7 {} \;&lt;br /&gt;
find /example/directory/moodle-1.9 -iname *.gif -exec gifsicle -O2 -b {} \;&lt;br /&gt;
find /example/directory/moodle-1.9 -iname *.jpg -exec jpegoptim -p {} \;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Both [http://optipng.sourceforge.net/ optipng] and [http://www.lcdf.org/gifsicle/ gifsicle] are provided in the base repositories of most newer Linux distributions; [http://www.kokkonen.net/tjko/projects.html jpegoptim] must be downloaded and installed manually.&lt;br /&gt;
&lt;br /&gt;
==See also==&lt;br /&gt;
&lt;br /&gt;
*Using Moodle: [http://moodle.org/mod/forum/view.php?f=94 Hardware and Performance] forum&lt;br /&gt;
*[http://opensourceelearning.blogspot.be/2012/10/why-your-moodle-site-is-slow-five.html Why Your Moodle Site is Slow: Five Simple Settings] blog post from Jonathan Moore &lt;br /&gt;
*I teach with Moodle perfomance testing: http://www.iteachwithmoodle.com/2012/11/17/moodle-2-4-beta-performance-test-comparison-with-moodle-2-3/&lt;br /&gt;
*[http://jfilip.ca/2013/08/20/moodle-2-4-5-vs-2-5-1-performance-and-muc-apc-cache-store/ Moodle 2.4.5 vs 2.5.2 performance and MUC APC cahe store]&lt;br /&gt;
*[http://jfilip.ca/2013/09/25/moodle-performance-testing-2-4-6-vs-2-5-2-vs-2-6dev/ Moodle performance testing 2.4.6 vs 2.5.2 vs 2.6dev]&lt;br /&gt;
*[http://jfilip.ca/2013/09/24/moodle-performance-analysis-revisted-now-with-mariadb/ Moodle performance analysis revisited (now with MariaDB)]&lt;br /&gt;
*[http://tjhunt.blogspot.ca/2013/05/performance-testing-moodle.html Tim Hunt&#039;s blog (May 2, 2013) on performance testing Moodle]&lt;br /&gt;
*[http://newrelic.com/ New Relic, Application Performance Monitoring]&lt;br /&gt;
&lt;br /&gt;
There have been a lot of discussions on moodle.org about performance, here are some of the more interesting and (potentially) useful ones:&lt;br /&gt;
&lt;br /&gt;
* [http://moodle.org/mod/forum/discuss.php?d=83057 Performance woes!]&lt;br /&gt;
* [http://moodle.org/mod/forum/discuss.php?d=57028 Performance perspectives - a little script]&lt;br /&gt;
* [http://moodle.org/mod/forum/discuss.php?d=88927 Comments on planned server hardware]&lt;br /&gt;
* [http://moodle.org/mod/forum/discuss.php?d=102978#p461624 Moodle performance in a pil by Martin Langhoff]&lt;br /&gt;
* [https://moodle.org/mod/forum/discuss.php?d=240391#unread Advice on optimising php/db code in moodle2+]&lt;br /&gt;
&lt;br /&gt;
[[es:Rendimiento]]&lt;br /&gt;
[[fr:Performance]]&lt;br /&gt;
[[ja:パフォーマンス]]&lt;br /&gt;
[[de:Geschwindigkeitsempfehlungen]]&lt;/div&gt;</summary>
		<author><name>Emerrill</name></author>
	</entry>
	<entry>
		<id>https://docs.moodle.org/39/en/index.php?title=Performance_recommendations&amp;diff=106778</id>
		<title>Performance recommendations</title>
		<link rel="alternate" type="text/html" href="https://docs.moodle.org/39/en/index.php?title=Performance_recommendations&amp;diff=106778"/>
		<updated>2013-10-08T20:53:27Z</updated>

		<summary type="html">&lt;p&gt;Emerrill: /* Apache performance */ Add javascript handlers for mod_deflate&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Performance}}&lt;br /&gt;
Moodle can be made to perform very well, at small usage levels or scaling up to many thousands of users. The factors involved in performance are basically the same as for any PHP-based database-driven system. When trying to optimize your server, try to focus on the factor which will make the most difference to the user. For example, if you have relatively more users browsing than accessing the database, look to improve the webserver performance.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Obtain a baseline benchmark==&lt;br /&gt;
&lt;br /&gt;
Before attempting any optimization, you should obtain a baseline benchmark of the component of the system you are trying to improve. For Linux try [http://lbs.sourceforge.net/ LBS] and for Windows use the Performance Monitor. Once you have quantitative data about how your system is performing currently, you&#039;ll be able to determine if the change you have made has had any real impact.&lt;br /&gt;
&lt;br /&gt;
The overall aim of adjustments to improve performance is to use RAM (cacheing) and to reduce disk-based activity. It is especially important to try to eliminate swap file usage as much as you can. If your system starts swapping, this is a sign that you need more RAM. &lt;br /&gt;
&lt;br /&gt;
The &#039;&#039;&#039;optimization order preference&#039;&#039;&#039; is usually: primary storage (more RAM), secondary storage (faster hard disks/improved hard disk configuration), processor (more and faster).&lt;br /&gt;
&lt;br /&gt;
==Scalability==&lt;br /&gt;
&lt;br /&gt;
Moodle&#039;s design (with clear separation of application layers) allows for strongly scalable setups. (Please check the list of [[Large installations|large Moodle installations]].)&lt;br /&gt;
&lt;br /&gt;
Large sites usually separate the web server and database onto separate servers, although for smaller installations this is typically not necessary.&lt;br /&gt;
&lt;br /&gt;
It is possible to load-balance a Moodle installation, for example by using more than one webserver. The separate webservers should query the same database and refer to the same filestore area, but otherwise the separation of the application layers is complete enough to make this kind of clustering feasible. Similarly, the database could be a cluster of servers (e.g. a MySQL cluster), but this is not an easy task and you should seek expert support, e.g. from a Moodle Partner.&lt;br /&gt;
&lt;br /&gt;
===Server cluster===&lt;br /&gt;
&lt;br /&gt;
Using Moodle forum discussions:&lt;br /&gt;
&lt;br /&gt;
*[http://moodle.org/mod/forum/discuss.php?d=57202 Moodle clustering]&lt;br /&gt;
*[http://moodle.org/mod/forum/discuss.php?d=44470 Software load balancing]&lt;br /&gt;
*[http://moodle.org/mod/forum/discuss.php?d=49986 TCP load balancing]&lt;br /&gt;
*[http://moodle.org/mod/forum/discuss.php?d=88214 Installation for 3000 simultaneous users]&lt;br /&gt;
&lt;br /&gt;
==Hardware configuration==&lt;br /&gt;
&#039;&#039;&#039;Note&#039;&#039;&#039;: The fastest and most effective change that you can make to improve performance is to &#039;&#039;&#039;increase the amount of RAM on your web server&#039;&#039;&#039; - get as much as possible (e.g. 4GB or more). Increasing primary memory will reduce the need for processes to swap to disk and will enable your server to handle more users.&lt;br /&gt;
* Better performance is gained by obtaining the best &#039;&#039;&#039;processor capability&#039;&#039;&#039; you can, i.e. dual or dual core processors. A modern BIOS should allow you to enable hyperthreading, but check if this makes a difference to the overall performance of the processors by using a [http://en.wikipedia.org/wiki/Super_PI CPU benchmarking tool].&lt;br /&gt;
* If you can afford them, use &#039;&#039;&#039;SCSI hard disks&#039;&#039;&#039; instead of SATA drives. SATA drives will increase your system&#039;s CPU utilization, whereas SCSI drives have their own integrated processors and come into their own when you have multiple drives. If you must have SATA drives, check that your motherboard and the drives themselves support NCQ (Native Command Queuing).&lt;br /&gt;
* Purchase hard disks with a &#039;&#039;&#039;low seek time&#039;&#039;&#039;. This will improve the overall speed of your system, especially when accessing Moodle&#039;s reports.&lt;br /&gt;
* Size your &#039;&#039;&#039;swap file&#039;&#039;&#039; correctly. The general advice is to set it to 4 x physical RAM.&lt;br /&gt;
* Use a &#039;&#039;&#039;RAID disk system&#039;&#039;&#039;. Although there are many different RAID configurations you can create, the following generally works best:&lt;br /&gt;
** install a hardware RAID controller (if you can)&lt;br /&gt;
** the operating system and swap drive on one set of disks configured as RAID-1.&lt;br /&gt;
** Moodle, Web server and Database server on another set of disks configured as RAID-5.&lt;br /&gt;
* Use &#039;&#039;&#039;gigabit ethernet&#039;&#039;&#039; for improved latency and throughput. This is especially important when you have your webserver and database server separated out on different hosts.&lt;br /&gt;
* Check the settings on your &#039;&#039;&#039;network card&#039;&#039;&#039;. You may get an improvement in performance by increasing the use of buffers and transmit/receive descriptors (balance this with processor and memory overheads) and off-loading TCP checksum calculation onto the card instead of the OS.&lt;br /&gt;
*  Read this [http://moodle.org/mod/forum/discuss.php?d=68579 Case Study] on a server stress test with 300 users.  &lt;br /&gt;
* See this [http://elearning.sgu.ac.jp/doc/PT/ accompanying report] on network traffic and server loads.&lt;br /&gt;
* See the [[Moodle.org configuration]]&lt;br /&gt;
* Also see this SFSU presentation at Educause (using VMWare): [http://www.educause.edu/Resources/AnOpenSourceLMSforaMissionCrit/162843]&lt;br /&gt;
&lt;br /&gt;
==Operating System==&lt;br /&gt;
* You can use [http://en.wikipedia.org/wiki/Linux Linux](recommended), Unix-based, Windows or Mac OS X for the server &#039;&#039;&#039;operating system&#039;&#039;&#039;. *nix operating systems generally require less memory than Mac OS X or Windows servers for doing the same task as the server is configured with just a shell interface. Additionally Linux does not have licensing fees attached, but can have a big learning curve if you&#039;re used to another operating system. If you have a large number of processors running SMP, you may also want to consider using a highly tuned OS such as [http://en.wikipedia.org/wiki/Solaris_Operating_Environment Solaris].&lt;br /&gt;
* Check your own OS and &#039;&#039;&#039;vendor specific instructions&#039;&#039;&#039; for optimization steps.&lt;br /&gt;
** For Linux look at the [http://linuxperf.sourceforge.net/ Linux Performance Team] site. &lt;br /&gt;
** For Linux investigate the hdparm command, e.g. hdparm -m16 -d1 can be used to enable read/write on multiple sectors and DMA. Mount disks with the async and noatime options.&lt;br /&gt;
** For Windows set the sever to be optimized for network applications (Control Panel, Network Connections, LAN connection, Properties, File &amp;amp; Printer Sharing for Microsoft Networks, Properties, Optimization). You can also search the [http://technet.microsoft.com/ Microsoft TechNet site] for optimization documents.&lt;br /&gt;
&lt;br /&gt;
==Web server performance==&lt;br /&gt;
&lt;br /&gt;
Installing [http://www.mozilla.com/en-US/ Firefox] and the [https://addons.mozilla.org/en-US/firefox/addon/1843 firebug] extension will allow you to watch the time it takes for each page component to load. Also, the [https://addons.mozilla.org/en-US/firefox/addon/5369 Yslow] extension will evaluate your page against Yahoo&#039;s [http://www.skrenta.com/2007/05/14_rules_for_fast_web_pages_by_1.html 14 rules], full text [http://developer.yahoo.com/performance/rules.html Best Practices for Speeding Up Your Web Site], &amp;lt;strike&amp;gt;([http://video.yahoo.com/video/play?vid=1040890 video])&amp;lt;/strike&amp;gt; for fast loading websites.&lt;br /&gt;
&lt;br /&gt;
===PHP performance===&lt;br /&gt;
* You are strongly recommended to use a &#039;&#039;&#039;PHP accelerator&#039;&#039;&#039; to ease CPU load, such as [http://pecl.php.net/apc APC], [http://www.php-accelerator.co.uk/ PHPA], [http://trac.lighttpd.net/xcache/ Xcache], [http://sourceforge.net/projects/wincache WinCache] or [http://eaccelerator.net/ eAccelerator]. (Take care to choose a PHP accelerator that is known to work well with your version of PHP and note that Turck MMCache is [http://turckmmcache.exeprod.com/TheManifestoEnglish no longer maintained] and can cause failures with PHP 5). &lt;br /&gt;
* Improvements in read/write performance can be improved by putting the cached PHP pages on a [[TMPFS]] filesystem - but remember that you&#039;ll lose the cache contents when there is a power failure or the server is rebooted.&lt;br /&gt;
* Performance of PHP is better when installed as an &#039;&#039;&#039;Apache/IIS6 ISAPI module&#039;&#039;&#039; (rather than a CGI). IIS 7.0/7.5 (Windows Server 2008/R2) users should choose a FastCGI installation for best performance.&lt;br /&gt;
* Also check the &#039;&#039;&#039;memory_limit&#039;&#039;&#039; in php.ini, reduce it to 16M for Moodle version earlier than 1.7 ([http://moodle.org/mod/forum/discuss.php?d=39656 See this forum discussion]). For Moodle 1.7 or later, it is recommended that the value of memory_limit should be 40M. As of [http://www.php.net/ChangeLog-5.php PHP 5.2.1] the default value for the memory_limit directive is 128M.&lt;br /&gt;
* Also see [[PHP_settings_by_Moodle_version]]&lt;br /&gt;
&lt;br /&gt;
===Install HowTo===&lt;br /&gt;
* [http://2bits.com/articles/installing-php-apc-gnulinux-centos-5.html APC on CentOS 5.x (linux)]&lt;br /&gt;
* [http://fplanque.com/dev/linux/install-apc-php-cache-debian-lenny APC on Debian (linux)]&lt;br /&gt;
* [http://www.linuxtuts.net/211-installing-memcached-php5-memcache-module-debian-apache2.html MemCache module on Debian (Apache2 and PHP5) ]&lt;br /&gt;
* [http://noveckg.blogspot.com/2010/03/installing-memcached-on-centos-5x.html Installing Memcache on CentOS 5.x (linux)]&lt;br /&gt;
* [http://noveckg.blogspot.com/2010/02/installing-eaccelerator-cache-for-php.html Installing eAccelerator on CentOS 5.x (linux)]&lt;br /&gt;
* [https://docs.moodle.org/en/Installing_eAccelerator_In_Ubuntu_Server/ Installing eAccelerator on Ubuntu Server (linux)]&lt;br /&gt;
&lt;br /&gt;
===Apache performance===&lt;br /&gt;
* If you are using Apache on a Windows server, use the build from [http://www.apachelounge.com Apache Lounge] which is reported to have [http://moodle.org/mod/forum/discuss.php?d=93358 performance and stability improvements] compared to the official Apache download. Note that this is an unofficial build, so may not keep up with official releases.&lt;br /&gt;
* Set the &#039;&#039;&#039;MaxClients&#039;&#039;&#039; directive correctly. Use this formula to help (which uses 80% of available memory to leave room for spare):&lt;br /&gt;
 MaxClients = Total available memory * 80% / Max memory usage of apache process&lt;br /&gt;
:Memory usage of apache process is usually 10MB but Moodle can easily use up to 100MB per process, so a general rule of thumb is to divide your available memory in megabytes by 100 to get a conservative setting for MaxClients. You are quite likely to find yourself lowering the MaxClients from its default of 150 on a Moodle server. To get a more accurate estimate read the value from the shell command:&lt;br /&gt;
 #ps -ylC httpd --sort:rss&lt;br /&gt;
&lt;br /&gt;
:If you need to increase the value of &#039;&#039;&#039;MaxClients&#039;&#039;&#039; beyond 256, you will also need to set the &#039;&#039;&#039;ServerLimit&#039;&#039;&#039; directive. &lt;br /&gt;
&lt;br /&gt;
:&#039;&#039;&#039;Warning&#039;&#039;&#039;: Do not be tempted to set the value of MaxClients higher than your available memory as your server will consume more RAM than available and start to swap to disk. &lt;br /&gt;
* Consider reducing the &#039;&#039;&#039;number of modules&#039;&#039;&#039; that Apache loads in the httpd.conf file to the minumum necessary to reduce the memory needed. &lt;br /&gt;
* Use the &#039;&#039;&#039;latest version of Apache&#039;&#039;&#039; - Apache 2 has an improved memory model which reduces memory usage further.&lt;br /&gt;
* For Unix/Linux systems, consider lowering &#039;&#039;&#039;MaxRequestsPerChild&#039;&#039;&#039; in httpd.conf to as low as 20-30 (if you set it any lower the overhead of forking begins to outweigh the benefits). &lt;br /&gt;
* For a heavily loaded server, consider setting &#039;&#039;&#039;KeepAlive Off&#039;&#039;&#039; (do this only if your Moodle pages do not contain links to resources or uploaded images) or lowering the &#039;&#039;&#039;KeepAliveTimeout&#039;&#039;&#039; to between 2 and 5. The default is 15 (seconds) - the higher the value the more server processes will be kept waiting for possibly idle connections. A more accurate value for KeepAliveTimeout is obtained by observing how long it takes your users to download a page. After altering any of the KeepAlive variables, monitor your CPU utilization as there may be an additional overhead in initiating more worker processes/threads.&lt;br /&gt;
* As an alternative to using KeepAlive Off, consider setting-up a &#039;&#039;&#039;Reverse Proxy server&#039;&#039;&#039; infront of the Moodle server to cache HTML files with images. You can then return Apache to using keep-alives on the Moodle server.&lt;br /&gt;
* If you do not use a .htaccess file, set the &#039;&#039;&#039;AllowOverride&#039;&#039;&#039; variable to AllowOverride None to prevent .htaccess lookups.&lt;br /&gt;
* Set &#039;&#039;&#039;DirectoryIndex&#039;&#039;&#039; correctly so as to avoid content-negotiation. Here&#039;s an example from a production server:&lt;br /&gt;
 DirectoryIndex index.php index.html index.htm&lt;br /&gt;
* Unless you are doing development work on the server, set &#039;&#039;&#039;ExtendedStatus Off&#039;&#039;&#039; and disable mod_info as well as mod_status.&lt;br /&gt;
* Leave &#039;&#039;&#039;HostnameLookups Off&#039;&#039;&#039; (as default) to reduce DNS latency.&lt;br /&gt;
* Consider reducing the value of &#039;&#039;&#039;TimeOut&#039;&#039;&#039; to between 30 to 60 (seconds). &lt;br /&gt;
* For the &#039;&#039;&#039;Options directive&#039;&#039;&#039;, avoid Options Multiviews as this performs a directory scan. To reduce disk I/O further use&lt;br /&gt;
 Options -Indexes FollowSymLinks&lt;br /&gt;
&lt;br /&gt;
* Compression reduces response times by reducing the size of the HTTP response&lt;br /&gt;
# Install and enable mod_deflate - refer to documentation or man pages&lt;br /&gt;
# Add this code to the virtual server config file within the &amp;lt;directory&amp;gt; section for the root directory (or within the .htaccess file if AllowOverrides is On):&lt;br /&gt;
 &amp;lt;ifModule mod_deflate.c&amp;gt;&lt;br /&gt;
   AddOutputFilterByType DEFLATE text/html text/plain text/xml text/x-js text/javascript text/css application/javascript&lt;br /&gt;
 &amp;lt;/ifmodule&amp;gt;&lt;br /&gt;
&lt;br /&gt;
More info: [http://metaskills.net/2006/02/19/how-to-control-browser-caching-with-apache-2/ www.metaskills.net]&lt;br /&gt;
&lt;br /&gt;
===IIS performance===&lt;br /&gt;
All alter this location in the registry:&lt;br /&gt;
 HKLM\SYSTEM\CurrentControlSet\Services\Inetinfo\Parameters\&lt;br /&gt;
* The equivalent to KeepAliveTimeout is &#039;&#039;&#039;ListenBackLog&#039;&#039;&#039; (IIS - registry location is HKLM\ SYSTEM\ CurrentControlSet\ Services\ Inetinfo\ Parameters). Set this to between 2 to 5.&lt;br /&gt;
*Change the &#039;&#039;&#039;MemCacheSize&#039;&#039;&#039; value to adjust the amount of memory (Mb) that IIS will use for its file cache (50% of available memory by default).&lt;br /&gt;
*Change the &#039;&#039;&#039;MaxCachedFileSize&#039;&#039;&#039; to adjust the maximum size of a file cached in the file cache in bytes. Default is 262,144 (256K).&lt;br /&gt;
*Create a new DWORD called &#039;&#039;&#039;ObjectCacheTTL&#039;&#039;&#039; to change the length of time (in milliseconds) that objects in the cache are held in memory. Default is 30,000 milliseconds (30 seconds).&lt;br /&gt;
&lt;br /&gt;
===Lighttpd, NginX and Cherokee performance===&lt;br /&gt;
You can increase server performance by using a &#039;&#039;&#039;light-weight&#039;&#039;&#039; webserver like [http://www.lighttpd.net/ lighttpd],  [http://nginx.net/ nginx] or [http://www.cherokee-project.com/ cherokee] in combination with PHP in FastCGI-mode. Lighttpd was originally created as a proof-of-concept[http://www.lighttpd.net/story] to address the [http://www.kegel.com/c10k.html C10k problem] and while primarily recommended for memory-limited servers, its design origins and asynchronous-IO model make it a suitable and proven[http://blog.lighttpd.net/articles/2006/12/28/lighttpd-powers-5-alexa-top-250-sites] alternative HTTP server for high-load websites and web apps, including Moodle. See the [[lighttpd | MoodleDocs Lighttpd page]] for additional information, configuration example and links.&lt;br /&gt;
&lt;br /&gt;
Alternatively, both [http://www.lighttpd.net/ lighttpd] and [http://nginx.net/ nginx] are capable of performing as a load-balancer and/or reverse-proxy to alleviate load on back-end servers[http://www.linuxjournal.com/article/10108], providing benefit without requiring an actual software change on existing servers.&lt;br /&gt;
&lt;br /&gt;
Do note that these are likely to be the least tested server environments of all particularly if you are using advanced features such as web services and/or Moodle Networking. They are probably best considered for heavily used Moodle sites with relatively simple configurations.&lt;br /&gt;
&lt;br /&gt;
==Database performance==&lt;br /&gt;
&lt;br /&gt;
===MySQL performance===&lt;br /&gt;
&lt;br /&gt;
The following are MySQL specific settings which can be adjusted for better performance in your my.cnf (my.ini in Windows). The file contains a list of settings and their values. To see the current values use these commands&lt;br /&gt;
 SHOW STATUS;&lt;br /&gt;
 SHOW VARIABLES; &lt;br /&gt;
&#039;&#039;&#039;Important&#039;&#039;&#039;: You must make backups of your database before attempting to change any MySQL server configuration. After any change to the my.cnf, restart mysqld.&lt;br /&gt;
&lt;br /&gt;
If you are able, the [http://mysqltuner.com/ MySQLTuner] tool can be run against your MySQL server and will calculate appropriate configuration values for most of the following settings based on your current load, status and variables automatically.&lt;br /&gt;
&lt;br /&gt;
* Enable the &#039;&#039;&#039;query cache&#039;&#039;&#039; with &lt;br /&gt;
 query_cache_type = 1. &lt;br /&gt;
For most Moodle installs, set the following:&lt;br /&gt;
 query_cache_size = 36M &lt;br /&gt;
 query_cache_min_res_unit = 2K. &lt;br /&gt;
The query cache will improve performance if you are doing few updates on the database. &lt;br /&gt;
* Set the &#039;&#039;&#039;table cache&#039;&#039;&#039; correctly. For Moodle 1.6 set &lt;br /&gt;
 table_cache = 256 #(table_open_cache in MySQL &amp;gt; 5.1.2)&lt;br /&gt;
(min), and for Moodle 1.7 set &lt;br /&gt;
 table_cache = 512 #(table_open_cache in MySQL &amp;gt; 5.1.2)&lt;br /&gt;
(min). The table cache is used by all threads (connections), so monitor the value of opened_tables to further adjust - if opened_tables &amp;gt; 3 * table_cache(table_open_cache in MySQL &amp;gt; 5.1.2) then increase table_cache upto your OS limit. Note also that the figure for table_cache will also change depending on the number of modules and plugins you have installed. Find the number for your server by executing the mysql statement below. Look at the number returned and set table_cache to this value.&lt;br /&gt;
 mysql&amp;gt;SELECT COUNT(table_name) FROM information_schema.tables WHERE table_schema=&#039;yourmoodledbname&#039;;&lt;br /&gt;
* Set the &#039;&#039;&#039;thread cache&#039;&#039;&#039; correctly. Adjust the value so that your thread cache utilization is as close to 100% as possible by this formula:&lt;br /&gt;
 thread cache utilization (%) = (threads_created / connections) * 100&lt;br /&gt;
* The &#039;&#039;&#039;key buffer&#039;&#039;&#039; can improve the access speed to Moodle&#039;s SELECT queries. The correct size depends on the size of the index files (.myi) and in Moodle 1.6 or later (without any additional modules and plugins), the recommendation for this value is key_buffer_size = 32M. Ideally you want the database to be reading once from the disk for every 100 requests so monitor that the value is suitable for your install by adjusting the value of key_buffer_size so that the following formulas are true:&lt;br /&gt;
 key_read / key_read_requests &amp;lt; 0.01&lt;br /&gt;
 key_write / key_write_requests &amp;lt;= 1.0&lt;br /&gt;
* Set the &#039;&#039;&#039;maximum number of connections&#039;&#039;&#039; so that your users will not see a &amp;quot;Too many connections&amp;quot; message. Be careful that this may have an impact on the total memory used. MySQL connections usually last for milliseconds, so it is unusual even for a heavily loaded server for this value to be over 200.&lt;br /&gt;
* Manage &#039;&#039;&#039;high burst activity&#039;&#039;&#039;. If your Moodle install uses a lot of quizzes and you are experiencing performance problems (check by monitoring the value of threads_connected - it should not be rising) consider increasing the value of back_log.&lt;br /&gt;
* &#039;&#039;&#039;Optimize your tables weekly and after upgrading Moodle&#039;&#039;&#039;. It is good practice to also optimize your tables after performing a large data deletion exercise, e.g. at the end of your semester or academic year. This will ensure that index files are up to date. Backup your database first and then use:&lt;br /&gt;
 mysql&amp;gt;CHECK TABLE mdl_tablename;&lt;br /&gt;
 mysql&amp;gt;OPTIMIZE TABLE mdl_tablename;&lt;br /&gt;
:The common tables in Moodle to check are mdl_course_sections, mdl_forum_posts, mdl_log and mdl_sessions (if using dbsessions). Any errors need to be corrected using REPAIR TABLE (see the [http://dev.mysql.com/doc/refman/5.0/en/repair-table.html MySQL manual] and this [http://moodle.org/mod/forum/discuss.php?d=58208#p279638 forum script]).&lt;br /&gt;
* &#039;&#039;&#039;Maintain the key distribution&#039;&#039;&#039;. Every month or so it is a good idea to stop the mysql server and run these myisamchk commands.&lt;br /&gt;
 #myisamchk -a -S /pathtomysql/data/moodledir/*.MYI&lt;br /&gt;
:&#039;&#039;&#039;Warning&#039;&#039;&#039;: You must stop the mysql database process (mysqld) before running any myisamchk command. If you do not, you risk data loss.&lt;br /&gt;
* Reduce the number of &#039;&#039;&#039;temporary tables saved to disk&#039;&#039;&#039;. Check this with the created_tmp_disk_tables value. If this is relatively large (&amp;gt;5%) increase tmp_table_size until you see a reduction. Note that this will have an impact on RAM usage.&lt;br /&gt;
&lt;br /&gt;
===PostgreSQL performance===&lt;br /&gt;
&lt;br /&gt;
There are some good papers around on tuning PostgreSQL (like [http://wiki.postgresql.org/wiki/Tuning_Your_PostgreSQL_Server this one]), and Moodle&#039;s case does not seem to be different to the general case.&lt;br /&gt;
&lt;br /&gt;
The first thing to recognise is that if you really need to worry about tuning you should be using a separate machine for the database server. If you are not using a separate machine then the answers to many performance questions are substantially muddied by the memory requirements of the rest of the application.&lt;br /&gt;
&lt;br /&gt;
You should probably &#039;&#039;&#039;enable autovacuum&#039;&#039;&#039;, unless you know what you are doing. Many e-learning sites have predictable periods of low use, so disabling autovacuum and running a specific vacuum at those times can be a good option. Or perhaps leave autovacuum running but do a full vacuum weekly in a quiet period.&lt;br /&gt;
&lt;br /&gt;
Set &#039;&#039;&#039;shared_buffers&#039;&#039;&#039; to something reasonable. For versions up to 8.1 my testing has shown that peak performance is almost always obtained with buffers &amp;lt; 10000, so if you are using such a version, and have more than 512M of RAM just set shared_buffers to 10,000 (8MB).&lt;br /&gt;
&lt;br /&gt;
The buffer management had a big overhaul in 8.2 and &amp;quot;reasonable&amp;quot; is now a much larger number. I have not conducted performance tests with 8.2, but the recommendations from others are generally that you should now scale shared_buffers much more with memory and may continue to reap benefits even up to values like 100,000 (80MB). Consider using 1-2% of system RAM.&lt;br /&gt;
&lt;br /&gt;
PostgreSQL will also assume that the operating system is caching its files, so setting &#039;&#039;&#039;effective_cache_size&#039;&#039;&#039; to a reasonable value is also a good idea. A reasonable value will usually be (total RAM - RAM in use by programs). If you are running Linux and leave the system running for a day or two you can look at &#039;free&#039; and under the &#039;cached&#039; column you will see what it currently is. Consider taking that number (which is kB) and dividing it by 10 (i.e. allow 20% for other programs cache needs and then divide by 8 to get pages). If you are not using a dedicated database server you will need to decrease that value to account for usage by other programs.&lt;br /&gt;
&lt;br /&gt;
Some other useful parameters that can have positive effects, and the values I would typically set them to on a machine with 4G RAM, are:&lt;br /&gt;
&lt;br /&gt;
 work_mem = 10240&lt;br /&gt;
&lt;br /&gt;
That&#039;s 10M of RAM to use instead of on-disk sorting and so forth. That can give a big speed increase, but it is per connection and 200 connections * 10M is 2G, so it can theoretically chew up a lot of RAM.&lt;br /&gt;
&lt;br /&gt;
 maintenance_work_mem = 163840&lt;br /&gt;
&lt;br /&gt;
That&#039;s 160M of RAM which will be used by (e.g.) VACUUM, index rebuild, cluster and so forth. This should only be used periodically and should be freed when those processes exit, so I believe it is well worth while.&lt;br /&gt;
&lt;br /&gt;
 max_fsm_pages = 100000&lt;br /&gt;
 max_fsm_relations = 5000&lt;br /&gt;
&lt;br /&gt;
These are used to hold the free-space map, and if they are too small you will see performance degradation after the database has been operating for some time. The exact numbers to set can be gleaned from the output of VACUUM VERBOSE, which prints the required FSM pages at the end of it&#039;s run. The 5x increase seems to be useful for a Moodle installation, from experience.&lt;br /&gt;
&lt;br /&gt;
 wal_buffers = 64&lt;br /&gt;
&lt;br /&gt;
These buffers are used for the write-ahead log, and there have been a number of reports on the PostgreSQL mailing lists of improvement from this level of increase.&lt;br /&gt;
&lt;br /&gt;
This is a little out of date now (version 8.0) but still worth a read: http://www.powerpostgresql.com/Docs&lt;br /&gt;
&lt;br /&gt;
And there is lots of good stuff here as well: http://www.varlena.com/GeneralBits/Tidbits/index.php&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Based on Andrew McMillan&#039;s post at [http://moodle.org/mod/forum/discuss.php?d=68558 Tuning PostgreSQL] forum thread.&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
===Other database performance links===&lt;br /&gt;
* Consider using a &#039;&#039;&#039;distributed cacheing system&#039;&#039;&#039; like [http://en.wikipedia.org/wiki/Memcached memcached] but note that memcached does not have any security features so it should be used behind a firewall.&lt;br /&gt;
* Consider using PostgreSQL. See [[Arguments in favour of PostgreSQL]] and [http://moodle.org/mod/forum/discuss.php?d=49195 how to migrate from MySQL to PostgreSQL] (forum discussion).&lt;br /&gt;
* [http://dev.mysql.com/doc/refman/5.0/en/server-parameters.html General advice on tuning MySQL parameters] (advice from the MySQL manual)&lt;br /&gt;
* [http://www.mysqlperformanceblog.com/2007/11/01/innodb-performance-optimization-basics/ InnoDB performance optimization] taken from the [http://www.mysqlperformanceblog.com/ MySQL performance blog] site.&lt;br /&gt;
&lt;br /&gt;
==Performance of different Moodle modules==&lt;br /&gt;
&lt;br /&gt;
Moodle&#039;s activity modules, filters, and other plugins can be activated/deactivated. If necessary, you may wish to deactivate some features (such as chat) if not required - but this isn&#039;t necessary. Some notes on the performance of certain modules:&lt;br /&gt;
&lt;br /&gt;
* The &#039;&#039;&#039;Chat&#039;&#039;&#039; module is [http://moodle.org/mod/forum/discuss.php?d=37979&amp;amp;parent=175079 said] to be a hog in terms of frequent HTTP requests to the main server. This can be reduced by setting the module to use &#039;&#039;Streamed&#039;&#039; updates, or, if you&#039;re using a Unix-based webserver, by running the chat in daemon mode. When using the Chat module use the configuration settings to tune for your expected load. Pay particular attention to the &#039;&#039;chat_old_ping&#039;&#039; and &#039;&#039;chat_refresh&#039;&#039; parameters as these can have greatest impact on server load.&lt;br /&gt;
* The &#039;&#039;&#039;Quiz&#039;&#039;&#039; module is known to stretch database performance. However, it has been getting better in recent versions, and we don&#039;t know of any good, up-to-date performance measurements. (Here is a [http://moodle.org/mod/forum/discuss.php?d=68579 case study from 2007 with 300 quiz users].)&lt;br /&gt;
* The Moodle &#039;&#039;&#039;Cron&#039;&#039;&#039; task is triggered by calling the script &#039;&#039;cron.php&#039;&#039;. If this is called over HTTP (e.g. using wget or curl) it can take a large amount of memory on large installations. If it is called by directly invoking the php command (e.g. &#039;&#039;php -f /path/to/moodle/directory/admin/cron.php&#039;&#039;) efficiency can be much improved.&lt;br /&gt;
* The &#039;&#039;&#039;Recent activities&#039;&#039;&#039; block is consuming to much resources if you have huge number of records &amp;lt;code&amp;gt;mdl_log&amp;lt;/code&amp;gt;. this is being tested to optimize the SQL query.&lt;br /&gt;
&lt;br /&gt;
==Moodle Image Optimization==&lt;br /&gt;
&lt;br /&gt;
The base images delivered in the original Moodle distribution package provide unoptimized graphics, most of which can benefit from lossless recompression utilizing [http://optipng.sourceforge.net/ optipng] for PNGs, [http://www.lcdf.org/gifsicle/ gifsicle] for GIFs and [http://www.kokkonen.net/tjko/projects.html jpegoptim] for JPGs.  Optimized graphics transfer faster and provide a faster perceived response for clients[http://www.websiteoptimization.com/speed/12/], especially distance learners.  The following example will recursively optimize (without any loss of quality) all the graphics and image files included in a base Moodle installation directory on a server with the above commands installed and available.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
find /example/directory/moodle-1.9 -iname *.png -exec optipng -o7 {} \;&lt;br /&gt;
find /example/directory/moodle-1.9 -iname *.gif -exec gifsicle -O2 -b {} \;&lt;br /&gt;
find /example/directory/moodle-1.9 -iname *.jpg -exec jpegoptim -p {} \;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Both [http://optipng.sourceforge.net/ optipng] and [http://www.lcdf.org/gifsicle/ gifsicle] are provided in the base repositories of most newer Linux distributions; [http://www.kokkonen.net/tjko/projects.html jpegoptim] must be downloaded and installed manually.&lt;br /&gt;
&lt;br /&gt;
==See also==&lt;br /&gt;
&lt;br /&gt;
*Using Moodle: [http://moodle.org/mod/forum/view.php?f=94 Hardware and Performance] forum&lt;br /&gt;
*[http://opensourceelearning.blogspot.be/2012/10/why-your-moodle-site-is-slow-five.html Why Your Moodle Site is Slow: Five Simple Settings] blog post from Jonathan Moore &lt;br /&gt;
*I teach with Moodle perfomance testing: http://www.iteachwithmoodle.com/2012/11/17/moodle-2-4-beta-performance-test-comparison-with-moodle-2-3/&lt;br /&gt;
*[http://jfilip.ca/2013/08/20/moodle-2-4-5-vs-2-5-1-performance-and-muc-apc-cache-store/ Moodle 2.4.5 vs 2.5.2 performance and MUC APC cahe store]&lt;br /&gt;
*[http://jfilip.ca/2013/09/25/moodle-performance-testing-2-4-6-vs-2-5-2-vs-2-6dev/ Moodle performance testing 2.4.6 vs 2.5.2 vs 2.6dev]&lt;br /&gt;
*[http://jfilip.ca/2013/09/24/moodle-performance-analysis-revisted-now-with-mariadb/ Moodle performance analysis revisited (now with MariaDB)]&lt;br /&gt;
*[http://tjhunt.blogspot.ca/2013/05/performance-testing-moodle.html Tim Hunt&#039;s blog (May 2, 2013) on performance testing Moodle]&lt;br /&gt;
*[http://newrelic.com/ New Relic, Application Performance Monitoring]&lt;br /&gt;
&lt;br /&gt;
There have been a lot of discussions on moodle.org about performance, here are some of the more interesting and (potentially) useful ones:&lt;br /&gt;
&lt;br /&gt;
* [http://moodle.org/mod/forum/discuss.php?d=83057 Performance woes!]&lt;br /&gt;
* [http://moodle.org/mod/forum/discuss.php?d=57028 Performance perspectives - a little script]&lt;br /&gt;
* [http://moodle.org/mod/forum/discuss.php?d=88927 Comments on planned server hardware]&lt;br /&gt;
* [http://moodle.org/mod/forum/discuss.php?d=102978#p461624 Moodle performance in a pil by Martin Langhoff]&lt;br /&gt;
* [https://moodle.org/mod/forum/discuss.php?d=240391#unread Advice on optimising php/db code in moodle2+]&lt;br /&gt;
&lt;br /&gt;
[[es:Rendimiento]]&lt;br /&gt;
[[fr:Performance]]&lt;br /&gt;
[[ja:パフォーマンス]]&lt;br /&gt;
[[de:Geschwindigkeitsempfehlungen]]&lt;/div&gt;</summary>
		<author><name>Emerrill</name></author>
	</entry>
	<entry>
		<id>https://docs.moodle.org/39/en/index.php?title=Performance_recommendations&amp;diff=106777</id>
		<title>Performance recommendations</title>
		<link rel="alternate" type="text/html" href="https://docs.moodle.org/39/en/index.php?title=Performance_recommendations&amp;diff=106777"/>
		<updated>2013-10-08T20:52:19Z</updated>

		<summary type="html">&lt;p&gt;Emerrill: /* Apache performance */ This form of caching is unneeded in Moodle 2.x - Expires is written by moodle.&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Performance}}&lt;br /&gt;
Moodle can be made to perform very well, at small usage levels or scaling up to many thousands of users. The factors involved in performance are basically the same as for any PHP-based database-driven system. When trying to optimize your server, try to focus on the factor which will make the most difference to the user. For example, if you have relatively more users browsing than accessing the database, look to improve the webserver performance.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Obtain a baseline benchmark==&lt;br /&gt;
&lt;br /&gt;
Before attempting any optimization, you should obtain a baseline benchmark of the component of the system you are trying to improve. For Linux try [http://lbs.sourceforge.net/ LBS] and for Windows use the Performance Monitor. Once you have quantitative data about how your system is performing currently, you&#039;ll be able to determine if the change you have made has had any real impact.&lt;br /&gt;
&lt;br /&gt;
The overall aim of adjustments to improve performance is to use RAM (cacheing) and to reduce disk-based activity. It is especially important to try to eliminate swap file usage as much as you can. If your system starts swapping, this is a sign that you need more RAM. &lt;br /&gt;
&lt;br /&gt;
The &#039;&#039;&#039;optimization order preference&#039;&#039;&#039; is usually: primary storage (more RAM), secondary storage (faster hard disks/improved hard disk configuration), processor (more and faster).&lt;br /&gt;
&lt;br /&gt;
==Scalability==&lt;br /&gt;
&lt;br /&gt;
Moodle&#039;s design (with clear separation of application layers) allows for strongly scalable setups. (Please check the list of [[Large installations|large Moodle installations]].)&lt;br /&gt;
&lt;br /&gt;
Large sites usually separate the web server and database onto separate servers, although for smaller installations this is typically not necessary.&lt;br /&gt;
&lt;br /&gt;
It is possible to load-balance a Moodle installation, for example by using more than one webserver. The separate webservers should query the same database and refer to the same filestore area, but otherwise the separation of the application layers is complete enough to make this kind of clustering feasible. Similarly, the database could be a cluster of servers (e.g. a MySQL cluster), but this is not an easy task and you should seek expert support, e.g. from a Moodle Partner.&lt;br /&gt;
&lt;br /&gt;
===Server cluster===&lt;br /&gt;
&lt;br /&gt;
Using Moodle forum discussions:&lt;br /&gt;
&lt;br /&gt;
*[http://moodle.org/mod/forum/discuss.php?d=57202 Moodle clustering]&lt;br /&gt;
*[http://moodle.org/mod/forum/discuss.php?d=44470 Software load balancing]&lt;br /&gt;
*[http://moodle.org/mod/forum/discuss.php?d=49986 TCP load balancing]&lt;br /&gt;
*[http://moodle.org/mod/forum/discuss.php?d=88214 Installation for 3000 simultaneous users]&lt;br /&gt;
&lt;br /&gt;
==Hardware configuration==&lt;br /&gt;
&#039;&#039;&#039;Note&#039;&#039;&#039;: The fastest and most effective change that you can make to improve performance is to &#039;&#039;&#039;increase the amount of RAM on your web server&#039;&#039;&#039; - get as much as possible (e.g. 4GB or more). Increasing primary memory will reduce the need for processes to swap to disk and will enable your server to handle more users.&lt;br /&gt;
* Better performance is gained by obtaining the best &#039;&#039;&#039;processor capability&#039;&#039;&#039; you can, i.e. dual or dual core processors. A modern BIOS should allow you to enable hyperthreading, but check if this makes a difference to the overall performance of the processors by using a [http://en.wikipedia.org/wiki/Super_PI CPU benchmarking tool].&lt;br /&gt;
* If you can afford them, use &#039;&#039;&#039;SCSI hard disks&#039;&#039;&#039; instead of SATA drives. SATA drives will increase your system&#039;s CPU utilization, whereas SCSI drives have their own integrated processors and come into their own when you have multiple drives. If you must have SATA drives, check that your motherboard and the drives themselves support NCQ (Native Command Queuing).&lt;br /&gt;
* Purchase hard disks with a &#039;&#039;&#039;low seek time&#039;&#039;&#039;. This will improve the overall speed of your system, especially when accessing Moodle&#039;s reports.&lt;br /&gt;
* Size your &#039;&#039;&#039;swap file&#039;&#039;&#039; correctly. The general advice is to set it to 4 x physical RAM.&lt;br /&gt;
* Use a &#039;&#039;&#039;RAID disk system&#039;&#039;&#039;. Although there are many different RAID configurations you can create, the following generally works best:&lt;br /&gt;
** install a hardware RAID controller (if you can)&lt;br /&gt;
** the operating system and swap drive on one set of disks configured as RAID-1.&lt;br /&gt;
** Moodle, Web server and Database server on another set of disks configured as RAID-5.&lt;br /&gt;
* Use &#039;&#039;&#039;gigabit ethernet&#039;&#039;&#039; for improved latency and throughput. This is especially important when you have your webserver and database server separated out on different hosts.&lt;br /&gt;
* Check the settings on your &#039;&#039;&#039;network card&#039;&#039;&#039;. You may get an improvement in performance by increasing the use of buffers and transmit/receive descriptors (balance this with processor and memory overheads) and off-loading TCP checksum calculation onto the card instead of the OS.&lt;br /&gt;
*  Read this [http://moodle.org/mod/forum/discuss.php?d=68579 Case Study] on a server stress test with 300 users.  &lt;br /&gt;
* See this [http://elearning.sgu.ac.jp/doc/PT/ accompanying report] on network traffic and server loads.&lt;br /&gt;
* See the [[Moodle.org configuration]]&lt;br /&gt;
* Also see this SFSU presentation at Educause (using VMWare): [http://www.educause.edu/Resources/AnOpenSourceLMSforaMissionCrit/162843]&lt;br /&gt;
&lt;br /&gt;
==Operating System==&lt;br /&gt;
* You can use [http://en.wikipedia.org/wiki/Linux Linux](recommended), Unix-based, Windows or Mac OS X for the server &#039;&#039;&#039;operating system&#039;&#039;&#039;. *nix operating systems generally require less memory than Mac OS X or Windows servers for doing the same task as the server is configured with just a shell interface. Additionally Linux does not have licensing fees attached, but can have a big learning curve if you&#039;re used to another operating system. If you have a large number of processors running SMP, you may also want to consider using a highly tuned OS such as [http://en.wikipedia.org/wiki/Solaris_Operating_Environment Solaris].&lt;br /&gt;
* Check your own OS and &#039;&#039;&#039;vendor specific instructions&#039;&#039;&#039; for optimization steps.&lt;br /&gt;
** For Linux look at the [http://linuxperf.sourceforge.net/ Linux Performance Team] site. &lt;br /&gt;
** For Linux investigate the hdparm command, e.g. hdparm -m16 -d1 can be used to enable read/write on multiple sectors and DMA. Mount disks with the async and noatime options.&lt;br /&gt;
** For Windows set the sever to be optimized for network applications (Control Panel, Network Connections, LAN connection, Properties, File &amp;amp; Printer Sharing for Microsoft Networks, Properties, Optimization). You can also search the [http://technet.microsoft.com/ Microsoft TechNet site] for optimization documents.&lt;br /&gt;
&lt;br /&gt;
==Web server performance==&lt;br /&gt;
&lt;br /&gt;
Installing [http://www.mozilla.com/en-US/ Firefox] and the [https://addons.mozilla.org/en-US/firefox/addon/1843 firebug] extension will allow you to watch the time it takes for each page component to load. Also, the [https://addons.mozilla.org/en-US/firefox/addon/5369 Yslow] extension will evaluate your page against Yahoo&#039;s [http://www.skrenta.com/2007/05/14_rules_for_fast_web_pages_by_1.html 14 rules], full text [http://developer.yahoo.com/performance/rules.html Best Practices for Speeding Up Your Web Site], &amp;lt;strike&amp;gt;([http://video.yahoo.com/video/play?vid=1040890 video])&amp;lt;/strike&amp;gt; for fast loading websites.&lt;br /&gt;
&lt;br /&gt;
===PHP performance===&lt;br /&gt;
* You are strongly recommended to use a &#039;&#039;&#039;PHP accelerator&#039;&#039;&#039; to ease CPU load, such as [http://pecl.php.net/apc APC], [http://www.php-accelerator.co.uk/ PHPA], [http://trac.lighttpd.net/xcache/ Xcache], [http://sourceforge.net/projects/wincache WinCache] or [http://eaccelerator.net/ eAccelerator]. (Take care to choose a PHP accelerator that is known to work well with your version of PHP and note that Turck MMCache is [http://turckmmcache.exeprod.com/TheManifestoEnglish no longer maintained] and can cause failures with PHP 5). &lt;br /&gt;
* Improvements in read/write performance can be improved by putting the cached PHP pages on a [[TMPFS]] filesystem - but remember that you&#039;ll lose the cache contents when there is a power failure or the server is rebooted.&lt;br /&gt;
* Performance of PHP is better when installed as an &#039;&#039;&#039;Apache/IIS6 ISAPI module&#039;&#039;&#039; (rather than a CGI). IIS 7.0/7.5 (Windows Server 2008/R2) users should choose a FastCGI installation for best performance.&lt;br /&gt;
* Also check the &#039;&#039;&#039;memory_limit&#039;&#039;&#039; in php.ini, reduce it to 16M for Moodle version earlier than 1.7 ([http://moodle.org/mod/forum/discuss.php?d=39656 See this forum discussion]). For Moodle 1.7 or later, it is recommended that the value of memory_limit should be 40M. As of [http://www.php.net/ChangeLog-5.php PHP 5.2.1] the default value for the memory_limit directive is 128M.&lt;br /&gt;
* Also see [[PHP_settings_by_Moodle_version]]&lt;br /&gt;
&lt;br /&gt;
===Install HowTo===&lt;br /&gt;
* [http://2bits.com/articles/installing-php-apc-gnulinux-centos-5.html APC on CentOS 5.x (linux)]&lt;br /&gt;
* [http://fplanque.com/dev/linux/install-apc-php-cache-debian-lenny APC on Debian (linux)]&lt;br /&gt;
* [http://www.linuxtuts.net/211-installing-memcached-php5-memcache-module-debian-apache2.html MemCache module on Debian (Apache2 and PHP5) ]&lt;br /&gt;
* [http://noveckg.blogspot.com/2010/03/installing-memcached-on-centos-5x.html Installing Memcache on CentOS 5.x (linux)]&lt;br /&gt;
* [http://noveckg.blogspot.com/2010/02/installing-eaccelerator-cache-for-php.html Installing eAccelerator on CentOS 5.x (linux)]&lt;br /&gt;
* [https://docs.moodle.org/en/Installing_eAccelerator_In_Ubuntu_Server/ Installing eAccelerator on Ubuntu Server (linux)]&lt;br /&gt;
&lt;br /&gt;
===Apache performance===&lt;br /&gt;
* If you are using Apache on a Windows server, use the build from [http://www.apachelounge.com Apache Lounge] which is reported to have [http://moodle.org/mod/forum/discuss.php?d=93358 performance and stability improvements] compared to the official Apache download. Note that this is an unofficial build, so may not keep up with official releases.&lt;br /&gt;
* Set the &#039;&#039;&#039;MaxClients&#039;&#039;&#039; directive correctly. Use this formula to help (which uses 80% of available memory to leave room for spare):&lt;br /&gt;
 MaxClients = Total available memory * 80% / Max memory usage of apache process&lt;br /&gt;
:Memory usage of apache process is usually 10MB but Moodle can easily use up to 100MB per process, so a general rule of thumb is to divide your available memory in megabytes by 100 to get a conservative setting for MaxClients. You are quite likely to find yourself lowering the MaxClients from its default of 150 on a Moodle server. To get a more accurate estimate read the value from the shell command:&lt;br /&gt;
 #ps -ylC httpd --sort:rss&lt;br /&gt;
&lt;br /&gt;
:If you need to increase the value of &#039;&#039;&#039;MaxClients&#039;&#039;&#039; beyond 256, you will also need to set the &#039;&#039;&#039;ServerLimit&#039;&#039;&#039; directive. &lt;br /&gt;
&lt;br /&gt;
:&#039;&#039;&#039;Warning&#039;&#039;&#039;: Do not be tempted to set the value of MaxClients higher than your available memory as your server will consume more RAM than available and start to swap to disk. &lt;br /&gt;
* Consider reducing the &#039;&#039;&#039;number of modules&#039;&#039;&#039; that Apache loads in the httpd.conf file to the minumum necessary to reduce the memory needed. &lt;br /&gt;
* Use the &#039;&#039;&#039;latest version of Apache&#039;&#039;&#039; - Apache 2 has an improved memory model which reduces memory usage further.&lt;br /&gt;
* For Unix/Linux systems, consider lowering &#039;&#039;&#039;MaxRequestsPerChild&#039;&#039;&#039; in httpd.conf to as low as 20-30 (if you set it any lower the overhead of forking begins to outweigh the benefits). &lt;br /&gt;
* For a heavily loaded server, consider setting &#039;&#039;&#039;KeepAlive Off&#039;&#039;&#039; (do this only if your Moodle pages do not contain links to resources or uploaded images) or lowering the &#039;&#039;&#039;KeepAliveTimeout&#039;&#039;&#039; to between 2 and 5. The default is 15 (seconds) - the higher the value the more server processes will be kept waiting for possibly idle connections. A more accurate value for KeepAliveTimeout is obtained by observing how long it takes your users to download a page. After altering any of the KeepAlive variables, monitor your CPU utilization as there may be an additional overhead in initiating more worker processes/threads.&lt;br /&gt;
* As an alternative to using KeepAlive Off, consider setting-up a &#039;&#039;&#039;Reverse Proxy server&#039;&#039;&#039; infront of the Moodle server to cache HTML files with images. You can then return Apache to using keep-alives on the Moodle server.&lt;br /&gt;
* If you do not use a .htaccess file, set the &#039;&#039;&#039;AllowOverride&#039;&#039;&#039; variable to AllowOverride None to prevent .htaccess lookups.&lt;br /&gt;
* Set &#039;&#039;&#039;DirectoryIndex&#039;&#039;&#039; correctly so as to avoid content-negotiation. Here&#039;s an example from a production server:&lt;br /&gt;
 DirectoryIndex index.php index.html index.htm&lt;br /&gt;
* Unless you are doing development work on the server, set &#039;&#039;&#039;ExtendedStatus Off&#039;&#039;&#039; and disable mod_info as well as mod_status.&lt;br /&gt;
* Leave &#039;&#039;&#039;HostnameLookups Off&#039;&#039;&#039; (as default) to reduce DNS latency.&lt;br /&gt;
* Consider reducing the value of &#039;&#039;&#039;TimeOut&#039;&#039;&#039; to between 30 to 60 (seconds). &lt;br /&gt;
* For the &#039;&#039;&#039;Options directive&#039;&#039;&#039;, avoid Options Multiviews as this performs a directory scan. To reduce disk I/O further use&lt;br /&gt;
 Options -Indexes FollowSymLinks&lt;br /&gt;
&lt;br /&gt;
* Compression reduces response times by reducing the size of the HTTP response&lt;br /&gt;
# Install and enable mod_deflate - refer to documentation or man pages&lt;br /&gt;
# Add this code to the virtual server config file within the &amp;lt;directory&amp;gt; section for the root directory (or within the .htaccess file if AllowOverrides is On):&lt;br /&gt;
 &amp;lt;ifModule mod_deflate.c&amp;gt;&lt;br /&gt;
   AddOutputFilterByType DEFLATE text/html text/plain text/xml&lt;br /&gt;
 &amp;lt;/ifmodule&amp;gt;&lt;br /&gt;
&lt;br /&gt;
More info: [http://metaskills.net/2006/02/19/how-to-control-browser-caching-with-apache-2/ www.metaskills.net]&lt;br /&gt;
&lt;br /&gt;
===IIS performance===&lt;br /&gt;
All alter this location in the registry:&lt;br /&gt;
 HKLM\SYSTEM\CurrentControlSet\Services\Inetinfo\Parameters\&lt;br /&gt;
* The equivalent to KeepAliveTimeout is &#039;&#039;&#039;ListenBackLog&#039;&#039;&#039; (IIS - registry location is HKLM\ SYSTEM\ CurrentControlSet\ Services\ Inetinfo\ Parameters). Set this to between 2 to 5.&lt;br /&gt;
*Change the &#039;&#039;&#039;MemCacheSize&#039;&#039;&#039; value to adjust the amount of memory (Mb) that IIS will use for its file cache (50% of available memory by default).&lt;br /&gt;
*Change the &#039;&#039;&#039;MaxCachedFileSize&#039;&#039;&#039; to adjust the maximum size of a file cached in the file cache in bytes. Default is 262,144 (256K).&lt;br /&gt;
*Create a new DWORD called &#039;&#039;&#039;ObjectCacheTTL&#039;&#039;&#039; to change the length of time (in milliseconds) that objects in the cache are held in memory. Default is 30,000 milliseconds (30 seconds).&lt;br /&gt;
&lt;br /&gt;
===Lighttpd, NginX and Cherokee performance===&lt;br /&gt;
You can increase server performance by using a &#039;&#039;&#039;light-weight&#039;&#039;&#039; webserver like [http://www.lighttpd.net/ lighttpd],  [http://nginx.net/ nginx] or [http://www.cherokee-project.com/ cherokee] in combination with PHP in FastCGI-mode. Lighttpd was originally created as a proof-of-concept[http://www.lighttpd.net/story] to address the [http://www.kegel.com/c10k.html C10k problem] and while primarily recommended for memory-limited servers, its design origins and asynchronous-IO model make it a suitable and proven[http://blog.lighttpd.net/articles/2006/12/28/lighttpd-powers-5-alexa-top-250-sites] alternative HTTP server for high-load websites and web apps, including Moodle. See the [[lighttpd | MoodleDocs Lighttpd page]] for additional information, configuration example and links.&lt;br /&gt;
&lt;br /&gt;
Alternatively, both [http://www.lighttpd.net/ lighttpd] and [http://nginx.net/ nginx] are capable of performing as a load-balancer and/or reverse-proxy to alleviate load on back-end servers[http://www.linuxjournal.com/article/10108], providing benefit without requiring an actual software change on existing servers.&lt;br /&gt;
&lt;br /&gt;
Do note that these are likely to be the least tested server environments of all particularly if you are using advanced features such as web services and/or Moodle Networking. They are probably best considered for heavily used Moodle sites with relatively simple configurations.&lt;br /&gt;
&lt;br /&gt;
==Database performance==&lt;br /&gt;
&lt;br /&gt;
===MySQL performance===&lt;br /&gt;
&lt;br /&gt;
The following are MySQL specific settings which can be adjusted for better performance in your my.cnf (my.ini in Windows). The file contains a list of settings and their values. To see the current values use these commands&lt;br /&gt;
 SHOW STATUS;&lt;br /&gt;
 SHOW VARIABLES; &lt;br /&gt;
&#039;&#039;&#039;Important&#039;&#039;&#039;: You must make backups of your database before attempting to change any MySQL server configuration. After any change to the my.cnf, restart mysqld.&lt;br /&gt;
&lt;br /&gt;
If you are able, the [http://mysqltuner.com/ MySQLTuner] tool can be run against your MySQL server and will calculate appropriate configuration values for most of the following settings based on your current load, status and variables automatically.&lt;br /&gt;
&lt;br /&gt;
* Enable the &#039;&#039;&#039;query cache&#039;&#039;&#039; with &lt;br /&gt;
 query_cache_type = 1. &lt;br /&gt;
For most Moodle installs, set the following:&lt;br /&gt;
 query_cache_size = 36M &lt;br /&gt;
 query_cache_min_res_unit = 2K. &lt;br /&gt;
The query cache will improve performance if you are doing few updates on the database. &lt;br /&gt;
* Set the &#039;&#039;&#039;table cache&#039;&#039;&#039; correctly. For Moodle 1.6 set &lt;br /&gt;
 table_cache = 256 #(table_open_cache in MySQL &amp;gt; 5.1.2)&lt;br /&gt;
(min), and for Moodle 1.7 set &lt;br /&gt;
 table_cache = 512 #(table_open_cache in MySQL &amp;gt; 5.1.2)&lt;br /&gt;
(min). The table cache is used by all threads (connections), so monitor the value of opened_tables to further adjust - if opened_tables &amp;gt; 3 * table_cache(table_open_cache in MySQL &amp;gt; 5.1.2) then increase table_cache upto your OS limit. Note also that the figure for table_cache will also change depending on the number of modules and plugins you have installed. Find the number for your server by executing the mysql statement below. Look at the number returned and set table_cache to this value.&lt;br /&gt;
 mysql&amp;gt;SELECT COUNT(table_name) FROM information_schema.tables WHERE table_schema=&#039;yourmoodledbname&#039;;&lt;br /&gt;
* Set the &#039;&#039;&#039;thread cache&#039;&#039;&#039; correctly. Adjust the value so that your thread cache utilization is as close to 100% as possible by this formula:&lt;br /&gt;
 thread cache utilization (%) = (threads_created / connections) * 100&lt;br /&gt;
* The &#039;&#039;&#039;key buffer&#039;&#039;&#039; can improve the access speed to Moodle&#039;s SELECT queries. The correct size depends on the size of the index files (.myi) and in Moodle 1.6 or later (without any additional modules and plugins), the recommendation for this value is key_buffer_size = 32M. Ideally you want the database to be reading once from the disk for every 100 requests so monitor that the value is suitable for your install by adjusting the value of key_buffer_size so that the following formulas are true:&lt;br /&gt;
 key_read / key_read_requests &amp;lt; 0.01&lt;br /&gt;
 key_write / key_write_requests &amp;lt;= 1.0&lt;br /&gt;
* Set the &#039;&#039;&#039;maximum number of connections&#039;&#039;&#039; so that your users will not see a &amp;quot;Too many connections&amp;quot; message. Be careful that this may have an impact on the total memory used. MySQL connections usually last for milliseconds, so it is unusual even for a heavily loaded server for this value to be over 200.&lt;br /&gt;
* Manage &#039;&#039;&#039;high burst activity&#039;&#039;&#039;. If your Moodle install uses a lot of quizzes and you are experiencing performance problems (check by monitoring the value of threads_connected - it should not be rising) consider increasing the value of back_log.&lt;br /&gt;
* &#039;&#039;&#039;Optimize your tables weekly and after upgrading Moodle&#039;&#039;&#039;. It is good practice to also optimize your tables after performing a large data deletion exercise, e.g. at the end of your semester or academic year. This will ensure that index files are up to date. Backup your database first and then use:&lt;br /&gt;
 mysql&amp;gt;CHECK TABLE mdl_tablename;&lt;br /&gt;
 mysql&amp;gt;OPTIMIZE TABLE mdl_tablename;&lt;br /&gt;
:The common tables in Moodle to check are mdl_course_sections, mdl_forum_posts, mdl_log and mdl_sessions (if using dbsessions). Any errors need to be corrected using REPAIR TABLE (see the [http://dev.mysql.com/doc/refman/5.0/en/repair-table.html MySQL manual] and this [http://moodle.org/mod/forum/discuss.php?d=58208#p279638 forum script]).&lt;br /&gt;
* &#039;&#039;&#039;Maintain the key distribution&#039;&#039;&#039;. Every month or so it is a good idea to stop the mysql server and run these myisamchk commands.&lt;br /&gt;
 #myisamchk -a -S /pathtomysql/data/moodledir/*.MYI&lt;br /&gt;
:&#039;&#039;&#039;Warning&#039;&#039;&#039;: You must stop the mysql database process (mysqld) before running any myisamchk command. If you do not, you risk data loss.&lt;br /&gt;
* Reduce the number of &#039;&#039;&#039;temporary tables saved to disk&#039;&#039;&#039;. Check this with the created_tmp_disk_tables value. If this is relatively large (&amp;gt;5%) increase tmp_table_size until you see a reduction. Note that this will have an impact on RAM usage.&lt;br /&gt;
&lt;br /&gt;
===PostgreSQL performance===&lt;br /&gt;
&lt;br /&gt;
There are some good papers around on tuning PostgreSQL (like [http://wiki.postgresql.org/wiki/Tuning_Your_PostgreSQL_Server this one]), and Moodle&#039;s case does not seem to be different to the general case.&lt;br /&gt;
&lt;br /&gt;
The first thing to recognise is that if you really need to worry about tuning you should be using a separate machine for the database server. If you are not using a separate machine then the answers to many performance questions are substantially muddied by the memory requirements of the rest of the application.&lt;br /&gt;
&lt;br /&gt;
You should probably &#039;&#039;&#039;enable autovacuum&#039;&#039;&#039;, unless you know what you are doing. Many e-learning sites have predictable periods of low use, so disabling autovacuum and running a specific vacuum at those times can be a good option. Or perhaps leave autovacuum running but do a full vacuum weekly in a quiet period.&lt;br /&gt;
&lt;br /&gt;
Set &#039;&#039;&#039;shared_buffers&#039;&#039;&#039; to something reasonable. For versions up to 8.1 my testing has shown that peak performance is almost always obtained with buffers &amp;lt; 10000, so if you are using such a version, and have more than 512M of RAM just set shared_buffers to 10,000 (8MB).&lt;br /&gt;
&lt;br /&gt;
The buffer management had a big overhaul in 8.2 and &amp;quot;reasonable&amp;quot; is now a much larger number. I have not conducted performance tests with 8.2, but the recommendations from others are generally that you should now scale shared_buffers much more with memory and may continue to reap benefits even up to values like 100,000 (80MB). Consider using 1-2% of system RAM.&lt;br /&gt;
&lt;br /&gt;
PostgreSQL will also assume that the operating system is caching its files, so setting &#039;&#039;&#039;effective_cache_size&#039;&#039;&#039; to a reasonable value is also a good idea. A reasonable value will usually be (total RAM - RAM in use by programs). If you are running Linux and leave the system running for a day or two you can look at &#039;free&#039; and under the &#039;cached&#039; column you will see what it currently is. Consider taking that number (which is kB) and dividing it by 10 (i.e. allow 20% for other programs cache needs and then divide by 8 to get pages). If you are not using a dedicated database server you will need to decrease that value to account for usage by other programs.&lt;br /&gt;
&lt;br /&gt;
Some other useful parameters that can have positive effects, and the values I would typically set them to on a machine with 4G RAM, are:&lt;br /&gt;
&lt;br /&gt;
 work_mem = 10240&lt;br /&gt;
&lt;br /&gt;
That&#039;s 10M of RAM to use instead of on-disk sorting and so forth. That can give a big speed increase, but it is per connection and 200 connections * 10M is 2G, so it can theoretically chew up a lot of RAM.&lt;br /&gt;
&lt;br /&gt;
 maintenance_work_mem = 163840&lt;br /&gt;
&lt;br /&gt;
That&#039;s 160M of RAM which will be used by (e.g.) VACUUM, index rebuild, cluster and so forth. This should only be used periodically and should be freed when those processes exit, so I believe it is well worth while.&lt;br /&gt;
&lt;br /&gt;
 max_fsm_pages = 100000&lt;br /&gt;
 max_fsm_relations = 5000&lt;br /&gt;
&lt;br /&gt;
These are used to hold the free-space map, and if they are too small you will see performance degradation after the database has been operating for some time. The exact numbers to set can be gleaned from the output of VACUUM VERBOSE, which prints the required FSM pages at the end of it&#039;s run. The 5x increase seems to be useful for a Moodle installation, from experience.&lt;br /&gt;
&lt;br /&gt;
 wal_buffers = 64&lt;br /&gt;
&lt;br /&gt;
These buffers are used for the write-ahead log, and there have been a number of reports on the PostgreSQL mailing lists of improvement from this level of increase.&lt;br /&gt;
&lt;br /&gt;
This is a little out of date now (version 8.0) but still worth a read: http://www.powerpostgresql.com/Docs&lt;br /&gt;
&lt;br /&gt;
And there is lots of good stuff here as well: http://www.varlena.com/GeneralBits/Tidbits/index.php&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Based on Andrew McMillan&#039;s post at [http://moodle.org/mod/forum/discuss.php?d=68558 Tuning PostgreSQL] forum thread.&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
===Other database performance links===&lt;br /&gt;
* Consider using a &#039;&#039;&#039;distributed cacheing system&#039;&#039;&#039; like [http://en.wikipedia.org/wiki/Memcached memcached] but note that memcached does not have any security features so it should be used behind a firewall.&lt;br /&gt;
* Consider using PostgreSQL. See [[Arguments in favour of PostgreSQL]] and [http://moodle.org/mod/forum/discuss.php?d=49195 how to migrate from MySQL to PostgreSQL] (forum discussion).&lt;br /&gt;
* [http://dev.mysql.com/doc/refman/5.0/en/server-parameters.html General advice on tuning MySQL parameters] (advice from the MySQL manual)&lt;br /&gt;
* [http://www.mysqlperformanceblog.com/2007/11/01/innodb-performance-optimization-basics/ InnoDB performance optimization] taken from the [http://www.mysqlperformanceblog.com/ MySQL performance blog] site.&lt;br /&gt;
&lt;br /&gt;
==Performance of different Moodle modules==&lt;br /&gt;
&lt;br /&gt;
Moodle&#039;s activity modules, filters, and other plugins can be activated/deactivated. If necessary, you may wish to deactivate some features (such as chat) if not required - but this isn&#039;t necessary. Some notes on the performance of certain modules:&lt;br /&gt;
&lt;br /&gt;
* The &#039;&#039;&#039;Chat&#039;&#039;&#039; module is [http://moodle.org/mod/forum/discuss.php?d=37979&amp;amp;parent=175079 said] to be a hog in terms of frequent HTTP requests to the main server. This can be reduced by setting the module to use &#039;&#039;Streamed&#039;&#039; updates, or, if you&#039;re using a Unix-based webserver, by running the chat in daemon mode. When using the Chat module use the configuration settings to tune for your expected load. Pay particular attention to the &#039;&#039;chat_old_ping&#039;&#039; and &#039;&#039;chat_refresh&#039;&#039; parameters as these can have greatest impact on server load.&lt;br /&gt;
* The &#039;&#039;&#039;Quiz&#039;&#039;&#039; module is known to stretch database performance. However, it has been getting better in recent versions, and we don&#039;t know of any good, up-to-date performance measurements. (Here is a [http://moodle.org/mod/forum/discuss.php?d=68579 case study from 2007 with 300 quiz users].)&lt;br /&gt;
* The Moodle &#039;&#039;&#039;Cron&#039;&#039;&#039; task is triggered by calling the script &#039;&#039;cron.php&#039;&#039;. If this is called over HTTP (e.g. using wget or curl) it can take a large amount of memory on large installations. If it is called by directly invoking the php command (e.g. &#039;&#039;php -f /path/to/moodle/directory/admin/cron.php&#039;&#039;) efficiency can be much improved.&lt;br /&gt;
* The &#039;&#039;&#039;Recent activities&#039;&#039;&#039; block is consuming to much resources if you have huge number of records &amp;lt;code&amp;gt;mdl_log&amp;lt;/code&amp;gt;. this is being tested to optimize the SQL query.&lt;br /&gt;
&lt;br /&gt;
==Moodle Image Optimization==&lt;br /&gt;
&lt;br /&gt;
The base images delivered in the original Moodle distribution package provide unoptimized graphics, most of which can benefit from lossless recompression utilizing [http://optipng.sourceforge.net/ optipng] for PNGs, [http://www.lcdf.org/gifsicle/ gifsicle] for GIFs and [http://www.kokkonen.net/tjko/projects.html jpegoptim] for JPGs.  Optimized graphics transfer faster and provide a faster perceived response for clients[http://www.websiteoptimization.com/speed/12/], especially distance learners.  The following example will recursively optimize (without any loss of quality) all the graphics and image files included in a base Moodle installation directory on a server with the above commands installed and available.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
find /example/directory/moodle-1.9 -iname *.png -exec optipng -o7 {} \;&lt;br /&gt;
find /example/directory/moodle-1.9 -iname *.gif -exec gifsicle -O2 -b {} \;&lt;br /&gt;
find /example/directory/moodle-1.9 -iname *.jpg -exec jpegoptim -p {} \;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Both [http://optipng.sourceforge.net/ optipng] and [http://www.lcdf.org/gifsicle/ gifsicle] are provided in the base repositories of most newer Linux distributions; [http://www.kokkonen.net/tjko/projects.html jpegoptim] must be downloaded and installed manually.&lt;br /&gt;
&lt;br /&gt;
==See also==&lt;br /&gt;
&lt;br /&gt;
*Using Moodle: [http://moodle.org/mod/forum/view.php?f=94 Hardware and Performance] forum&lt;br /&gt;
*[http://opensourceelearning.blogspot.be/2012/10/why-your-moodle-site-is-slow-five.html Why Your Moodle Site is Slow: Five Simple Settings] blog post from Jonathan Moore &lt;br /&gt;
*I teach with Moodle perfomance testing: http://www.iteachwithmoodle.com/2012/11/17/moodle-2-4-beta-performance-test-comparison-with-moodle-2-3/&lt;br /&gt;
*[http://jfilip.ca/2013/08/20/moodle-2-4-5-vs-2-5-1-performance-and-muc-apc-cache-store/ Moodle 2.4.5 vs 2.5.2 performance and MUC APC cahe store]&lt;br /&gt;
*[http://jfilip.ca/2013/09/25/moodle-performance-testing-2-4-6-vs-2-5-2-vs-2-6dev/ Moodle performance testing 2.4.6 vs 2.5.2 vs 2.6dev]&lt;br /&gt;
*[http://jfilip.ca/2013/09/24/moodle-performance-analysis-revisted-now-with-mariadb/ Moodle performance analysis revisited (now with MariaDB)]&lt;br /&gt;
*[http://tjhunt.blogspot.ca/2013/05/performance-testing-moodle.html Tim Hunt&#039;s blog (May 2, 2013) on performance testing Moodle]&lt;br /&gt;
*[http://newrelic.com/ New Relic, Application Performance Monitoring]&lt;br /&gt;
&lt;br /&gt;
There have been a lot of discussions on moodle.org about performance, here are some of the more interesting and (potentially) useful ones:&lt;br /&gt;
&lt;br /&gt;
* [http://moodle.org/mod/forum/discuss.php?d=83057 Performance woes!]&lt;br /&gt;
* [http://moodle.org/mod/forum/discuss.php?d=57028 Performance perspectives - a little script]&lt;br /&gt;
* [http://moodle.org/mod/forum/discuss.php?d=88927 Comments on planned server hardware]&lt;br /&gt;
* [http://moodle.org/mod/forum/discuss.php?d=102978#p461624 Moodle performance in a pil by Martin Langhoff]&lt;br /&gt;
* [https://moodle.org/mod/forum/discuss.php?d=240391#unread Advice on optimising php/db code in moodle2+]&lt;br /&gt;
&lt;br /&gt;
[[es:Rendimiento]]&lt;br /&gt;
[[fr:Performance]]&lt;br /&gt;
[[ja:パフォーマンス]]&lt;br /&gt;
[[de:Geschwindigkeitsempfehlungen]]&lt;/div&gt;</summary>
		<author><name>Emerrill</name></author>
	</entry>
	<entry>
		<id>https://docs.moodle.org/39/en/index.php?title=Performance_recommendations&amp;diff=106776</id>
		<title>Performance recommendations</title>
		<link rel="alternate" type="text/html" href="https://docs.moodle.org/39/en/index.php?title=Performance_recommendations&amp;diff=106776"/>
		<updated>2013-10-08T20:27:09Z</updated>

		<summary type="html">&lt;p&gt;Emerrill: /* Database performance */ dbperformance.php seems to no longer exist&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Performance}}&lt;br /&gt;
Moodle can be made to perform very well, at small usage levels or scaling up to many thousands of users. The factors involved in performance are basically the same as for any PHP-based database-driven system. When trying to optimize your server, try to focus on the factor which will make the most difference to the user. For example, if you have relatively more users browsing than accessing the database, look to improve the webserver performance.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Obtain a baseline benchmark==&lt;br /&gt;
&lt;br /&gt;
Before attempting any optimization, you should obtain a baseline benchmark of the component of the system you are trying to improve. For Linux try [http://lbs.sourceforge.net/ LBS] and for Windows use the Performance Monitor. Once you have quantitative data about how your system is performing currently, you&#039;ll be able to determine if the change you have made has had any real impact.&lt;br /&gt;
&lt;br /&gt;
The overall aim of adjustments to improve performance is to use RAM (cacheing) and to reduce disk-based activity. It is especially important to try to eliminate swap file usage as much as you can. If your system starts swapping, this is a sign that you need more RAM. &lt;br /&gt;
&lt;br /&gt;
The &#039;&#039;&#039;optimization order preference&#039;&#039;&#039; is usually: primary storage (more RAM), secondary storage (faster hard disks/improved hard disk configuration), processor (more and faster).&lt;br /&gt;
&lt;br /&gt;
==Scalability==&lt;br /&gt;
&lt;br /&gt;
Moodle&#039;s design (with clear separation of application layers) allows for strongly scalable setups. (Please check the list of [[Large installations|large Moodle installations]].)&lt;br /&gt;
&lt;br /&gt;
Large sites usually separate the web server and database onto separate servers, although for smaller installations this is typically not necessary.&lt;br /&gt;
&lt;br /&gt;
It is possible to load-balance a Moodle installation, for example by using more than one webserver. The separate webservers should query the same database and refer to the same filestore area, but otherwise the separation of the application layers is complete enough to make this kind of clustering feasible. Similarly, the database could be a cluster of servers (e.g. a MySQL cluster), but this is not an easy task and you should seek expert support, e.g. from a Moodle Partner.&lt;br /&gt;
&lt;br /&gt;
===Server cluster===&lt;br /&gt;
&lt;br /&gt;
Using Moodle forum discussions:&lt;br /&gt;
&lt;br /&gt;
*[http://moodle.org/mod/forum/discuss.php?d=57202 Moodle clustering]&lt;br /&gt;
*[http://moodle.org/mod/forum/discuss.php?d=44470 Software load balancing]&lt;br /&gt;
*[http://moodle.org/mod/forum/discuss.php?d=49986 TCP load balancing]&lt;br /&gt;
*[http://moodle.org/mod/forum/discuss.php?d=88214 Installation for 3000 simultaneous users]&lt;br /&gt;
&lt;br /&gt;
==Hardware configuration==&lt;br /&gt;
&#039;&#039;&#039;Note&#039;&#039;&#039;: The fastest and most effective change that you can make to improve performance is to &#039;&#039;&#039;increase the amount of RAM on your web server&#039;&#039;&#039; - get as much as possible (e.g. 4GB or more). Increasing primary memory will reduce the need for processes to swap to disk and will enable your server to handle more users.&lt;br /&gt;
* Better performance is gained by obtaining the best &#039;&#039;&#039;processor capability&#039;&#039;&#039; you can, i.e. dual or dual core processors. A modern BIOS should allow you to enable hyperthreading, but check if this makes a difference to the overall performance of the processors by using a [http://en.wikipedia.org/wiki/Super_PI CPU benchmarking tool].&lt;br /&gt;
* If you can afford them, use &#039;&#039;&#039;SCSI hard disks&#039;&#039;&#039; instead of SATA drives. SATA drives will increase your system&#039;s CPU utilization, whereas SCSI drives have their own integrated processors and come into their own when you have multiple drives. If you must have SATA drives, check that your motherboard and the drives themselves support NCQ (Native Command Queuing).&lt;br /&gt;
* Purchase hard disks with a &#039;&#039;&#039;low seek time&#039;&#039;&#039;. This will improve the overall speed of your system, especially when accessing Moodle&#039;s reports.&lt;br /&gt;
* Size your &#039;&#039;&#039;swap file&#039;&#039;&#039; correctly. The general advice is to set it to 4 x physical RAM.&lt;br /&gt;
* Use a &#039;&#039;&#039;RAID disk system&#039;&#039;&#039;. Although there are many different RAID configurations you can create, the following generally works best:&lt;br /&gt;
** install a hardware RAID controller (if you can)&lt;br /&gt;
** the operating system and swap drive on one set of disks configured as RAID-1.&lt;br /&gt;
** Moodle, Web server and Database server on another set of disks configured as RAID-5.&lt;br /&gt;
* Use &#039;&#039;&#039;gigabit ethernet&#039;&#039;&#039; for improved latency and throughput. This is especially important when you have your webserver and database server separated out on different hosts.&lt;br /&gt;
* Check the settings on your &#039;&#039;&#039;network card&#039;&#039;&#039;. You may get an improvement in performance by increasing the use of buffers and transmit/receive descriptors (balance this with processor and memory overheads) and off-loading TCP checksum calculation onto the card instead of the OS.&lt;br /&gt;
*  Read this [http://moodle.org/mod/forum/discuss.php?d=68579 Case Study] on a server stress test with 300 users.  &lt;br /&gt;
* See this [http://elearning.sgu.ac.jp/doc/PT/ accompanying report] on network traffic and server loads.&lt;br /&gt;
* See the [[Moodle.org configuration]]&lt;br /&gt;
* Also see this SFSU presentation at Educause (using VMWare): [http://www.educause.edu/Resources/AnOpenSourceLMSforaMissionCrit/162843]&lt;br /&gt;
&lt;br /&gt;
==Operating System==&lt;br /&gt;
* You can use [http://en.wikipedia.org/wiki/Linux Linux](recommended), Unix-based, Windows or Mac OS X for the server &#039;&#039;&#039;operating system&#039;&#039;&#039;. *nix operating systems generally require less memory than Mac OS X or Windows servers for doing the same task as the server is configured with just a shell interface. Additionally Linux does not have licensing fees attached, but can have a big learning curve if you&#039;re used to another operating system. If you have a large number of processors running SMP, you may also want to consider using a highly tuned OS such as [http://en.wikipedia.org/wiki/Solaris_Operating_Environment Solaris].&lt;br /&gt;
* Check your own OS and &#039;&#039;&#039;vendor specific instructions&#039;&#039;&#039; for optimization steps.&lt;br /&gt;
** For Linux look at the [http://linuxperf.sourceforge.net/ Linux Performance Team] site. &lt;br /&gt;
** For Linux investigate the hdparm command, e.g. hdparm -m16 -d1 can be used to enable read/write on multiple sectors and DMA. Mount disks with the async and noatime options.&lt;br /&gt;
** For Windows set the sever to be optimized for network applications (Control Panel, Network Connections, LAN connection, Properties, File &amp;amp; Printer Sharing for Microsoft Networks, Properties, Optimization). You can also search the [http://technet.microsoft.com/ Microsoft TechNet site] for optimization documents.&lt;br /&gt;
&lt;br /&gt;
==Web server performance==&lt;br /&gt;
&lt;br /&gt;
Installing [http://www.mozilla.com/en-US/ Firefox] and the [https://addons.mozilla.org/en-US/firefox/addon/1843 firebug] extension will allow you to watch the time it takes for each page component to load. Also, the [https://addons.mozilla.org/en-US/firefox/addon/5369 Yslow] extension will evaluate your page against Yahoo&#039;s [http://www.skrenta.com/2007/05/14_rules_for_fast_web_pages_by_1.html 14 rules], full text [http://developer.yahoo.com/performance/rules.html Best Practices for Speeding Up Your Web Site], &amp;lt;strike&amp;gt;([http://video.yahoo.com/video/play?vid=1040890 video])&amp;lt;/strike&amp;gt; for fast loading websites.&lt;br /&gt;
&lt;br /&gt;
===PHP performance===&lt;br /&gt;
* You are strongly recommended to use a &#039;&#039;&#039;PHP accelerator&#039;&#039;&#039; to ease CPU load, such as [http://pecl.php.net/apc APC], [http://www.php-accelerator.co.uk/ PHPA], [http://trac.lighttpd.net/xcache/ Xcache], [http://sourceforge.net/projects/wincache WinCache] or [http://eaccelerator.net/ eAccelerator]. (Take care to choose a PHP accelerator that is known to work well with your version of PHP and note that Turck MMCache is [http://turckmmcache.exeprod.com/TheManifestoEnglish no longer maintained] and can cause failures with PHP 5). &lt;br /&gt;
* Improvements in read/write performance can be improved by putting the cached PHP pages on a [[TMPFS]] filesystem - but remember that you&#039;ll lose the cache contents when there is a power failure or the server is rebooted.&lt;br /&gt;
* Performance of PHP is better when installed as an &#039;&#039;&#039;Apache/IIS6 ISAPI module&#039;&#039;&#039; (rather than a CGI). IIS 7.0/7.5 (Windows Server 2008/R2) users should choose a FastCGI installation for best performance.&lt;br /&gt;
* Also check the &#039;&#039;&#039;memory_limit&#039;&#039;&#039; in php.ini, reduce it to 16M for Moodle version earlier than 1.7 ([http://moodle.org/mod/forum/discuss.php?d=39656 See this forum discussion]). For Moodle 1.7 or later, it is recommended that the value of memory_limit should be 40M. As of [http://www.php.net/ChangeLog-5.php PHP 5.2.1] the default value for the memory_limit directive is 128M.&lt;br /&gt;
* Also see [[PHP_settings_by_Moodle_version]]&lt;br /&gt;
&lt;br /&gt;
===Install HowTo===&lt;br /&gt;
* [http://2bits.com/articles/installing-php-apc-gnulinux-centos-5.html APC on CentOS 5.x (linux)]&lt;br /&gt;
* [http://fplanque.com/dev/linux/install-apc-php-cache-debian-lenny APC on Debian (linux)]&lt;br /&gt;
* [http://www.linuxtuts.net/211-installing-memcached-php5-memcache-module-debian-apache2.html MemCache module on Debian (Apache2 and PHP5) ]&lt;br /&gt;
* [http://noveckg.blogspot.com/2010/03/installing-memcached-on-centos-5x.html Installing Memcache on CentOS 5.x (linux)]&lt;br /&gt;
* [http://noveckg.blogspot.com/2010/02/installing-eaccelerator-cache-for-php.html Installing eAccelerator on CentOS 5.x (linux)]&lt;br /&gt;
* [https://docs.moodle.org/en/Installing_eAccelerator_In_Ubuntu_Server/ Installing eAccelerator on Ubuntu Server (linux)]&lt;br /&gt;
&lt;br /&gt;
===Apache performance===&lt;br /&gt;
* If you are using Apache on a Windows server, use the build from [http://www.apachelounge.com Apache Lounge] which is reported to have [http://moodle.org/mod/forum/discuss.php?d=93358 performance and stability improvements] compared to the official Apache download. Note that this is an unofficial build, so may not keep up with official releases.&lt;br /&gt;
* Set the &#039;&#039;&#039;MaxClients&#039;&#039;&#039; directive correctly. Use this formula to help (which uses 80% of available memory to leave room for spare):&lt;br /&gt;
 MaxClients = Total available memory * 80% / Max memory usage of apache process&lt;br /&gt;
:Memory usage of apache process is usually 10MB but Moodle can easily use up to 100MB per process, so a general rule of thumb is to divide your available memory in megabytes by 100 to get a conservative setting for MaxClients. You are quite likely to find yourself lowering the MaxClients from its default of 150 on a Moodle server. To get a more accurate estimate read the value from the shell command:&lt;br /&gt;
 #ps -ylC httpd --sort:rss&lt;br /&gt;
&lt;br /&gt;
:If you need to increase the value of &#039;&#039;&#039;MaxClients&#039;&#039;&#039; beyond 256, you will also need to set the &#039;&#039;&#039;ServerLimit&#039;&#039;&#039; directive. &lt;br /&gt;
&lt;br /&gt;
:&#039;&#039;&#039;Warning&#039;&#039;&#039;: Do not be tempted to set the value of MaxClients higher than your available memory as your server will consume more RAM than available and start to swap to disk. &lt;br /&gt;
* Consider reducing the &#039;&#039;&#039;number of modules&#039;&#039;&#039; that Apache loads in the httpd.conf file to the minumum necessary to reduce the memory needed. &lt;br /&gt;
* Use the &#039;&#039;&#039;latest version of Apache&#039;&#039;&#039; - Apache 2 has an improved memory model which reduces memory usage further.&lt;br /&gt;
* For Unix/Linux systems, consider lowering &#039;&#039;&#039;MaxRequestsPerChild&#039;&#039;&#039; in httpd.conf to as low as 20-30 (if you set it any lower the overhead of forking begins to outweigh the benefits). &lt;br /&gt;
* For a heavily loaded server, consider setting &#039;&#039;&#039;KeepAlive Off&#039;&#039;&#039; (do this only if your Moodle pages do not contain links to resources or uploaded images) or lowering the &#039;&#039;&#039;KeepAliveTimeout&#039;&#039;&#039; to between 2 and 5. The default is 15 (seconds) - the higher the value the more server processes will be kept waiting for possibly idle connections. A more accurate value for KeepAliveTimeout is obtained by observing how long it takes your users to download a page. After altering any of the KeepAlive variables, monitor your CPU utilization as there may be an additional overhead in initiating more worker processes/threads.&lt;br /&gt;
* As an alternative to using KeepAlive Off, consider setting-up a &#039;&#039;&#039;Reverse Proxy server&#039;&#039;&#039; infront of the Moodle server to cache HTML files with images. You can then return Apache to using keep-alives on the Moodle server.&lt;br /&gt;
* If you do not use a .htaccess file, set the &#039;&#039;&#039;AllowOverride&#039;&#039;&#039; variable to AllowOverride None to prevent .htaccess lookups.&lt;br /&gt;
* Set &#039;&#039;&#039;DirectoryIndex&#039;&#039;&#039; correctly so as to avoid content-negotiation. Here&#039;s an example from a production server:&lt;br /&gt;
 DirectoryIndex index.php index.html index.htm&lt;br /&gt;
* Unless you are doing development work on the server, set &#039;&#039;&#039;ExtendedStatus Off&#039;&#039;&#039; and disable mod_info as well as mod_status.&lt;br /&gt;
* Leave &#039;&#039;&#039;HostnameLookups Off&#039;&#039;&#039; (as default) to reduce DNS latency.&lt;br /&gt;
* Consider reducing the value of &#039;&#039;&#039;TimeOut&#039;&#039;&#039; to between 30 to 60 (seconds). &lt;br /&gt;
* For the &#039;&#039;&#039;Options directive&#039;&#039;&#039;, avoid Options Multiviews as this performs a directory scan. To reduce disk I/O further use&lt;br /&gt;
 Options -Indexes FollowSymLinks&lt;br /&gt;
*&#039;&#039;&#039;Caching (absolutely unsupported, Moodle 1.9 only)&#039;&#039;&#039; &#039;&#039;Please note that this kind of caching creates major problems during upgrades, you need to remove the caching directives one week before any upgrade.&#039;&#039; Apache can be told to make pages load a lot faster by specifying that the browser should cache some various page elements such as images and reuse them from local memory rather than ask for them again every time a page is requested. How to do this varies slightly between OSes but there are two basic steps:&lt;br /&gt;
&lt;br /&gt;
# Install and enable mod_expires - refer to documentation or man pages&lt;br /&gt;
# Add this code to the virtual server config file within the &amp;lt;directory&amp;gt; section for the root directory (or within the .htaccess file if AllowOverrides is On):&lt;br /&gt;
 &amp;lt;IfModule mod_expires.c&amp;gt;&lt;br /&gt;
  ExpiresActive On&lt;br /&gt;
  ExpiresDefault &amp;quot;access plus 1 seconds&amp;quot;&lt;br /&gt;
  ExpiresByType text/html &amp;quot;access plus 1 seconds&amp;quot;&lt;br /&gt;
  ExpiresByType image/gif &amp;quot;access plus 1 week&amp;quot;&lt;br /&gt;
  ExpiresByType image/jpeg &amp;quot;access plus 1 week&amp;quot;&lt;br /&gt;
  ExpiresByType image/png &amp;quot;access plus 1 week&amp;quot;&lt;br /&gt;
  ExpiresByType text/css &amp;quot;access plus 1 week&amp;quot;&lt;br /&gt;
  ExpiresByType text/javascript &amp;quot;access plus 1 week&amp;quot;&lt;br /&gt;
  ExpiresByType application/x-javascript &amp;quot;access plus 1 week&amp;quot;&lt;br /&gt;
  ExpiresByType text/xml &amp;quot;access plus 1 seconds&amp;quot;&lt;br /&gt;
 &amp;lt;/IfModule&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The effect is to make everything stay in the cache except HTML and XML, which change dynamically. It&#039;s possible to gain a several hundred percent decrease in load times this way. Adjust the cache times according to how often your images etc change.&lt;br /&gt;
&lt;br /&gt;
* Compression reduces response times by reducing the size of the HTTP response&lt;br /&gt;
# Install and enable mod_deflate - refer to documentation or man pages&lt;br /&gt;
# Add this code to the virtual server config file within the &amp;lt;directory&amp;gt; section for the root directory (or within the .htaccess file if AllowOverrides is On):&lt;br /&gt;
 &amp;lt;ifModule mod_deflate.c&amp;gt;&lt;br /&gt;
   AddOutputFilterByType DEFLATE text/html text/plain text/xml&lt;br /&gt;
 &amp;lt;/ifmodule&amp;gt;&lt;br /&gt;
&lt;br /&gt;
More info: [http://metaskills.net/2006/02/19/how-to-control-browser-caching-with-apache-2/ www.metaskills.net]&lt;br /&gt;
&lt;br /&gt;
===IIS performance===&lt;br /&gt;
All alter this location in the registry:&lt;br /&gt;
 HKLM\SYSTEM\CurrentControlSet\Services\Inetinfo\Parameters\&lt;br /&gt;
* The equivalent to KeepAliveTimeout is &#039;&#039;&#039;ListenBackLog&#039;&#039;&#039; (IIS - registry location is HKLM\ SYSTEM\ CurrentControlSet\ Services\ Inetinfo\ Parameters). Set this to between 2 to 5.&lt;br /&gt;
*Change the &#039;&#039;&#039;MemCacheSize&#039;&#039;&#039; value to adjust the amount of memory (Mb) that IIS will use for its file cache (50% of available memory by default).&lt;br /&gt;
*Change the &#039;&#039;&#039;MaxCachedFileSize&#039;&#039;&#039; to adjust the maximum size of a file cached in the file cache in bytes. Default is 262,144 (256K).&lt;br /&gt;
*Create a new DWORD called &#039;&#039;&#039;ObjectCacheTTL&#039;&#039;&#039; to change the length of time (in milliseconds) that objects in the cache are held in memory. Default is 30,000 milliseconds (30 seconds).&lt;br /&gt;
&lt;br /&gt;
===Lighttpd, NginX and Cherokee performance===&lt;br /&gt;
You can increase server performance by using a &#039;&#039;&#039;light-weight&#039;&#039;&#039; webserver like [http://www.lighttpd.net/ lighttpd],  [http://nginx.net/ nginx] or [http://www.cherokee-project.com/ cherokee] in combination with PHP in FastCGI-mode. Lighttpd was originally created as a proof-of-concept[http://www.lighttpd.net/story] to address the [http://www.kegel.com/c10k.html C10k problem] and while primarily recommended for memory-limited servers, its design origins and asynchronous-IO model make it a suitable and proven[http://blog.lighttpd.net/articles/2006/12/28/lighttpd-powers-5-alexa-top-250-sites] alternative HTTP server for high-load websites and web apps, including Moodle. See the [[lighttpd | MoodleDocs Lighttpd page]] for additional information, configuration example and links.&lt;br /&gt;
&lt;br /&gt;
Alternatively, both [http://www.lighttpd.net/ lighttpd] and [http://nginx.net/ nginx] are capable of performing as a load-balancer and/or reverse-proxy to alleviate load on back-end servers[http://www.linuxjournal.com/article/10108], providing benefit without requiring an actual software change on existing servers.&lt;br /&gt;
&lt;br /&gt;
Do note that these are likely to be the least tested server environments of all particularly if you are using advanced features such as web services and/or Moodle Networking. They are probably best considered for heavily used Moodle sites with relatively simple configurations.&lt;br /&gt;
&lt;br /&gt;
==Database performance==&lt;br /&gt;
&lt;br /&gt;
===MySQL performance===&lt;br /&gt;
&lt;br /&gt;
The following are MySQL specific settings which can be adjusted for better performance in your my.cnf (my.ini in Windows). The file contains a list of settings and their values. To see the current values use these commands&lt;br /&gt;
 SHOW STATUS;&lt;br /&gt;
 SHOW VARIABLES; &lt;br /&gt;
&#039;&#039;&#039;Important&#039;&#039;&#039;: You must make backups of your database before attempting to change any MySQL server configuration. After any change to the my.cnf, restart mysqld.&lt;br /&gt;
&lt;br /&gt;
If you are able, the [http://mysqltuner.com/ MySQLTuner] tool can be run against your MySQL server and will calculate appropriate configuration values for most of the following settings based on your current load, status and variables automatically.&lt;br /&gt;
&lt;br /&gt;
* Enable the &#039;&#039;&#039;query cache&#039;&#039;&#039; with &lt;br /&gt;
 query_cache_type = 1. &lt;br /&gt;
For most Moodle installs, set the following:&lt;br /&gt;
 query_cache_size = 36M &lt;br /&gt;
 query_cache_min_res_unit = 2K. &lt;br /&gt;
The query cache will improve performance if you are doing few updates on the database. &lt;br /&gt;
* Set the &#039;&#039;&#039;table cache&#039;&#039;&#039; correctly. For Moodle 1.6 set &lt;br /&gt;
 table_cache = 256 #(table_open_cache in MySQL &amp;gt; 5.1.2)&lt;br /&gt;
(min), and for Moodle 1.7 set &lt;br /&gt;
 table_cache = 512 #(table_open_cache in MySQL &amp;gt; 5.1.2)&lt;br /&gt;
(min). The table cache is used by all threads (connections), so monitor the value of opened_tables to further adjust - if opened_tables &amp;gt; 3 * table_cache(table_open_cache in MySQL &amp;gt; 5.1.2) then increase table_cache upto your OS limit. Note also that the figure for table_cache will also change depending on the number of modules and plugins you have installed. Find the number for your server by executing the mysql statement below. Look at the number returned and set table_cache to this value.&lt;br /&gt;
 mysql&amp;gt;SELECT COUNT(table_name) FROM information_schema.tables WHERE table_schema=&#039;yourmoodledbname&#039;;&lt;br /&gt;
* Set the &#039;&#039;&#039;thread cache&#039;&#039;&#039; correctly. Adjust the value so that your thread cache utilization is as close to 100% as possible by this formula:&lt;br /&gt;
 thread cache utilization (%) = (threads_created / connections) * 100&lt;br /&gt;
* The &#039;&#039;&#039;key buffer&#039;&#039;&#039; can improve the access speed to Moodle&#039;s SELECT queries. The correct size depends on the size of the index files (.myi) and in Moodle 1.6 or later (without any additional modules and plugins), the recommendation for this value is key_buffer_size = 32M. Ideally you want the database to be reading once from the disk for every 100 requests so monitor that the value is suitable for your install by adjusting the value of key_buffer_size so that the following formulas are true:&lt;br /&gt;
 key_read / key_read_requests &amp;lt; 0.01&lt;br /&gt;
 key_write / key_write_requests &amp;lt;= 1.0&lt;br /&gt;
* Set the &#039;&#039;&#039;maximum number of connections&#039;&#039;&#039; so that your users will not see a &amp;quot;Too many connections&amp;quot; message. Be careful that this may have an impact on the total memory used. MySQL connections usually last for milliseconds, so it is unusual even for a heavily loaded server for this value to be over 200.&lt;br /&gt;
* Manage &#039;&#039;&#039;high burst activity&#039;&#039;&#039;. If your Moodle install uses a lot of quizzes and you are experiencing performance problems (check by monitoring the value of threads_connected - it should not be rising) consider increasing the value of back_log.&lt;br /&gt;
* &#039;&#039;&#039;Optimize your tables weekly and after upgrading Moodle&#039;&#039;&#039;. It is good practice to also optimize your tables after performing a large data deletion exercise, e.g. at the end of your semester or academic year. This will ensure that index files are up to date. Backup your database first and then use:&lt;br /&gt;
 mysql&amp;gt;CHECK TABLE mdl_tablename;&lt;br /&gt;
 mysql&amp;gt;OPTIMIZE TABLE mdl_tablename;&lt;br /&gt;
:The common tables in Moodle to check are mdl_course_sections, mdl_forum_posts, mdl_log and mdl_sessions (if using dbsessions). Any errors need to be corrected using REPAIR TABLE (see the [http://dev.mysql.com/doc/refman/5.0/en/repair-table.html MySQL manual] and this [http://moodle.org/mod/forum/discuss.php?d=58208#p279638 forum script]).&lt;br /&gt;
* &#039;&#039;&#039;Maintain the key distribution&#039;&#039;&#039;. Every month or so it is a good idea to stop the mysql server and run these myisamchk commands.&lt;br /&gt;
 #myisamchk -a -S /pathtomysql/data/moodledir/*.MYI&lt;br /&gt;
:&#039;&#039;&#039;Warning&#039;&#039;&#039;: You must stop the mysql database process (mysqld) before running any myisamchk command. If you do not, you risk data loss.&lt;br /&gt;
* Reduce the number of &#039;&#039;&#039;temporary tables saved to disk&#039;&#039;&#039;. Check this with the created_tmp_disk_tables value. If this is relatively large (&amp;gt;5%) increase tmp_table_size until you see a reduction. Note that this will have an impact on RAM usage.&lt;br /&gt;
&lt;br /&gt;
===PostgreSQL performance===&lt;br /&gt;
&lt;br /&gt;
There are some good papers around on tuning PostgreSQL (like [http://wiki.postgresql.org/wiki/Tuning_Your_PostgreSQL_Server this one]), and Moodle&#039;s case does not seem to be different to the general case.&lt;br /&gt;
&lt;br /&gt;
The first thing to recognise is that if you really need to worry about tuning you should be using a separate machine for the database server. If you are not using a separate machine then the answers to many performance questions are substantially muddied by the memory requirements of the rest of the application.&lt;br /&gt;
&lt;br /&gt;
You should probably &#039;&#039;&#039;enable autovacuum&#039;&#039;&#039;, unless you know what you are doing. Many e-learning sites have predictable periods of low use, so disabling autovacuum and running a specific vacuum at those times can be a good option. Or perhaps leave autovacuum running but do a full vacuum weekly in a quiet period.&lt;br /&gt;
&lt;br /&gt;
Set &#039;&#039;&#039;shared_buffers&#039;&#039;&#039; to something reasonable. For versions up to 8.1 my testing has shown that peak performance is almost always obtained with buffers &amp;lt; 10000, so if you are using such a version, and have more than 512M of RAM just set shared_buffers to 10,000 (8MB).&lt;br /&gt;
&lt;br /&gt;
The buffer management had a big overhaul in 8.2 and &amp;quot;reasonable&amp;quot; is now a much larger number. I have not conducted performance tests with 8.2, but the recommendations from others are generally that you should now scale shared_buffers much more with memory and may continue to reap benefits even up to values like 100,000 (80MB). Consider using 1-2% of system RAM.&lt;br /&gt;
&lt;br /&gt;
PostgreSQL will also assume that the operating system is caching its files, so setting &#039;&#039;&#039;effective_cache_size&#039;&#039;&#039; to a reasonable value is also a good idea. A reasonable value will usually be (total RAM - RAM in use by programs). If you are running Linux and leave the system running for a day or two you can look at &#039;free&#039; and under the &#039;cached&#039; column you will see what it currently is. Consider taking that number (which is kB) and dividing it by 10 (i.e. allow 20% for other programs cache needs and then divide by 8 to get pages). If you are not using a dedicated database server you will need to decrease that value to account for usage by other programs.&lt;br /&gt;
&lt;br /&gt;
Some other useful parameters that can have positive effects, and the values I would typically set them to on a machine with 4G RAM, are:&lt;br /&gt;
&lt;br /&gt;
 work_mem = 10240&lt;br /&gt;
&lt;br /&gt;
That&#039;s 10M of RAM to use instead of on-disk sorting and so forth. That can give a big speed increase, but it is per connection and 200 connections * 10M is 2G, so it can theoretically chew up a lot of RAM.&lt;br /&gt;
&lt;br /&gt;
 maintenance_work_mem = 163840&lt;br /&gt;
&lt;br /&gt;
That&#039;s 160M of RAM which will be used by (e.g.) VACUUM, index rebuild, cluster and so forth. This should only be used periodically and should be freed when those processes exit, so I believe it is well worth while.&lt;br /&gt;
&lt;br /&gt;
 max_fsm_pages = 100000&lt;br /&gt;
 max_fsm_relations = 5000&lt;br /&gt;
&lt;br /&gt;
These are used to hold the free-space map, and if they are too small you will see performance degradation after the database has been operating for some time. The exact numbers to set can be gleaned from the output of VACUUM VERBOSE, which prints the required FSM pages at the end of it&#039;s run. The 5x increase seems to be useful for a Moodle installation, from experience.&lt;br /&gt;
&lt;br /&gt;
 wal_buffers = 64&lt;br /&gt;
&lt;br /&gt;
These buffers are used for the write-ahead log, and there have been a number of reports on the PostgreSQL mailing lists of improvement from this level of increase.&lt;br /&gt;
&lt;br /&gt;
This is a little out of date now (version 8.0) but still worth a read: http://www.powerpostgresql.com/Docs&lt;br /&gt;
&lt;br /&gt;
And there is lots of good stuff here as well: http://www.varlena.com/GeneralBits/Tidbits/index.php&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Based on Andrew McMillan&#039;s post at [http://moodle.org/mod/forum/discuss.php?d=68558 Tuning PostgreSQL] forum thread.&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
===Other database performance links===&lt;br /&gt;
* Consider using a &#039;&#039;&#039;distributed cacheing system&#039;&#039;&#039; like [http://en.wikipedia.org/wiki/Memcached memcached] but note that memcached does not have any security features so it should be used behind a firewall.&lt;br /&gt;
* Consider using PostgreSQL. See [[Arguments in favour of PostgreSQL]] and [http://moodle.org/mod/forum/discuss.php?d=49195 how to migrate from MySQL to PostgreSQL] (forum discussion).&lt;br /&gt;
* [http://dev.mysql.com/doc/refman/5.0/en/server-parameters.html General advice on tuning MySQL parameters] (advice from the MySQL manual)&lt;br /&gt;
* [http://www.mysqlperformanceblog.com/2007/11/01/innodb-performance-optimization-basics/ InnoDB performance optimization] taken from the [http://www.mysqlperformanceblog.com/ MySQL performance blog] site.&lt;br /&gt;
&lt;br /&gt;
==Performance of different Moodle modules==&lt;br /&gt;
&lt;br /&gt;
Moodle&#039;s activity modules, filters, and other plugins can be activated/deactivated. If necessary, you may wish to deactivate some features (such as chat) if not required - but this isn&#039;t necessary. Some notes on the performance of certain modules:&lt;br /&gt;
&lt;br /&gt;
* The &#039;&#039;&#039;Chat&#039;&#039;&#039; module is [http://moodle.org/mod/forum/discuss.php?d=37979&amp;amp;parent=175079 said] to be a hog in terms of frequent HTTP requests to the main server. This can be reduced by setting the module to use &#039;&#039;Streamed&#039;&#039; updates, or, if you&#039;re using a Unix-based webserver, by running the chat in daemon mode. When using the Chat module use the configuration settings to tune for your expected load. Pay particular attention to the &#039;&#039;chat_old_ping&#039;&#039; and &#039;&#039;chat_refresh&#039;&#039; parameters as these can have greatest impact on server load.&lt;br /&gt;
* The &#039;&#039;&#039;Quiz&#039;&#039;&#039; module is known to stretch database performance. However, it has been getting better in recent versions, and we don&#039;t know of any good, up-to-date performance measurements. (Here is a [http://moodle.org/mod/forum/discuss.php?d=68579 case study from 2007 with 300 quiz users].)&lt;br /&gt;
* The Moodle &#039;&#039;&#039;Cron&#039;&#039;&#039; task is triggered by calling the script &#039;&#039;cron.php&#039;&#039;. If this is called over HTTP (e.g. using wget or curl) it can take a large amount of memory on large installations. If it is called by directly invoking the php command (e.g. &#039;&#039;php -f /path/to/moodle/directory/admin/cron.php&#039;&#039;) efficiency can be much improved.&lt;br /&gt;
* The &#039;&#039;&#039;Recent activities&#039;&#039;&#039; block is consuming to much resources if you have huge number of records &amp;lt;code&amp;gt;mdl_log&amp;lt;/code&amp;gt;. this is being tested to optimize the SQL query.&lt;br /&gt;
&lt;br /&gt;
==Moodle Image Optimization==&lt;br /&gt;
&lt;br /&gt;
The base images delivered in the original Moodle distribution package provide unoptimized graphics, most of which can benefit from lossless recompression utilizing [http://optipng.sourceforge.net/ optipng] for PNGs, [http://www.lcdf.org/gifsicle/ gifsicle] for GIFs and [http://www.kokkonen.net/tjko/projects.html jpegoptim] for JPGs.  Optimized graphics transfer faster and provide a faster perceived response for clients[http://www.websiteoptimization.com/speed/12/], especially distance learners.  The following example will recursively optimize (without any loss of quality) all the graphics and image files included in a base Moodle installation directory on a server with the above commands installed and available.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
find /example/directory/moodle-1.9 -iname *.png -exec optipng -o7 {} \;&lt;br /&gt;
find /example/directory/moodle-1.9 -iname *.gif -exec gifsicle -O2 -b {} \;&lt;br /&gt;
find /example/directory/moodle-1.9 -iname *.jpg -exec jpegoptim -p {} \;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Both [http://optipng.sourceforge.net/ optipng] and [http://www.lcdf.org/gifsicle/ gifsicle] are provided in the base repositories of most newer Linux distributions; [http://www.kokkonen.net/tjko/projects.html jpegoptim] must be downloaded and installed manually.&lt;br /&gt;
&lt;br /&gt;
==See also==&lt;br /&gt;
&lt;br /&gt;
*Using Moodle: [http://moodle.org/mod/forum/view.php?f=94 Hardware and Performance] forum&lt;br /&gt;
*[http://opensourceelearning.blogspot.be/2012/10/why-your-moodle-site-is-slow-five.html Why Your Moodle Site is Slow: Five Simple Settings] blog post from Jonathan Moore &lt;br /&gt;
*I teach with Moodle perfomance testing: http://www.iteachwithmoodle.com/2012/11/17/moodle-2-4-beta-performance-test-comparison-with-moodle-2-3/&lt;br /&gt;
*[http://jfilip.ca/2013/08/20/moodle-2-4-5-vs-2-5-1-performance-and-muc-apc-cache-store/ Moodle 2.4.5 vs 2.5.2 performance and MUC APC cahe store]&lt;br /&gt;
*[http://jfilip.ca/2013/09/25/moodle-performance-testing-2-4-6-vs-2-5-2-vs-2-6dev/ Moodle performance testing 2.4.6 vs 2.5.2 vs 2.6dev]&lt;br /&gt;
*[http://jfilip.ca/2013/09/24/moodle-performance-analysis-revisted-now-with-mariadb/ Moodle performance analysis revisited (now with MariaDB)]&lt;br /&gt;
*[http://tjhunt.blogspot.ca/2013/05/performance-testing-moodle.html Tim Hunt&#039;s blog (May 2, 2013) on performance testing Moodle]&lt;br /&gt;
*[http://newrelic.com/ New Relic, Application Performance Monitoring]&lt;br /&gt;
&lt;br /&gt;
There have been a lot of discussions on moodle.org about performance, here are some of the more interesting and (potentially) useful ones:&lt;br /&gt;
&lt;br /&gt;
* [http://moodle.org/mod/forum/discuss.php?d=83057 Performance woes!]&lt;br /&gt;
* [http://moodle.org/mod/forum/discuss.php?d=57028 Performance perspectives - a little script]&lt;br /&gt;
* [http://moodle.org/mod/forum/discuss.php?d=88927 Comments on planned server hardware]&lt;br /&gt;
* [http://moodle.org/mod/forum/discuss.php?d=102978#p461624 Moodle performance in a pil by Martin Langhoff]&lt;br /&gt;
* [https://moodle.org/mod/forum/discuss.php?d=240391#unread Advice on optimising php/db code in moodle2+]&lt;br /&gt;
&lt;br /&gt;
[[es:Rendimiento]]&lt;br /&gt;
[[fr:Performance]]&lt;br /&gt;
[[ja:パフォーマンス]]&lt;br /&gt;
[[de:Geschwindigkeitsempfehlungen]]&lt;/div&gt;</summary>
		<author><name>Emerrill</name></author>
	</entry>
	<entry>
		<id>https://docs.moodle.org/39/en/index.php?title=Capabilities/moodle/role:switchroles&amp;diff=106703</id>
		<title>Capabilities/moodle/role:switchroles</title>
		<link rel="alternate" type="text/html" href="https://docs.moodle.org/39/en/index.php?title=Capabilities/moodle/role:switchroles&amp;diff=106703"/>
		<updated>2013-09-28T02:11:45Z</updated>

		<summary type="html">&lt;p&gt;Emerrill: Updating to match Moodle 2&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Capabilities}}&lt;br /&gt;
*This allows a user to switch temporarily to another role in &#039;&#039;Administration &amp;gt; Switch role to...&#039;&#039; so that they can see what the course would look like to someone with that role.&lt;br /&gt;
*The &amp;quot;Switch role to...&amp;quot; list is set in the &amp;quot;Allow role switches&amp;quot; tab of &amp;quot;Site Administration &amp;gt; Users &amp;gt; Permissions &amp;gt; Define role&amp;quot; page.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;WARNING!&#039;&#039;&#039; This facility does not always give you a true picture of what the course would look like to someone with that role. It is recommended you have a &amp;quot;test&amp;quot; user with the appropriate role who can be used to give a more accurate view.&lt;br /&gt;
&lt;br /&gt;
[[File:switch role to.png]]&lt;br /&gt;
&lt;br /&gt;
==See also==&lt;br /&gt;
&lt;br /&gt;
*[[Managing roles]]&lt;br /&gt;
*The capability [[Capabilities/moodle/user:loginas|moodle/user:loginas]]&lt;br /&gt;
&lt;br /&gt;
[[Category:Capabilities|Role]]&lt;br /&gt;
[[Category:Roles]]&lt;br /&gt;
&lt;br /&gt;
[[fr:Capabilities/moodle/role:switchroles]]&lt;br /&gt;
[[ja:ケイパビリティ/moodle/role:switchroles]]&lt;/div&gt;</summary>
		<author><name>Emerrill</name></author>
	</entry>
	<entry>
		<id>https://docs.moodle.org/39/en/index.php?title=Available_for_group_members_only&amp;diff=106693</id>
		<title>Available for group members only</title>
		<link rel="alternate" type="text/html" href="https://docs.moodle.org/39/en/index.php?title=Available_for_group_members_only&amp;diff=106693"/>
		<updated>2013-09-23T23:07:38Z</updated>

		<summary type="html">&lt;p&gt;Emerrill: Updating to represent the current interface. Also, not sure what &amp;quot;No grouping means user has t one member of any group&amp;quot; was supposed to mean.&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Grouping users}}&lt;br /&gt;
&#039;&#039;Available for group members only&#039;&#039; is an experimental feature which may be enabled by an administrator in &#039;&#039;Settings &amp;gt; Site administration &amp;gt; Development &amp;gt; Experimental&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
==Assigning an activity to a grouping==&lt;br /&gt;
[[Image:Restricting an activity to a grouping.png|thumb|Assigning an activity to a particular grouping only]]&lt;br /&gt;
To assign an activity to a particular grouping:&lt;br /&gt;
#On the edit activity page, expand &amp;quot;Common module settings&amp;quot;.&lt;br /&gt;
#Ensure that the group mode is set to separate or visible groups.&lt;br /&gt;
#Select the grouping from the grouping dropdown menu.&lt;br /&gt;
#Check the &amp;quot;Available for group members only&amp;quot; checkbox&lt;br /&gt;
#Click the &amp;quot;Save changes&amp;quot; button at the bottom of the page.&lt;br /&gt;
&lt;br /&gt;
The name of the grouping will then appear in brackets after the activity name on the course page.&lt;br /&gt;
&lt;br /&gt;
:&#039;&#039;Note&#039;&#039;: If a graded activity is assigned to a particular grouping only, it will still appear in the [[Grades|gradebook]] for all users unless gradebook categories are set up in a certain way. See MDL-13868 for further details.&lt;br /&gt;
&lt;br /&gt;
:&#039;&#039;Note&#039;&#039;: You cannot make an activity visible to only one group of students without first placing them into a grouping.&lt;br /&gt;
&lt;br /&gt;
==Examples==&lt;br /&gt;
&lt;br /&gt;
Classroom teachers in different departments might tell some students to enroll in a refresher course. Each department has their own tutor.  Each student in the refresher course might be assigned to a group associated with their classroom teacher. The groups are put into department groupings.  For example, a University has Anthropology, Engineering and Computing departments with 3 or 4 teachers in each department that have their students take a refresher statistics class. While all students in the statistics class may receive some of the same material, groupings will allow a department focus, while still tracking students by their classroom teacher. If a student is not in a classroom group, they will not be in a department grouping.  And a student who is both in a Computing classroom group and an Engineering classroom group, will belong to more than one grouping.  &lt;br /&gt;
&lt;br /&gt;
==See also==&lt;br /&gt;
&lt;br /&gt;
*[[Groupings]]&lt;br /&gt;
*[[Groupings FAQ]]&lt;/div&gt;</summary>
		<author><name>Emerrill</name></author>
	</entry>
	<entry>
		<id>https://docs.moodle.org/39/en/index.php?title=Performance_settings&amp;diff=106578</id>
		<title>Performance settings</title>
		<link rel="alternate" type="text/html" href="https://docs.moodle.org/39/en/index.php?title=Performance_settings&amp;diff=106578"/>
		<updated>2013-09-09T17:43:07Z</updated>

		<summary type="html">&lt;p&gt;Emerrill: Removing old info, like zip paths, and resource_filterexternalpages&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Performance}}&lt;br /&gt;
==Performance settings==&lt;br /&gt;
&lt;br /&gt;
Various performance settings can be changed by an administrator in &#039;&#039;Settings &amp;gt; Site administration &amp;gt; Server &amp;gt; Performance&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
==Other site administration settings which may affect performance==&lt;br /&gt;
&lt;br /&gt;
* Enable the &#039;&#039;&#039;language cache&#039;&#039;&#039;.&lt;br /&gt;
* Large log files can cause overall performance to degrade over time. If you observe that the site has gradually got slower loading pages in the browser, &#039;&#039;&#039;reduce your Log life time&#039;&#039;&#039; setting in &#039;&#039;Settings &amp;gt; Site administration &amp;gt; Server &amp;gt; Cleanup&#039;&#039;&lt;br /&gt;
* Note that using &#039;&#039;&#039;secure web connections&#039;&#039;&#039; (&#039;&#039;&#039;https&#039;&#039;&#039; rather than &#039;&#039;&#039;http&#039;&#039;&#039;) carries a higher processing burden, both for the webserver and the client - particularly because cacheing cannot be used as effectively, so the number of file requests is likely to increase dramatically. For this reason using https for all Moodle pages is not recommended. You can enable https just for the login screen, simply from Moodle&#039;s config page.&lt;br /&gt;
* Check your &#039;&#039;&#039;filters&#039;&#039;&#039;. Having too many filters active can have serious effects on server load, especially on lower-end systems. The number of active filters has a direct effect on the perceived latency of your site; that is the time taken for each page impression. &lt;br /&gt;
* Enable the &#039;&#039;&#039;text cache&#039;&#039;&#039; but do not &amp;quot;Filter all strings&amp;quot; unless you have a specific need. If in doubt profile the performance, and see how your changes affect the processing time.&lt;br /&gt;
* Check your &#039;&#039;&#039;anti-virus&#039;&#039;&#039; measures on the server.  Although they are useful for preventing security holes being exploited, some &amp;quot;On-Demand&amp;quot; scanners can affect performance by scanning page content (word, ppt files etc).&lt;br /&gt;
* Check your &#039;&#039;&#039;forum settings&#039;&#039;&#039;. To improve performance set forum_trackreadposts = No and forum_usermarksread = Yes (this will impact on the convenience of your users&#039; forum experience). Also consider setting the time of the day when old posts are cleared from the read table (forum_cleanreadtime) to when your site is less busy.&lt;br /&gt;
* Don&#039;t use database sessions unless you really need them. On-disc sessions tend to be much faster.&lt;br /&gt;
&lt;br /&gt;
===config.php settings which may affect performance===&lt;br /&gt;
Increasing the value of CONTEXT_CACHE_MAX_SIZE &#039;&#039;&#039;may&#039;&#039;&#039; reduce the number of database queries for certain pages.  It will also increase memory usage, so be careful.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code php&amp;gt;&lt;br /&gt;
// Moodle 2.3: Increasing this from the default saved about &amp;gt; 1000 db queries on the course/index.php page for &lt;br /&gt;
// a Moodle having 1250 course categories.&lt;br /&gt;
// This value is specified in lib/accesslib.php, but it&#039;s OK to add a define for it in config.php:&lt;br /&gt;
define(&#039;CONTEXT_CACHE_MAX_SIZE&#039;, 7500);&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[de:Geschwindigkeitseinstellungen]]&lt;br /&gt;
[[es:Configuraciones para desempeño]]&lt;/div&gt;</summary>
		<author><name>Emerrill</name></author>
	</entry>
	<entry>
		<id>https://docs.moodle.org/39/en/index.php?title=Atto_editor&amp;diff=103872</id>
		<title>Atto editor</title>
		<link rel="alternate" type="text/html" href="https://docs.moodle.org/39/en/index.php?title=Atto_editor&amp;diff=103872"/>
		<updated>2013-04-05T16:37:12Z</updated>

		<summary type="html">&lt;p&gt;Emerrill: /* Spell checker */ Google spell is back.&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Editing text}}&lt;br /&gt;
The text editor (sometimes referred to as the &#039;HTML editor&#039; or even &#039;TinyMCE&#039;) has many icons to assist the user in entering content.  Many of these icons and functions should be familiar to anyone who uses a word processor.  Some examples of where you will see the text editor include: Editing Section headings, description of an activity, writing an answer to a quiz question or editing the content of many blocks.&lt;br /&gt;
&lt;br /&gt;
[[Image:HTMLeditor tools M2 1.png|thumb|The standard version of the text editor tool bar]]&lt;br /&gt;
&lt;br /&gt;
==List of groups==&lt;br /&gt;
For those who are not familiar with the tool bar, here are the functions listed by group using the above example.  Remember that the site administrator can edit or provide additonal toolbars.&lt;br /&gt;
&lt;br /&gt;
Row 1&lt;br /&gt;
*[[Image:HTML_editor_group_font_style.png]] - Font, size and heading group&lt;br /&gt;
*[[Image:HTML_editor_group_undo_redo.png]] - Undo and Redo group&lt;br /&gt;
*[[Image:HTML_editor_group_find_replace.png]] - Find and Replace group&lt;br /&gt;
*[[Image:HTML_editor_group_fullscreen_1.png]]|Full screen toggle&lt;br /&gt;
Row 2&lt;br /&gt;
*[[Image:HTML editor group text effects.png]] - Text effect group&lt;br /&gt;
*[[Image:HTML editor group line format.png]] - Line format group&lt;br /&gt;
*[[Image:HTML_editor_group_formatting.png]] - Formatting group&lt;br /&gt;
*[[Image:HTML_editor_group_color.png]] - Color group&lt;br /&gt;
*[[Image:HTML_editor_group_paragraph.png]] - Paragraph group&lt;br /&gt;
&lt;br /&gt;
Row 3&lt;br /&gt;
*[[Image:HTML_editor_group_lists.png]] - Number and Bullets and indents&lt;br /&gt;
*[[Image:HTML_editor_group_link.png]] - Link group&lt;br /&gt;
*[[Image:HTML_editor_group_insert.png]] - Insert group&lt;br /&gt;
*[[Image:HTML_editor_group_HTML_spell.png]] - HTML source toggle &amp;amp; spellchecker&lt;br /&gt;
&lt;br /&gt;
==Special features==&lt;br /&gt;
&lt;br /&gt;
===Color pickers===&lt;br /&gt;
*[[Image:HTML_editor_group_color.png]]&lt;br /&gt;
There are four levels of selecting a font or background color, &lt;br /&gt;
*A quick pick 5x8 matrix of colors&lt;br /&gt;
*&amp;quot;More colors&amp;quot; that links to Picker, Pallet and Named tabs&lt;br /&gt;
&amp;lt;gallery&amp;gt;&lt;br /&gt;
Image:HTML_editor_color_selector_basic_1.png|A quick pick 5x8 matrix of colors&lt;br /&gt;
Image:HTML_editor_color_selector_more_picker_1.png|A rainbow color picker tab&lt;br /&gt;
Image:HTML_editor_color_selector_more_pallet_1.png|A Pallet tab with a 18x12 matrix of colors&lt;br /&gt;
Image:HTML_editor_color_selector_more_named_1.png|A Named tab with custom pallets&lt;br /&gt;
&amp;lt;/gallery&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Insert images and media===&lt;br /&gt;
[[Image:HTML_editor_group_insert_MU_1.png|thumb|The Insert images and media group]]&lt;br /&gt;
&lt;br /&gt;
* 1 Insert Image - uses [[File picker]]&lt;br /&gt;
* 2 Insert Emoticon (only visible if the site administrator has enabled the &amp;quot;show emoticons as images&amp;quot; &#039;&#039;filter in Settings&amp;gt;Site administration&amp;gt;Plugins&amp;gt;Filters&amp;gt;Manage filters&#039;&#039;)&lt;br /&gt;
* 3 Insert Media - uses [[File picker]]&lt;br /&gt;
* 4 Insert Equation - uses java script editor&lt;br /&gt;
* 5 Insert Non breaking space &lt;br /&gt;
* 6 Insert Custom character - Special keyboard characters&lt;br /&gt;
* 7 Insert Table -&lt;br /&gt;
&lt;br /&gt;
&amp;lt;gallery widths=&amp;quot;300px&amp;quot;&amp;gt;&lt;br /&gt;
Image:Files_File_picker_upload_files_add_1.png|File picker Upload file screen&lt;br /&gt;
Image:HTML editor equation editor 1.png|Equation editor&lt;br /&gt;
Image:HTML_editor_custom_character_selector_1.png|Custom character selector&lt;br /&gt;
&amp;lt;/gallery&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====Insert table====&lt;br /&gt;
&amp;lt;gallery widths=&amp;quot;300px&amp;quot;&amp;gt;&lt;br /&gt;
Image:HTMLeditor_Insert_Table_general_1.png|General tab&lt;br /&gt;
Image:HTMLeditor_Insert_Table_advanced_1.png|Advanced tab&lt;br /&gt;
&amp;lt;/gallery&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;To add borders to a table&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Cell borders are crucial for helping readers to follow the rows across the screen. If they aren’t showing already you can add them as follows:&lt;br /&gt;
&lt;br /&gt;
#In the Wiki page containing your table, click its Edit tab&lt;br /&gt;
#Carefully select all the cells of the table&lt;br /&gt;
#Then right click (Macs: Command+click or Ctrl+Click) over any part of your selection to get a context menu; from it select Cell &amp;gt; Table Cell Properties; the cell properties dialog box then loads.&lt;br /&gt;
#Click on its Advanced tab, set Border Color to black (for instance), then click Apply, and then click Update.&lt;br /&gt;
#Click Save; the Wiki page containing your table will then load displaying its borders.&lt;br /&gt;
&lt;br /&gt;
==Site administration settings==&lt;br /&gt;
&lt;br /&gt;
===Manage editors===&lt;br /&gt;
&lt;br /&gt;
A site administrator can enable / disable text editors in &#039;&#039;Settings &amp;gt; Site administration &amp;gt; Plugins &amp;gt; Text editors &amp;gt; Manage editors&#039;&#039;. By default the TinyMCE HTML editor and plain text area are enabled.&lt;br /&gt;
&lt;br /&gt;
===TinyMCE editor settings===&lt;br /&gt;
{{New features}}&lt;br /&gt;
The TinyMCE  HTML editor has its own settings page &#039;&#039;Settings&amp;gt;Site administration&amp;gt;Plugins&amp;gt;Text editors&amp;gt;TinyMCE HTML editor&amp;gt;General settings&#039;&#039; with the following options:&lt;br /&gt;
&lt;br /&gt;
====Plugins====&lt;br /&gt;
*Buttons for equations, emoticons,images, media, automatic linking, and spell-checking may be enabled, disabled or uninstall here by clicking on their eye.&lt;br /&gt;
*Additionally the equation, emoticon and spell check buttons have links to their Settings screens.&lt;br /&gt;
&lt;br /&gt;
[[File:pluginstexteditor.png |thumb|none|upright=2.0|alt=&amp;quot;The TinyMCE editor plugins screen&amp;quot; | The TinyMCE editor plugins screen]]&lt;br /&gt;
&lt;br /&gt;
=====Insert equation=====&lt;br /&gt;
&lt;br /&gt;
Accessed from &#039;&#039;Settings&amp;gt;Site administration&amp;gt;Plugins&amp;gt;Text editors&amp;gt;TinyMCE HTML editor&amp;gt;Edit equation&#039;&#039;, this allows you to enable or disable the  TeX filter in the editor context and thereby display the Dragmath button. If you have a global custom TeX filter, then disable this setting.&lt;br /&gt;
&lt;br /&gt;
=====Insert emoticon=====&lt;br /&gt;
Accessed from &#039;&#039;Settings&amp;gt;Site administration&amp;gt;Plugins&amp;gt;Text editors&amp;gt;TinyMCE HTML editor&amp;gt;Insert emoticon&#039;&#039;, this allows you to enable or disable the emoticon filter in the editor context and thereby display the emoticon button.&lt;br /&gt;
&lt;br /&gt;
=====Spell checker=====&lt;br /&gt;
If you want to disable the TinyMCE spell checker and rely on browser spell checker functionality instead, you can do this by disabling the &#039;&#039;spellchecker&#039;&#039; plugin by clicking the eye in &#039;&#039;Settings &amp;gt; Site administration &amp;gt; Plugins &amp;gt; Text editors &amp;gt; TinyMCE HTML editor &amp;gt; General settings&#039;&#039; &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
You can select a different spell engine from &#039;&#039;Settings&amp;gt; Site administration &amp;gt; Plugins &amp;gt; Text editors &amp;gt; TinyMCE HTML editor&amp;gt;Check spelling&#039;&#039;  and can choose languages for the spell checking feature &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{|&lt;br /&gt;
|[[File:Spellengine.png|thumb|Choosing a different spell engine]]&lt;br /&gt;
|[[File:spelllanguagelist.png|thumb|add additional languages for spell checking]]&lt;br /&gt;
|[[File:Spellcheck.png|thumb|Spell checking in action in the editor]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
If PSpellSpell is selected then aspell 0.50 or later must be installed on your server and the path to aspell set in Settings &amp;gt; Site administration &amp;gt; Server &amp;gt; System Paths.&lt;br /&gt;
&lt;br /&gt;
===Customising the editor toolbar===&lt;br /&gt;
{{New features}}&lt;br /&gt;
&lt;br /&gt;
An administrator can remove or add buttons to the TinyMCE editor toolbar by altering the Editor toolbar box in &#039;&#039;Settings&amp;gt;Site administration&amp;gt;Plugins&amp;gt;Text editors&amp;gt;TinyMCE HTML editor&amp;gt;General settings&#039;&#039; as demonstrated in the screencast [http://youtu.be/vTW1DImro9c Customise the text editor in 2.4]&lt;br /&gt;
&lt;br /&gt;
{|&lt;br /&gt;
| [[File:editortoolbar.png|thumb|The Editor toolbar box]]&lt;br /&gt;
&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Here is the [http://www.tinymce.com/wiki.php/Buttons/controls default list of TinyMCE buttons available for use]&lt;br /&gt;
&lt;br /&gt;
====Available fonts list====&lt;br /&gt;
&lt;br /&gt;
In addition to the default fonts, a site administrator can add extra fonts by typing their name and string in the box in &#039;&#039;Settings &amp;gt; Site administration &amp;gt; Plugins &amp;gt; Text editors &amp;gt; TinyMCE HTML editor&amp;gt;General settings&#039;&#039; as demonstrated in the screencast [http://youtu.be/udP7Bnur30Y How to add extra fonts].&lt;br /&gt;
&lt;br /&gt;
====Custom configuration====&lt;br /&gt;
{{New features}}&lt;br /&gt;
A new setting from 2.4.1 in &#039;&#039;Settings&amp;gt;Site administration&amp;gt;Plugins&amp;gt;Text editors&amp;gt;TinyMCE HTML editor&amp;gt;General settings&#039;&#039; provides  a box in which an administrator can apply custom formats. See MDL-37186 for more details with examples,  and see also the [http://www.tinymce.com/wiki.php/Configuration:formats TinyMCE configuration page]&lt;br /&gt;
&lt;br /&gt;
==See also==&lt;br /&gt;
&lt;br /&gt;
* [[Text editor FAQ]]&lt;br /&gt;
&lt;br /&gt;
[[Category:Site administration]]&lt;br /&gt;
&lt;br /&gt;
[[de:Text-Editor]]&lt;/div&gt;</summary>
		<author><name>Emerrill</name></author>
	</entry>
	<entry>
		<id>https://docs.moodle.org/39/en/index.php?title=Development:CVS_for_developers&amp;diff=54110</id>
		<title>Development:CVS for developers</title>
		<link rel="alternate" type="text/html" href="https://docs.moodle.org/39/en/index.php?title=Development:CVS_for_developers&amp;diff=54110"/>
		<updated>2009-04-09T18:59:41Z</updated>

		<summary type="html">&lt;p&gt;Emerrill: Added -P to the main checkouts. If you just checkout a clean copy of head without the -P (without then running update -dP) the install does not work - as there are unpruned directories in mod/&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&#039;&#039;&#039;CVS&#039;&#039;&#039; is the Concurrent Versioning System, a commonly-used way of managing source code for large software projects. CVS keeps all versions of all files so that nothing is ever lost, and usage by different people is tracked. It also provides ways to merge code if two or more people are working on the same file. All code and all versions are stored on a central server (in the case of Moodle, at cvs.moodle.org). The [http://cvsbook.red-bean.com/cvsbook.html CVS book] holds more information about CVS than you need.&lt;br /&gt;
&lt;br /&gt;
If you just want to download Moodle using CVS to run a site, then you probably don&#039;t need this page - please see [[CVS for Administrators]] instead.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Joining the project as a developer==&lt;br /&gt;
&lt;br /&gt;
So, you&#039;ve been offered CVS write access to help us develop and maintain Moodle!  Welcome aboard!&lt;br /&gt;
&lt;br /&gt;
To be able to write changes into [http://cvs.moodle.org/ Moodle&#039;s CVS archive], you first need to have an account on the server.  Only trusted developers get these accounts.  To request access, go to the &amp;quot;Apply for CVS Access&amp;quot; tab on the CVS page on Moodle.org (http://moodle.org/cvs).  Tell us what modules you&#039;d like to access (e.g. a language module), and why.  You&#039;ll receive notification in a day or so.&lt;br /&gt;
&lt;br /&gt;
With that done, you should have all the permissions you need, so you just need to set up your machine and download the current source code so you can start working on it. &lt;br /&gt;
&lt;br /&gt;
For the examples on this page, let&#039;s assume your username is &#039;&#039;&#039;myusername&#039;&#039;&#039; and your password is &#039;&#039;&#039;mypassword&#039;&#039;&#039;. Things are a lot easier if you use an SSH key to access the server, as you won&#039;t have to keep typing these in. Check [[Development:SSH_key | here]] for instructions on how to make one.&lt;br /&gt;
&lt;br /&gt;
==CVS modules==&lt;br /&gt;
&lt;br /&gt;
Within CVS, the word &amp;quot;modules&amp;quot; refers to separate collections of code. In Moodle we have the following modules within our repository:&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;moodle&#039;&#039;&#039; - the main Moodle source code&lt;br /&gt;
* &#039;&#039;&#039;lang&#039;&#039;&#039; - all the language packs&lt;br /&gt;
* &#039;&#039;&#039;[[Development:contrib|contrib]]&#039;&#039;&#039; - user contributions and other assorted code in development&lt;br /&gt;
* &#039;&#039;&#039;mysql&#039;&#039;&#039; - a customised phpMyAdmin to plug into Moodle for database admin&lt;br /&gt;
* &#039;&#039;&#039;windows-cron&#039;&#039;&#039; - a small package that makes cron possible on Windows systems&lt;br /&gt;
* &#039;&#039;&#039;docs&#039;&#039;&#039; - various extra user-contributed documentation&lt;br /&gt;
&lt;br /&gt;
Most people are working on the existing features in the moodle module, but many are also contributing new ideas in the contrib modules. Once code reaches a certain level of maturity in the contrib area, it can be migrated over into the main moodle tree.&lt;br /&gt;
&lt;br /&gt;
==Basic CVS commands==&lt;br /&gt;
&lt;br /&gt;
===CVS on Unix===&lt;br /&gt;
&lt;br /&gt;
Moodle CVS uses ssh as a transport layer for security, so you will have to set a CVS_RSH environment variable in your Unix shell. It&#039;s best to put these commands in your .bashrc or .cshrc so you don&#039;t have to type it all the time:&lt;br /&gt;
        setenv CVS_RSH ssh (for csh, tcsh etc)&lt;br /&gt;
        export CVS_RSH=ssh (for sh, bash etc)&lt;br /&gt;
&lt;br /&gt;
Next, you can check out the latest development version of Moodle using this (all one line). NOTE: Don&#039;t try to do run this first CVS command over an existing moodle installation: start fresh with a new directory!:&lt;br /&gt;
        cvs -z3 -d:ext:myusername@cvs.moodle.org:/cvsroot/moodle co -P moodle&lt;br /&gt;
&lt;br /&gt;
The command is similar for other CVS modules:&lt;br /&gt;
        cvs -z3 -d:ext:myusername@cvs.moodle.org:/cvsroot/moodle co -P contrib&lt;br /&gt;
&lt;br /&gt;
If you want to checkout a single plugin (attendance block as an example here) from contrib into the current directory, you can use:&lt;br /&gt;
        cvs -z3 -d:ext:myusername@cvs.moodle.org:/cvsroot/moodle co -d attendance contrib/plugins/blocks/attendance&lt;br /&gt;
&lt;br /&gt;
Note that you will be prompted for mypassword for each command unless you set up authorized keys.  Read [[Development:SSH_key|SSH Keys]] for more details on how to set those up.&lt;br /&gt;
&lt;br /&gt;
Now, you should have a new &#039;moodle&#039; directory. You can rename it and move it around if you like. Go into it:&lt;br /&gt;
        cd moodle&lt;br /&gt;
&lt;br /&gt;
All the latest Moodle files should be in there. You can now change files in your copy. To compare your files and directories against the main CVS copy on the server use cvs diff, e.g.:&lt;br /&gt;
        cvs diff -c config-dist.php&lt;br /&gt;
        cvs diff -c lang&lt;br /&gt;
&lt;br /&gt;
To fetch the latest updates from the server use:&lt;br /&gt;
        cvs update -dP&lt;br /&gt;
&lt;br /&gt;
To copy your new files back to the server you would do something like:&lt;br /&gt;
        cd lang/ca&lt;br /&gt;
        cvs commit&lt;br /&gt;
&lt;br /&gt;
You will be prompted to add some comments (depends on your default text editor).   Please write a meaningful, descriptive comment and &#039;&#039;&#039;always include the name of any tracker issues that talk about the issue you are fixing&#039;&#039;&#039; (eg &#039;&#039;&#039;MDL-XXXX&#039;&#039;&#039;).&lt;br /&gt;
&lt;br /&gt;
After that your changes will be sent to the CVS server and stored in the repository. Done!&lt;br /&gt;
&lt;br /&gt;
To save more time you can put default arguments into a file called .cvsrc in your home directory. For example, mine contains:&lt;br /&gt;
        diff -c&lt;br /&gt;
        update -dP&lt;br /&gt;
&lt;br /&gt;
Try &#039;cvs help&#039; for more details ...&lt;br /&gt;
&lt;br /&gt;
=== CVS on Mac OSX ===&lt;br /&gt;
&lt;br /&gt;
You can follow the same instructions as for Unix (above) in a terminal window. However, the cvs command is not installed by default in an OSX. You first need to install the &#039;&#039;&#039;Xcode Tools&#039;&#039;&#039;. You should find this on your original installation disk. Failing that it can be downloaded (a fairly hefty download) from the [http://developer.apple.com/technology/tools.html Apple developer web site].&lt;br /&gt;
&lt;br /&gt;
=== CVS on Windows ===&lt;br /&gt;
&lt;br /&gt;
First, you need to download a completely fresh copy of Moodle using your developer account. (If you only want a private copy for local development, anonymous login will work too.)&lt;br /&gt;
&lt;br /&gt;
1. Get [http://www.tortoisecvs.org TortoiseCVS] and install it, then reboot. TortoiseCVS works under Windows 95, 98, ME, NT, 2000, XP, and 2003. Vista is also supported, although some people report problems with UAC. (In the latter case you might resort to [http://www.syntevo.com/smartcvs/index.html SmartCVS].)&lt;br /&gt;
&lt;br /&gt;
2. Find or create a new folder somewhere where you want Moodle to be downloaded to.&lt;br /&gt;
&lt;br /&gt;
3. Right-mouse-click that folder and choose &amp;quot;CVS Checkout&amp;quot; from the menu. You should see a dialog box.&lt;br /&gt;
&lt;br /&gt;
4. Copy this text into the CVSROOT field (using your own username!):&lt;br /&gt;
&lt;br /&gt;
 :ext:myusername@cvs.moodle.org:/cvsroot/moodle&lt;br /&gt;
&lt;br /&gt;
5. Under the &amp;quot;Module&amp;quot; field, type &amp;quot;moodle&amp;quot; to get the latest development version of Moodle, &amp;quot;contrib&amp;quot; to get the contributions directory, or &amp;quot;mysql&amp;quot; to get the MySQL Admin module.&lt;br /&gt;
&lt;br /&gt;
6. Press the button: &amp;quot;OK&amp;quot; and everything should be downloaded.&lt;br /&gt;
&lt;br /&gt;
A dialog box should show all the files being downloaded, and after a while you should have a complete copy of Moodle. After this first checkout, you can fetch the latest updated files from the CVS server:&lt;br /&gt;
&lt;br /&gt;
# Right-mouse-click on your Moodle folder (or any file) and select &amp;quot;CVS Update&amp;quot;.&lt;br /&gt;
# Sit back and watch the logs scroll by. Take note of conflicts that may occur if your local code has changes that conflict with the incoming versions - you will need to edit these files and resolve the conflicts manually.&lt;br /&gt;
&lt;br /&gt;
After modifying files (you will notice their icons change from green to red!), you can commit them back to the CVS server like this:&lt;br /&gt;
&lt;br /&gt;
# Right-mouse-click on your Moodle folder (or any file) and select &amp;quot;CVS Commit...&amp;quot;.&lt;br /&gt;
# In the dialog box, type a clear description of the changes you are committing.  &#039;&#039;&#039;Always include the name of any tracker issues related to what you are fixing&#039;&#039;&#039; (eg &#039;&#039;&#039;MDL-XXXX&#039;&#039;&#039;).&lt;br /&gt;
# Click &amp;quot;OK&amp;quot;. Your changes will be sent to the server.&lt;br /&gt;
# If you create a folder, BE CAREFUL about using the &amp;quot;CVS Add&amp;quot; option as it will add the folder to CVS without requiring a commit. Once added, the folder cannot be removed from CVS even though it will be pruned so long as it is empty.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
N.B. I had enormous headaches with the above settings until I changed from ext to ssh. This was using an ssh certificate on windows 2003 to both check out and commit code. Your mileage may vary, of course. [[User:Matt Gibson|Matt Gibson]] 12:52, 18 August 2008 (CDT)&lt;br /&gt;
&lt;br /&gt;
=== CVS through your IDE ===&lt;br /&gt;
&lt;br /&gt;
Will naturally depend on the IDE you choose to use so we do not give specific instructions here. For some IDEs, there are instructions elsewhere here. (E.g. [[Development:Setting_up_Eclipse|for Eclipse]].)&lt;br /&gt;
&lt;br /&gt;
However, &#039;&#039;&#039;be warned&#039;&#039;&#039;, we have noticed that when adding a new file to CVS using some IDEs (for example Eclipse), then by default they forcibly set the [http://ximbiot.com/cvs/manual/cvs-1.11.23/cvs_12.html#SEC101 CVS substitution mode] to -kk for ASCII files. In Moodle we like all ASCII files to be stored with the CVS default of -kkv, so if you use an IDE like this, please adjust its default.&lt;br /&gt;
&lt;br /&gt;
If you are never likely to add a new file to CVS, you don&#039;t need to worry too much about the preceding paragraph. If you know something version control, you might think that -kk is better than -kkv, and in many ways you would be right. (For example it makes merging easier.) However, for the Moodle project, we use -kkv because it makes it easier to generate the [[Development:Unmerged_files|Unmerged files]] page, and because expanded $Id$ tags in the download packages makes it easier for people to make more specific bug reports.&lt;br /&gt;
&lt;br /&gt;
==CVS commit messages==&lt;br /&gt;
&lt;br /&gt;
Every commit you make to CVS should have a commit message. These can be invaluable. They are included in the automatic emails sent out whenever a change is made to Moodle, so they help other developers follow and review what is being changed; and they are very helpful when tyring to understand a piece of code. CVS will tell you who last changed each line of code, and when they did it. The commit comment (hopefully) tells you why.&lt;br /&gt;
&lt;br /&gt;
A commit message should contain, in order:&lt;br /&gt;
* A couple of words indicating which part of moodle this change affects. For example &#039;forum backup&#039;, &#039;quiz attempting&#039; or &#039;weblib&#039;.&lt;br /&gt;
* A tracker issue id like MDL-12345. (If necessary, create an issue before committing, the only exception is for very minor typos.)&lt;br /&gt;
* A brief description of the problem you are fixing. (If you are feeling lazy, you may be able to get away with copying and pasting the issue summary from the tracker.)&lt;br /&gt;
* If it is not immediately obvious, a brief summary of why this change fixes the problem. If a longer description is necessary,  you may also want to add more information to the tracker issue, or Moodle Docs, but the code changes + commit message should provide enough clues to how the fix works on their own.&lt;br /&gt;
&lt;br /&gt;
Here is an example of a commit message from a simple change:&lt;br /&gt;
&lt;br /&gt;
 user selection: MDL-17072 Polishing the role assign page: Do processing&lt;br /&gt;
 before print_header in line with best practice.&lt;br /&gt;
&lt;br /&gt;
Actually, the ideal commit message would be a bit shorter than that. It is good if the first three items (area of Moodle, tracker id and brief description) will fit in the subject line of an email message.&lt;br /&gt;
&lt;br /&gt;
Here is an example from a bigger commit (would it have been better if this could have been done as several smaller commits?):&lt;br /&gt;
 &lt;br /&gt;
 role overrides: MDL-17070 Improve override roles page to match the recent&lt;br /&gt;
 usability improvements on the assign page.&lt;br /&gt;
 &lt;br /&gt;
 Including:&lt;br /&gt;
 MDL-11529 When assigning/overriding roles, the dropdown for switching to&lt;br /&gt;
 another role should have a number in brackets&lt;br /&gt;
 &lt;br /&gt;
 MDL-16549 Should not be able to edit the permission associated with&lt;br /&gt;
 moodle/site:doanything on any role.&lt;br /&gt;
&lt;br /&gt;
Here is an example of a commit (from a while ago, which is why the issue number is in the wrong place) with some explanation of the change:&lt;br /&gt;
&lt;br /&gt;
 accesslib: get_user_by_capability() - Handle complex rolecap resolution&lt;br /&gt;
 &lt;br /&gt;
 With this patch, get_user_by_capability() can handle the cases where&lt;br /&gt;
 users have multiple role assignments to the same course, and PREVENTs&lt;br /&gt;
 and PROHIBITs affect the rolecaps of this course.&lt;br /&gt;
 &lt;br /&gt;
 Without stored procedures we cannot resolve this entirely on the&lt;br /&gt;
 server side - so in the complex cases we do as much as we can on SQL,&lt;br /&gt;
 and post-process the data on the PHP side, including SQL-style&lt;br /&gt;
 pagination.&lt;br /&gt;
 &lt;br /&gt;
 MDL-12452&lt;br /&gt;
&lt;br /&gt;
===The CVS commits email list===&lt;br /&gt;
&lt;br /&gt;
You can subscribe at http://lists.moodle.org/info/commits to this email list. You will then get an email every time someone commits a change to Moodle. This is a good way to keep track of what is going on, and also a good way to learn best-practice for CVS commit messages.&lt;br /&gt;
&lt;br /&gt;
You probably want to set your mail client to automatically move messages from this list into a separate mail folder. You may not want to remain subscribed all the time, but when you are new to the project, it is a great way to do a bit of social-constructionist peer learning about our use of CVS.&lt;br /&gt;
&lt;br /&gt;
==Working with branches==&lt;br /&gt;
&lt;br /&gt;
This diagram shows how the main moodle module branches into different versions over time.&lt;br /&gt;
&lt;br /&gt;
[[Image:Cvstree.png|CVS tree]]&lt;br /&gt;
&lt;br /&gt;
To see all the current tags and branches that are available, use this command on any old file (such as index.php in the top moodle directory):&lt;br /&gt;
    cvs status -v index.php&lt;br /&gt;
&lt;br /&gt;
Some tagging guidelines:&lt;br /&gt;
* Tag and branch names should always be all upper-case.&lt;br /&gt;
* Tags and branches should ALWAYS be applied to the entire module (all of Moodle). Don&#039;t tag individual files or directories.&lt;br /&gt;
* We don&#039;t allow renaming of tags because people may be relying on them, so get them right the first time!&lt;br /&gt;
&lt;br /&gt;
===Trunk development===&lt;br /&gt;
&lt;br /&gt;
The Trunk of CVS is the main development version of Moodle. In CVS it is also known as the HEAD, or default branch.&lt;br /&gt;
&lt;br /&gt;
Moodle developers try to keep this stable as possible, but as it usually contains new code it probably has bugs and small instabilities.&lt;br /&gt;
&lt;br /&gt;
Every now and then we decide the product has enough features to make a release. At this time, the trunk is tagged with a MOODLE_XX_BETA tag (in case we ever want to roll back to that point) and a new branch is formed for the release, called MOODLE_XX_STABLE.&lt;br /&gt;
&lt;br /&gt;
A Beta package is also released at this point - it&#039;s for testers who don&#039;t use CVS but want to test the latest features and report bugs.&lt;br /&gt;
&lt;br /&gt;
===Stable branches for each release===&lt;br /&gt;
&lt;br /&gt;
As soon as the stable branch MOODLE_XX_STABLE is created, development efforts will fork into two streams for a while. Some people may continue working on new features in the trunk for the next release, but most developers should be concentrating on using the current STABLE branch and fixing bugs that are found in it.&lt;br /&gt;
&lt;br /&gt;
You can switch your local copy of Moodle to the STABLE version using the following command in Unix from the root directory:&lt;br /&gt;
    cvs update -dP -r MOODLE_XX_STABLE&lt;br /&gt;
&lt;br /&gt;
After that, all the commands described above will apply to that stable version. To return to the trunk version just issue:&lt;br /&gt;
    cvs update -dPA&lt;br /&gt;
&lt;br /&gt;
On Windows clients you should have a menu from which you can choose the branch.&lt;br /&gt;
&lt;br /&gt;
Once the new STABLE branch really stabilises, a release can be declared. Packages are created for distribution and the branch will be tagged (by Martin Dougiamas) with a tag named: MOODLE_XXX&lt;br /&gt;
&lt;br /&gt;
===Merging fixes===&lt;br /&gt;
&lt;br /&gt;
All bug fixes in any STABLE branch should be merged back into the trunk so that they become available in future versions of Moodle. A floating tag called MOODLE_XX_MERGED needs to be maintained to keep track of the last merge. The procedure for such a merge is as follows (I&#039;m using CVS on the Unix command line but the steps are the same for any CVS client):&lt;br /&gt;
&lt;br /&gt;
[[Image:Merging.png|thumb|right|300px|This diagram summarises the process]]&lt;br /&gt;
1. I highly recommend keeping one checked out copy of each stable branch and the trunk/head version locally to make it easier to jump between them.  Set them all up as virtual web sites on your development machine.  I use directories like /moodle/18, /moodle/19 /moodle/dev etc.&lt;br /&gt;
&lt;br /&gt;
2. Update to the latest stable version (I&#039;ll use XX in the example but it could be 18, 19 etc) for the relevant files, and do a cvs diff just to double-check exactly what you are checking in.  Note you only need to update the files/directories you are working in, but sometimes it help to update everything anyway just to do a final check on the functionality using the web.&lt;br /&gt;
&lt;br /&gt;
          cd /moodle/XX/user&lt;br /&gt;
          cvs update -dPA&lt;br /&gt;
          cvs diff -c file1.php file2.php&lt;br /&gt;
&lt;br /&gt;
3. If all looks OK, check in the fix to the stable branch.  Make sure that the commit message contains the bug tracker ID (eg MDL-1111) and a decent description of your thoughts on the fix.  If you don&#039;t specify a message in the command line, you&#039;ll be put into an editor to type one.&lt;br /&gt;
&lt;br /&gt;
          cvs commit -m &amp;quot;MDL-1234 Corrected a small typo in the user name field&amp;quot; file1.php file2.php&lt;br /&gt;
&lt;br /&gt;
4. Go to the very latest trunk version and make sure it&#039;s up-to-date.&lt;br /&gt;
          &lt;br /&gt;
          cd /moodle/dev/user&lt;br /&gt;
          cvs update -dPA&lt;br /&gt;
&lt;br /&gt;
5. Merge everything into your local copy of the trunk from your stable branch since the last merge.  You can use the same sequence of (4) and (5) to merge the changes into other stable branches too (to backport the fix to the previous stable versions).&lt;br /&gt;
&lt;br /&gt;
          cvs update -kk -j MOODLE_XX_MERGED -j MOODLE_XX_STABLE file1.php file2.php&lt;br /&gt;
&lt;br /&gt;
6. Carefully watch the update logs for conflicts, and fix every file that you see with a conflict.  Afterwards, it may help to just run a diff to make sure the result is what you expected:&lt;br /&gt;
&lt;br /&gt;
          cvs diff -c file1.php file2.php&lt;br /&gt;
&lt;br /&gt;
7. Check your merged local copy back into CVS trunk version&lt;br /&gt;
&lt;br /&gt;
          cvs commit -m &amp;quot;MDL-1234 Corrected a small typo in the user name field, merged from XX&amp;quot; file1.php file2.php&lt;br /&gt;
&lt;br /&gt;
8. Go back to your branch version&lt;br /&gt;
&lt;br /&gt;
          cd /moodle/XX/user&lt;br /&gt;
&lt;br /&gt;
9. Update the floating merge tag for the affected files (so that it matches MOODLE_XX_STABLE) so that this process can be repeated next time&lt;br /&gt;
&lt;br /&gt;
          cvs tag -RF MOODLE_XX_MERGED file1.php file2.php&lt;br /&gt;
&lt;br /&gt;
Finally, the values for $version in all the Moodle version.php files within the stable branch should not be updated at all if possible (except the last digit if absolutely necessary). The reason is that someone updating from a very stable version to the next very stable version could miss database upgrades that happened on the trunk.&lt;br /&gt;
&lt;br /&gt;
In other words, if you have changes to the database schema to commit to a stable branch, please check with Martin Dougiamas, or one of the other core Moodle developers.&lt;br /&gt;
&lt;br /&gt;
===Merging fixes with TortoiseCVS===&lt;br /&gt;
Situation: we did a fix on MOODLE_19_STABLE. We modified one file for this fix. This fix needs to be done on Moodle 1.8 and trunk(HEAD). All following CVS instructions will be applied on the file that we changed.&lt;br /&gt;
 &lt;br /&gt;
1. Update to the latest stable versions (HEAD included)&lt;br /&gt;
&lt;br /&gt;
          Right click on the moodle folder&lt;br /&gt;
          CVS update&lt;br /&gt;
          OK&lt;br /&gt;
&lt;br /&gt;
2. On your MOODLE19 branch: commit your fix &lt;br /&gt;
&lt;br /&gt;
          Right Click on the file&lt;br /&gt;
          CVS commit&lt;br /&gt;
          Enter a description: &amp;quot;MDL-XXXX bug fix description&amp;quot;&lt;br /&gt;
          OK&lt;br /&gt;
&lt;br /&gt;
3. On your HEAD repository: merge the changes&lt;br /&gt;
&lt;br /&gt;
          Right Click on the file&lt;br /&gt;
          CVS&amp;gt;&lt;br /&gt;
          Merge...&lt;br /&gt;
          Start: MOODLE_19_MERGED&lt;br /&gt;
          End  : MOODLE_19_STABLE&lt;br /&gt;
          OK&lt;br /&gt;
&lt;br /&gt;
4. If the resulting file have some conflicts, TortoiseCVS displays a red square on the file icon. Edit the file with your text editor and resolve the conflicts.&lt;br /&gt;
&lt;br /&gt;
5. Run a diff to make sure the result is what you expected&lt;br /&gt;
&lt;br /&gt;
          Right Click on the file&lt;br /&gt;
          CVS Diff&lt;br /&gt;
          OK&lt;br /&gt;
&lt;br /&gt;
6. Commit the fix&lt;br /&gt;
&lt;br /&gt;
          Right Click on the file&lt;br /&gt;
          CVS commit&lt;br /&gt;
          Enter a description: &amp;quot;MDL-XXXX bug fix description, merged from 19&amp;quot;&lt;br /&gt;
          OK&lt;br /&gt;
&lt;br /&gt;
We&#039;ve commit MOODLE_19_STABLE and trunk. It&#039;s now time to backport the change on MOODLE_18_STABLE.&lt;br /&gt;
On your MOODLE18 branch: reproduce step 3 to 6.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
7. On your MOODLE19 branch: update the floating merge tag for the affected file&lt;br /&gt;
&lt;br /&gt;
          Right Click on the file&lt;br /&gt;
          CVS&amp;gt;&lt;br /&gt;
          Tag...&lt;br /&gt;
          Tag: MOODLE_19_MERGED&lt;br /&gt;
          Select &#039;Move existing tag&#039;&lt;br /&gt;
          OK&lt;br /&gt;
&lt;br /&gt;
On your MOODLE18 branch: reproduce step 7 (with Tag: MOODLE_18_MERGED).&lt;br /&gt;
&lt;br /&gt;
===Feature branches for large changes===&lt;br /&gt;
&lt;br /&gt;
Occasionally, there may be a very large feature that needs to be checked in so several people can work on it, but it is too unstable to be included in the main development trunk.&lt;br /&gt;
&lt;br /&gt;
In these cases a short-term branch can be created to work on the feature, and then merged back into the main trunk as soon as possible. An example called MOODLE_19_WIDGET branch can be seen in the above diagram.&lt;br /&gt;
&lt;br /&gt;
If you need to do this for your new WIDGET feature, follow these steps:&lt;br /&gt;
&lt;br /&gt;
1. Discuss with other developers to make sure it&#039;s necessary!&lt;br /&gt;
&lt;br /&gt;
2. Make a new tag on the trunk (for all of moodle) called MOODLE_XX_WIDGET_PRE&lt;br /&gt;
&lt;br /&gt;
          cvs tag -R MOODLE_XX_WIDGET_PRE&lt;br /&gt;
&lt;br /&gt;
3. Create your branch called MOODLE_XX_WIDGET&lt;br /&gt;
&lt;br /&gt;
          cvs tag -Rb MOODLE_XX_WIDGET&lt;br /&gt;
&lt;br /&gt;
4. Work in that branch until the feature is reasonably stable. Commit as necessary.&lt;br /&gt;
&lt;br /&gt;
          cvs commit&lt;br /&gt;
&lt;br /&gt;
5. When ready, merge the whole branch into the trunk, fix conflicts, commit it to the trunk and then abandon the branch.&lt;br /&gt;
&lt;br /&gt;
          cvs update -dPA&lt;br /&gt;
          cvs update -kk -j MOODLE_XX_WIDGET&lt;br /&gt;
          cvs commit&lt;br /&gt;
&lt;br /&gt;
Good luck, be careful and have fun!&lt;br /&gt;
&lt;br /&gt;
==Who on earth is ...==&lt;br /&gt;
&lt;br /&gt;
Some of the people committing to the Moodle codebase have non-boring account names on the CVS server. If you are ever looking at a CVS commit, and wondering &amp;quot;who on earth is this purpleblob person?&amp;quot; This information is now available at: [http://moodle.org/mod/cvsadmin/view.php?cid=1 Moodle developers with write access].&lt;br /&gt;
&lt;br /&gt;
==Tips and Hints==&lt;br /&gt;
* [http://moodle.org/mod/cvsadmin/ Change your password or SSH key] (click on &amp;quot;Update my developer information&amp;quot;)&lt;br /&gt;
* [[Tracking Moodle CVS with git]]&lt;br /&gt;
* [http://moodle.org/mod/forum/discuss.php?d=34472 Merging Custom Moodle Code With Stable Releases]&lt;br /&gt;
* [[Unmerged files]]: To see if you&#039;ve forgotten to merge any file.&lt;br /&gt;
* [http://ximbiot.com/cvs/manual/ CVS Manual]&lt;br /&gt;
* [[Development:contrib|Introduction to the &#039;&#039;&#039;contrib&#039;&#039;&#039; area of CVS]]&lt;br /&gt;
&lt;br /&gt;
==See also==&lt;br /&gt;
&lt;br /&gt;
* [http://tracker.moodle.org/browse/MDLSITE-193 &amp;quot;All developers should switch to using the cvs.moodle.org alias&amp;quot;]&lt;br /&gt;
* [[CVS for Administrators]]&lt;br /&gt;
&lt;br /&gt;
[[Category:Developer|CVS for developers]]&lt;br /&gt;
[[Category:Developer tools]]&lt;br /&gt;
&lt;br /&gt;
[[es:CVS para desarrolladores]]&lt;br /&gt;
[[fr:CVS pour développeurs]]&lt;br /&gt;
[[pt:CVS_para_programadores]]&lt;/div&gt;</summary>
		<author><name>Emerrill</name></author>
	</entry>
</feed>