<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>https://docs.moodle.org/32/en/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=CHRISF</id>
	<title>MoodleDocs - User contributions [en]</title>
	<link rel="self" type="application/atom+xml" href="https://docs.moodle.org/32/en/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=CHRISF"/>
	<link rel="alternate" type="text/html" href="https://docs.moodle.org/32/en/Special:Contributions/CHRISF"/>
	<updated>2026-04-10T21:39:06Z</updated>
	<subtitle>User contributions</subtitle>
	<generator>MediaWiki 1.43.5</generator>
	<entry>
		<id>https://docs.moodle.org/32/en/index.php?title=MySQL_full_unicode_support&amp;diff=127458</id>
		<title>MySQL full unicode support</title>
		<link rel="alternate" type="text/html" href="https://docs.moodle.org/32/en/index.php?title=MySQL_full_unicode_support&amp;diff=127458"/>
		<updated>2017-04-26T10:29:51Z</updated>

		<summary type="html">&lt;p&gt;CHRISF: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Environment}}&lt;br /&gt;
==UTF-8==&lt;br /&gt;
&lt;br /&gt;
UTF-8 is a character encoding that most websites use. It encodes each of the 1,112,064 valid code points. To store all of this information, four bytes is required. The most popular values are in the three byte region. MySQL by default only uses a three byte encoding and so values in the four byte range (eg. Asian characters and Emojis) can not be stored. Any attempt to enter a text that contains four byte characters will result in a Moodle database error.&lt;br /&gt;
&lt;br /&gt;
MySQL does provide full four byte UTF-8 support, but it requires certain database settings to be configured. From version 3.3 on Moodle uses full UTF-8 for both MySQL and MariaDB by default. Existing databases will still run with partial support, but it is recommended to move over to full support.&lt;br /&gt;
&lt;br /&gt;
Moodle comes with a Command Line Interface (CLI) script for converting to full UTF-8 for MySQL (and MariaDB). Before Moodle versions 3.1.5 and 3.2.2 this conversion tool would only change the Collation to some variant of &#039;utf8_bin&#039;. &#039;utf8_unicode_ci&#039; was the recommended Collation. We now recommend using &#039;utf8mb4_unicode_ci&#039; which supports four byte characters (utf8_unicode_ci only supports three).&lt;br /&gt;
&lt;br /&gt;
This script will attempt to change the database Collation, Character set, default table settings and column definitions.&lt;br /&gt;
&lt;br /&gt;
To summarise:&lt;br /&gt;
&lt;br /&gt;
* Fresh installs of Moodle 3.1.5 and 3.2.2 onwards will use utf8mb4 by default, if the database server is configured appropriately (see below).&lt;br /&gt;
* Sites upgrading to Moodle 3.1.5 or 3.2.2 can use the script to update to utf8mb4. In Moodle 3.3 a warning will show that the database isn&#039;t using full UTF-8 support and suggest moving to &#039;utf8mb4_unicode_ci&#039;, but you may choose to keep using &#039;utf8_*&#039;.&lt;br /&gt;
&lt;br /&gt;
===File format===&lt;br /&gt;
&lt;br /&gt;
To allow for large indexes on columns that are a varchar, a combination of settings needs to be set. The file format for the system needs to be using &amp;quot;Barracuda&amp;quot;. This allows for the row format to be set to &amp;quot;Compressed&amp;quot; or &amp;quot;Dynamic&amp;quot;. To enable this setting see the upgrade steps listed below.&lt;br /&gt;
&lt;br /&gt;
===File per table===&lt;br /&gt;
&lt;br /&gt;
To enable this setting see the upgrade steps listed below.&lt;br /&gt;
&lt;br /&gt;
===Large prefix===&lt;br /&gt;
&lt;br /&gt;
This in conjunction with the row format being either &amp;quot;Compressed&amp;quot; or &amp;quot;Dynamic&amp;quot; allows for large varchar indexes above 191 characters.&lt;br /&gt;
To enable this setting see the upgrade steps listed below.&lt;br /&gt;
&lt;br /&gt;
==Steps to upgrade==&lt;br /&gt;
&lt;br /&gt;
Most important: Please backup your database before making any changes or running the CLI script.&lt;br /&gt;
&lt;br /&gt;
* Change configuration settings for MySQL (exactly the same for MariaDB). This step is optional. You can run the script and it will try and make these changes itself. If errors occur then try manually changing these settings as listed below.&lt;br /&gt;
** On Linux based systems you will want to alter my.cnf. This may be located in &#039;/etc/mysql/&#039;.&lt;br /&gt;
** Make the following alterations to my.cnf:&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
[client]&lt;br /&gt;
default-character-set = utf8mb4&lt;br /&gt;
&lt;br /&gt;
[mysqld]&lt;br /&gt;
innodb_file_format = Barracuda&lt;br /&gt;
innodb_file_per_table = 1&lt;br /&gt;
innodb_large_prefix&lt;br /&gt;
&lt;br /&gt;
character-set-client-handshake = FALSE&lt;br /&gt;
character-set-server = utf8mb4&lt;br /&gt;
collation-server = utf8mb4_unicode_ci&lt;br /&gt;
&lt;br /&gt;
[mysql]&lt;br /&gt;
default-character-set = utf8mb4&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
* Restart your MySQL server.&lt;br /&gt;
* Run the CLI script to convert to the new Character set and Collation (requires Moodle 3.1.5, 3.2.2 or newer): &lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
$ php admin/cli/mysql_collation.php --collation=utf8mb4_unicode_ci&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;WARNING: For large sites, this script will be slow. For very large sites it may take hours or even days! It is recommended to dump and reimport your data according to [[Converting your MySQL database to UTF8#Converting_a_database_containing_tables|this guide]] &#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
* Adjust the $CFG-&amp;gt;dboptions Array in your &#039;&#039;&#039;config.php&#039;&#039;&#039; to make sure that Moodle uses the right Collation when connecting to the MySQL Server: &lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
$CFG-&amp;gt;dboptions = array(&lt;br /&gt;
  &amp;amp;hellip;&lt;br /&gt;
  &#039;dbcollation&#039; =&amp;gt; &#039;utf8mb4_unicode_ci&#039;,&lt;br /&gt;
  &amp;amp;hellip;&lt;br /&gt;
);&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
* Try adding some Emojis 🇦🇺👏🎓 to your Moodle site to verify that the upgrade was successful.&lt;br /&gt;
&lt;br /&gt;
[[Category:Environment|UTF-8]]&lt;br /&gt;
[[Category:UTF-8]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[es:MySQL soporte unicode completo]]&lt;br /&gt;
[[fr:Support unicode complet pour MySQL]]&lt;/div&gt;</summary>
		<author><name>CHRISF</name></author>
	</entry>
	<entry>
		<id>https://docs.moodle.org/32/en/index.php?title=error/moodle/invalidsesskey&amp;diff=126904</id>
		<title>error/moodle/invalidsesskey</title>
		<link rel="alternate" type="text/html" href="https://docs.moodle.org/32/en/index.php?title=error/moodle/invalidsesskey&amp;diff=126904"/>
		<updated>2017-02-21T18:17:44Z</updated>

		<summary type="html">&lt;p&gt;CHRISF: Correct the PHP ini setting name&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Some reasons why you might have got an &amp;quot;Invalid Sesskey&amp;quot; message are:&lt;br /&gt;
&lt;br /&gt;
# Your site doesn&#039;t have the PHP setting &amp;quot;session.auto_start=0&amp;quot;  (see [[Installing_Moodle#Software|Installing Moodle - software]])&lt;br /&gt;
# You logged out at some time between opening the form and submitting it.&lt;br /&gt;
# You have followed a bad link to a form script.&lt;br /&gt;
# Your database has an incorrect value for sessioncookiepath in the mdl_config table.&lt;br /&gt;
# You edited the code in a file on the server while logged in to your moodle website.&lt;br /&gt;
&lt;br /&gt;
==See also==&lt;br /&gt;
&lt;br /&gt;
*Using Moodle [http://moodle.org/mod/forum/discuss.php?d=105891 incorrect sesskey - occasional failures] forum discussion&lt;br /&gt;
&lt;br /&gt;
[[Category:Error|Invalidsesskey]]&lt;br /&gt;
&lt;br /&gt;
[[es:error/moodle/invalidsesskey]]&lt;/div&gt;</summary>
		<author><name>CHRISF</name></author>
	</entry>
	<entry>
		<id>https://docs.moodle.org/32/en/index.php?title=Development:File_API&amp;diff=78586</id>
		<title>Development:File API</title>
		<link rel="alternate" type="text/html" href="https://docs.moodle.org/32/en/index.php?title=Development:File_API&amp;diff=78586"/>
		<updated>2010-12-02T12:09:32Z</updated>

		<summary type="html">&lt;p&gt;CHRISF: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Work in progress}}&lt;br /&gt;
{{Infobox Project&lt;br /&gt;
|name = File API&lt;br /&gt;
|state = Implemented&lt;br /&gt;
|tracker = MDL-14589&lt;br /&gt;
|discussion = n/a&lt;br /&gt;
|assignee = [[User:Petr Škoda (škoďák)|Petr Škoda (škoďák)]]&lt;br /&gt;
}}&lt;br /&gt;
{{Moodle 2.0}}&lt;br /&gt;
&lt;br /&gt;
==Objectives==&lt;br /&gt;
&lt;br /&gt;
The goals of the new File API are: &lt;br /&gt;
&lt;br /&gt;
* allow files to be stored within Moodle, as part of the content (as we do now).&lt;br /&gt;
* use a consistent and flexible approach for all file handling throughout Moodle.&lt;br /&gt;
* give modules control over which users can access a file, using capabilities and other local rules.&lt;br /&gt;
* make it easy to determine which parts of Moodle use which files, to simplify operations like backup and restore.&lt;br /&gt;
* track where files originally came from.&lt;br /&gt;
* avoid redundant storage, when the same file is used twice.&lt;br /&gt;
* fully support Unicode file names, irrespective of the capabilities of the underlying file system.&lt;br /&gt;
&lt;br /&gt;
==Overview==&lt;br /&gt;
&lt;br /&gt;
The File API is a set of core interfaces to allow the rest of Moodle to store, serve and manage files. It applies only to files that are part of the Moodle site&#039;s content. It is not used for internal files, such as those in the following subdirectories of dataroot: temp, lang, cache, environment, filter, search, sessions, upgradelogs, ...&lt;br /&gt;
&lt;br /&gt;
The API can be subdivided into the following parts:&lt;br /&gt;
; File storage&lt;br /&gt;
: Low level file storage without access control information. Stores the content of files on disc, with metadata in associated database tables. &lt;br /&gt;
; File serving&lt;br /&gt;
: Lets users accessing a Moodle site get the files (file.php, draftfile.php, pluginfile.php, userfile.php, etc.)&lt;br /&gt;
:* Serve the files on request&lt;br /&gt;
:* with appropriate security checks&lt;br /&gt;
; File related user interfaces&lt;br /&gt;
: Provides the interface for (lib/form/file.php, filemanager.php, filepicker.php and files/index.php, draftfiles.php)&lt;br /&gt;
:* Form elements allowing users to select a file using the Repository API, and have it stored within Moodle.&lt;br /&gt;
:* UI for users to manage their files, replacing the old course files UI&lt;br /&gt;
; File browsing API&lt;br /&gt;
: Allows code to browse and optionally manipulate the file areas&lt;br /&gt;
:* find information about available files in each area.&lt;br /&gt;
:* print links to files.&lt;br /&gt;
:* optionally move/rename/copy/delete/etc.&lt;br /&gt;
&lt;br /&gt;
== File API internals ==&lt;br /&gt;
&lt;br /&gt;
=== File storage on disk ===&lt;br /&gt;
&lt;br /&gt;
Files are stored in $CFG-&amp;gt;dataroot (also known as moodledata) in the filedir subfolder.&lt;br /&gt;
&lt;br /&gt;
Files are stored according to the SHA1 hash of their content. This means each file with particular contents is stored once, irrespective of how many times it is included in different places, even if it is referred to by different names. (This idea comes from the git version control system.) To relate a file on disc to a user-comprehensible path or filename, you need to use the &#039;&#039;files&#039;&#039; database table. See the next section.&lt;br /&gt;
&lt;br /&gt;
Suppose a file has SHA1 hash 081371cb102fa559e81993fddc230c79205232ce. Then it will be stored in on disc as moodledata/filedir/08/13/71/081371cb102fa559e81993fddc230c79205232ce.&lt;br /&gt;
&lt;br /&gt;
This means Moodle can not store two files with the same SHA1 hash, luckily it is extremely unlikely that this would ever happen. Technically it is also possible to implement reliable collision tests (with some performance cost), for now we just test file lengths in addition to SHA1 hash.&lt;br /&gt;
&lt;br /&gt;
=== Files table ===&lt;br /&gt;
&lt;br /&gt;
This table contains one entry for each usage of a file. Enough information is kept here so that the file can be fully identified and retrieved again if necessary. It is necessary because some databases have hard limit on index size.&lt;br /&gt;
&lt;br /&gt;
If, for example, the same image is used in a user&#039;s profile, and a forum post, then there will be two rows in this table, one for each use of the file, and Moodle will treat the two as separate files, even though the file is only stored once on disc.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;nicetable&amp;quot;&lt;br /&gt;
! Field&lt;br /&gt;
! Type&lt;br /&gt;
! Default&lt;br /&gt;
! Info&lt;br /&gt;
|-&lt;br /&gt;
| &#039;&#039;&#039;id&#039;&#039;&#039; &lt;br /&gt;
| int(10)  &lt;br /&gt;
| auto-incrementing&lt;br /&gt;
| The unique ID for this file.&lt;br /&gt;
|-&lt;br /&gt;
| &#039;&#039;&#039;contenthash&#039;&#039;&#039;&lt;br /&gt;
| varchar(40)&lt;br /&gt;
|  &lt;br /&gt;
| The sha1 hash of content.&lt;br /&gt;
|-&lt;br /&gt;
| &#039;&#039;&#039;pathnamehash&#039;&#039;&#039;&lt;br /&gt;
| varchar(40)&lt;br /&gt;
| &lt;br /&gt;
| The sha1 hash of &amp;quot;/contextid/component/filearea/itemid/filepath/filename.ext&amp;quot; - prevents file duplicates and allows fast lookup.  It is necessary because some databases have hard limit on index size.&lt;br /&gt;
|-&lt;br /&gt;
| &#039;&#039;&#039;contextid&#039;&#039;&#039; &lt;br /&gt;
| int(10)&lt;br /&gt;
| &lt;br /&gt;
| The context id defined in context table - identifies the instance of plugin owning the file.&lt;br /&gt;
|-&lt;br /&gt;
| &#039;&#039;&#039;component&#039;&#039;&#039;&lt;br /&gt;
| varchar(50)&lt;br /&gt;
|&lt;br /&gt;
| Like &amp;quot;mod_forum&amp;quot;, &amp;quot;course&amp;quot;, &amp;quot;mod_assignment&amp;quot;, &amp;quot;backup&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
| &#039;&#039;&#039;filearea&#039;&#039;&#039;&lt;br /&gt;
| varchar(50)&lt;br /&gt;
|&lt;br /&gt;
| Like &amp;quot;submissions&amp;quot;, &amp;quot;intro&amp;quot; and &amp;quot;content&amp;quot; (images and swf linked from summaries), etc.; &amp;quot;blogs&amp;quot; and &amp;quot;userfiles&amp;quot; are special case that live at the system context.&lt;br /&gt;
|-&lt;br /&gt;
| &#039;&#039;&#039;itemid&#039;&#039;&#039;&lt;br /&gt;
| int(10)&lt;br /&gt;
| &lt;br /&gt;
| Some plugin specific item id (eg. forum post, blog entry or assignment submission or user id for user files)&lt;br /&gt;
|-&lt;br /&gt;
| filepath&lt;br /&gt;
| text&lt;br /&gt;
| &lt;br /&gt;
| relative path to file from module content root, useful in Scorm and Resource mod - most of the mods do not need this&lt;br /&gt;
|-&lt;br /&gt;
| filename&lt;br /&gt;
| varchar(255)&lt;br /&gt;
| &lt;br /&gt;
| The full Unicode name of this file (case sensitive)&lt;br /&gt;
|-&lt;br /&gt;
| &#039;&#039;&#039;userid&#039;&#039;&#039;&lt;br /&gt;
| int(10)  &lt;br /&gt;
| NULL&lt;br /&gt;
| Optional - general user id field - meaning depending on plugin&lt;br /&gt;
|-&lt;br /&gt;
| filesize&lt;br /&gt;
| int(10)&lt;br /&gt;
| &lt;br /&gt;
| size of file - bytes&lt;br /&gt;
|-&lt;br /&gt;
| mimetype&lt;br /&gt;
| varchar(100)&lt;br /&gt;
| NULL&lt;br /&gt;
| type of file&lt;br /&gt;
|-&lt;br /&gt;
| status&lt;br /&gt;
| int(10)&lt;br /&gt;
| &lt;br /&gt;
| general file status flag - will be used for lost or infected files&lt;br /&gt;
|-&lt;br /&gt;
| source&lt;br /&gt;
| text&lt;br /&gt;
| &lt;br /&gt;
| file source - usually url&lt;br /&gt;
|-&lt;br /&gt;
| author&lt;br /&gt;
| varchar(255)&lt;br /&gt;
|&lt;br /&gt;
| original author of file, used when importing from other systems&lt;br /&gt;
|-&lt;br /&gt;
| license&lt;br /&gt;
| varchar(255)&lt;br /&gt;
|&lt;br /&gt;
| license type, empty means site default&lt;br /&gt;
|-&lt;br /&gt;
| timecreated&lt;br /&gt;
| int(10)&lt;br /&gt;
| &lt;br /&gt;
| The time this file was created&lt;br /&gt;
|-&lt;br /&gt;
| timemodified&lt;br /&gt;
| int(10)&lt;br /&gt;
| &lt;br /&gt;
| The last time the file was last modified&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Indexes:&lt;br /&gt;
* non-unique index on (contextid, component, filearea, itemid)&lt;br /&gt;
* non-unique index on (contenthash)&lt;br /&gt;
* unique index on (pathnamehash).&lt;br /&gt;
&lt;br /&gt;
The plugin type does not need to be specified because it can be derived from the context. Items like blog that do not have their own context will use their own file area inside a suitable context. In this case, the user context.&lt;br /&gt;
&lt;br /&gt;
Entries with filename = &#039;.&#039; represent directories. Directory entries like this are created automatically when a file is added within them.&lt;br /&gt;
&lt;br /&gt;
Note: &#039;files&#039; plural is used even thought that goes against the [[Development:Database|coding guidelines]] because &#039;file&#039; is a reserved word in some SQL dialects.&lt;br /&gt;
&lt;br /&gt;
===Implementation of basic operations===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Each plugin may directly access only files in own context and areas!&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Low level access API is defined in &#039;&#039;file_storage&#039;&#039; class which is obtained from &amp;lt;code&amp;gt;get_file_storage()&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
====Storing a file====&lt;br /&gt;
&lt;br /&gt;
# Calculate the SHA1 hash of the file contents.&lt;br /&gt;
# Check if a file with this SHA1 hash already exists on disc in file directory or file trash. If not, store the file there.&lt;br /&gt;
# Add the record for this file to the files table using the low level address&lt;br /&gt;
&lt;br /&gt;
====Reading a file====&lt;br /&gt;
&lt;br /&gt;
# Fetch the record (which includes the SHA1 hash) for the file you want from the files table. You can fetch either all area files or quickly get one file with a specific contenthash.&lt;br /&gt;
# Retrieve the contents using the SHA1 hash from the file directory.&lt;br /&gt;
&lt;br /&gt;
====Deleting a file====&lt;br /&gt;
&lt;br /&gt;
# Delete the record from the files table.&lt;br /&gt;
# Verify if some other file is still needing the content, if not move the content file into file trash&lt;br /&gt;
# Later, admin/cron.php deletes content files from trash directory&lt;br /&gt;
&lt;br /&gt;
== File serving ==&lt;br /&gt;
&lt;br /&gt;
Deals with serving of files - browser requests file, Moodle sends it back. We have three main files. It is important to setup slasharguments on server properly (file.php/some/thing/xxx.jpg), any content that relies on relative links can not work without it (scorm, uploaded html pages, etc.).&lt;br /&gt;
&lt;br /&gt;
=== legacy file.php ===&lt;br /&gt;
&lt;br /&gt;
Serves legacy course files, the file name and parameter structure is critical for backwards compatibility of existing course content.&lt;br /&gt;
&lt;br /&gt;
 /file.php/courseid/dir/dir/filename.ext&lt;br /&gt;
&lt;br /&gt;
Internally the files are stored in &amp;lt;code&amp;gt;array(&#039;contextid&#039;=&amp;gt;$coursecontextid, &#039;component;=&amp;gt;&#039;course&#039;, &#039;filearea&#039;=&amp;gt;&#039;legacy&#039;, &#039;itemid&#039;=&amp;gt;0)&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The legacy course files are completely disabled in all new courses created in 2.0. The major problem here is to how to educate our users that they can not make huge piles of files in each course any more.&lt;br /&gt;
&lt;br /&gt;
=== pluginfile.php ===&lt;br /&gt;
All plugins should use this script to serve all files.&lt;br /&gt;
* plugins decide about access control&lt;br /&gt;
* optional XSS protection - student submitted files must not be served with normal headers, we have to force download instead; ideally there should be second wwwroot for serving of untrusted files&lt;br /&gt;
* links to these files are constructed on the fly from the relative links stored in database, this means that plugin may link only own files&lt;br /&gt;
&lt;br /&gt;
Absolute file links need to be rewritten if html editing allowed in plugin. The links are stored internally as relative links. Before editing or display the internal link representation is converted to absolute links using simple str_replace() @@thipluginlink/summary@@/image.jpg --&amp;gt; /pluginfile.php/assignmentcontextid/intro/image.jpg, it is converted back to internal links before saving.&lt;br /&gt;
&lt;br /&gt;
Script parameters are virtual file names, in most cases the parameters match the low level file storage, but they do not have to:&lt;br /&gt;
&lt;br /&gt;
 /pluginfile.php/contextid/areaname/arbitrary/params/or/dirs/filename.ext&lt;br /&gt;
&lt;br /&gt;
pluginfile.php detects the type of plugin from context table, fetches basic info (like $course or $cm if appropriate) and calls plugin function (or later method) which does the access control and finally sends the file to user. &#039;&#039;areaname&#039;&#039; separates files by type and divides the context into several subtrees - for example &#039;&#039;summary&#039;&#039; files (images used in module intros), post attachments, etc.&lt;br /&gt;
&lt;br /&gt;
==== Assignment example ====&lt;br /&gt;
&lt;br /&gt;
 /pluginfile.php/assignmentcontextid/mod_assignment/intro/someimage.jpg&lt;br /&gt;
 /pluginfile.php/assignmentcontextid/mod_assignment/submission/submissionid/attachmentname.ext&lt;br /&gt;
 /pluginfile.php/assignmentcontextid/mod_assignment/allsubmissions/groupid/allsubmissionfiles.zip&lt;br /&gt;
&lt;br /&gt;
The last line example of virtual file that should created on the fly, it is not implemented yet.&lt;br /&gt;
&lt;br /&gt;
====scorm example====&lt;br /&gt;
&lt;br /&gt;
 /pluginfile.php/scormcontextid/mod_scorm/intro/someimage.jpg&lt;br /&gt;
 /pluginfile.php/scormcontextid/mod_scorm/content/revisionnumber/dir/somescormfile.js&lt;br /&gt;
&lt;br /&gt;
The revision counter is incremented when any file changes in order to prevent caching problems.&lt;br /&gt;
&lt;br /&gt;
====quiz example====&lt;br /&gt;
&lt;br /&gt;
 pluginfile.php/quizcontextid/mod_quiz/intro/niceimage.jpg&lt;br /&gt;
&lt;br /&gt;
====questions example====&lt;br /&gt;
&lt;br /&gt;
This section was out of date. See [[Development:File_storage_conversion_Quiz_and_Questions]] for the latest thinking.&lt;br /&gt;
&lt;br /&gt;
====blog example====&lt;br /&gt;
Blog entries or notes in general do not have context id (because they live in system context, SYSCONTEXTID below is the id of system context).&lt;br /&gt;
The note attachments are always served with XSS protection on, ideally we should use separate wwwroot for this. Access control can be hardcoded.&lt;br /&gt;
&lt;br /&gt;
 /pluginfile.php/SYSCONTEXTID/blog/attachment/blogentryid/attachmentname.ext&lt;br /&gt;
&lt;br /&gt;
Internally stored in &amp;lt;code&amp;gt;array(&#039;contextid&#039;=&amp;gt;SYSCONTEXTID, &#039;component&#039;=&amp;gt;&#039;blog&#039;, &#039;filearea&#039;=&amp;gt;&#039;attachment&#039;, &#039;itemid&#039;=&amp;gt;$blogentryid)&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
 /pluginfile.php/SYSCONTEXTID/blog/post/blogentryid/embeddedimage.ext&lt;br /&gt;
&lt;br /&gt;
Internally stored in &amp;lt;code&amp;gt;array(&#039;contextid&#039;=&amp;gt;SYSCONTEXTID, &#039;component&#039;=&amp;gt;&#039;blog&#039;, &#039;filearea&#039;=&amp;gt;&#039;post&#039;, &#039;itemid&#039;=&amp;gt;$blogentryid)&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Temporary files ===&lt;br /&gt;
Temporary files are usually used during the lifetime of one script only.&lt;br /&gt;
uses:&lt;br /&gt;
* exports&lt;br /&gt;
* imports&lt;br /&gt;
* processing by executable files (latex, mimetex)&lt;br /&gt;
&lt;br /&gt;
These files should never use utf-8 file names.&lt;br /&gt;
&lt;br /&gt;
=== Legacy file storage and serving ===&lt;br /&gt;
Going to use good-old separate directories in $CFG-&amp;gt;dataroot.&lt;br /&gt;
&lt;br /&gt;
file serving and storage:&lt;br /&gt;
# user avatars - user/pix.php&lt;br /&gt;
# group avatars - user/pixgroup.php&lt;br /&gt;
# tex, algebra - filter/tex/* and filter/algebra/*&lt;br /&gt;
# rss cache (?full rss rewrite soon?) - backwards compatibility only rss/file.php&lt;br /&gt;
&lt;br /&gt;
only storage:&lt;br /&gt;
#sessions&lt;br /&gt;
&lt;br /&gt;
== File browsing API ==&lt;br /&gt;
&lt;br /&gt;
This is what other parts of Moodle use to access files that they do not own.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Class: file_browser ===&lt;br /&gt;
&lt;br /&gt;
=== Class: file_info and subclasses ===&lt;br /&gt;
&lt;br /&gt;
== File related user interfaces ==&lt;br /&gt;
&lt;br /&gt;
All files are obtained through from the file repositories.&lt;br /&gt;
&lt;br /&gt;
=== Formslib fields ===&lt;br /&gt;
* file picker&lt;br /&gt;
* file manager&lt;br /&gt;
* file upload (obsolete, do not use)&lt;br /&gt;
&lt;br /&gt;
=== Integration with the HTML editor ===&lt;br /&gt;
&lt;br /&gt;
Each instance of the HTML editor can be told to store related files in a particular file area.&lt;br /&gt;
&lt;br /&gt;
During editing, files are stored in a draft files area. Then when the form is submitted they are moved into the real file area.&lt;br /&gt;
&lt;br /&gt;
Files are selected using the repository file picker.&lt;br /&gt;
&lt;br /&gt;
=== Legacy file manager ===&lt;br /&gt;
&lt;br /&gt;
Available only for legacy reasons. It is not supposed to be used.&lt;br /&gt;
&lt;br /&gt;
All the contexts, file areas and files now form a single huge tree structure, although each user only has access to certain parts of that tree. The file manager (files/index.php) allow users to browse this tree, and manage files within it, according to the level of permissions they have.&lt;br /&gt;
&lt;br /&gt;
Single pane file manager is hard to implement without drag &amp;amp; drop which is notoriously problematic in web based applications. I propose to implement a two pane commander-style file manager. Two pane manager allows you to easily copy/move files between two different contexts (ex: courses).&lt;br /&gt;
&lt;br /&gt;
File manager must not interact directly with filesystem API, instead each module should return traversable tree of files and directories with both real and localised names (localised names are needed for dirs like backupdata).&lt;br /&gt;
&lt;br /&gt;
== Backwards compatibility ==&lt;br /&gt;
&lt;br /&gt;
=== Content backwards compatibility ===&lt;br /&gt;
&lt;br /&gt;
This should be preserved as much as possible. This will involve rewriting links in content during the upgrade to 2.0. &lt;br /&gt;
&lt;br /&gt;
Some new features (like resource sharing - if implemented) may not work with existing data that still uses files from course files area.&lt;br /&gt;
&lt;br /&gt;
There might be a breakage of links due to special characters stripping in uploaded files which will not match the links in uploaded html files any more. This should not be very common I hope.&lt;br /&gt;
&lt;br /&gt;
===Code backwards compatibility===&lt;br /&gt;
&lt;br /&gt;
Other Moodle code (for example plugins) will have to be converted to the new APIs. See [[Development:Using_the_file_API]] for guidance.&lt;br /&gt;
&lt;br /&gt;
It is not possible to provide backwards-compatibility here. For example, the old $CFG-&amp;gt;dataroot/$courseid/ will no longer exist, and there is no way to emulate that, so we won&#039;t try.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Upgrade and migration ==&lt;br /&gt;
&lt;br /&gt;
When a site is upgraded to Moodle 2.0, all the files in moodledata will have to be migrated. This is going to be a pain, like DML/DDL was :-(&lt;br /&gt;
&lt;br /&gt;
The upgrade process should be interruptible (like the Unicode upgrade was) so it can be stopped/restarted any time.&lt;br /&gt;
&lt;br /&gt;
=== Migration of content ===&lt;br /&gt;
&lt;br /&gt;
* resources - move files to new resource content file area; can be done automatically for pdf, image resources; definitely not accurate for uploaded web pages&lt;br /&gt;
* questions - image file moved to new area, image tag appended to questions&lt;br /&gt;
* moddata files - the easiest part, just move to new storage&lt;br /&gt;
* coursefiles - there might be many outdated files :-( :-(&lt;br /&gt;
* rss feeds links in readers - will be broken, the new security related code would break it anyway&lt;br /&gt;
&lt;br /&gt;
=== Moving files to files table and file pool ===&lt;br /&gt;
&lt;br /&gt;
The migration process must be interruptable because it might take a very long time. The files would be moved from old location, the restarting would be straightforward.&lt;br /&gt;
&lt;br /&gt;
Proposed stages:&lt;br /&gt;
#migration of all course files except moddata - finish marked by some $CFG-&amp;gt;files_migrated=true; - this step breaks the old file manager and html editor integration&lt;br /&gt;
#migration of blog attachments&lt;br /&gt;
#migration of question files&lt;br /&gt;
#migration of moddata files - each module is responsible to copy data from converted coursefiles or directly from moddata which is not converted automatically&lt;br /&gt;
&lt;br /&gt;
Some people use symbolic links in coursefiles - we must make sure that those will be copied to new storage in both places, though they can not be linked any more - anybody wanting to have content synced will need to move the files to some repository and set up the sync again.&lt;br /&gt;
&lt;br /&gt;
::Talked about a double task here, when migrating course files to module areas:&lt;br /&gt;
::# Parse html files to detect all the dependencies and move them together.&lt;br /&gt;
::# Fallback in pluginfile.php so, if something isn&#039;t found in module filearea, search for it in course filearea, copying it and finally, serving it.&lt;br /&gt;
&lt;br /&gt;
:: Also we talked about the possibility of add a new setting to resource in order to define if it should work against old coursefiles or new autocontained file areas. Migrated resources will point to old coursefiles while new ones will enforce autocontained file areas.&lt;br /&gt;
&lt;br /&gt;
:: it seems that only resource files will be really complex (because allow arbitrary HTML inclusion). The rest (labels, intros... doesn&#039;t) and should be easier to parse.&lt;br /&gt;
&lt;br /&gt;
::[[User:Eloy Lafuente (stronk7)|Eloy Lafuente (stronk7)]] 19:00, 29 June 2008 (CDT)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Other issues ==&lt;br /&gt;
&lt;br /&gt;
=== Unicode support in zip format ===&lt;br /&gt;
&lt;br /&gt;
Zip format is an old standard for compressing files. It was created long before Unicode existed, and Unicode support was only recently added. There are several ways used for encoding of non-ASCII characters in path names, but unfortunately it is not very standardised. Most Windows packers use DOS encoding.&lt;br /&gt;
&lt;br /&gt;
Client software:&lt;br /&gt;
* Windows built-in compression - bundled with Windows, non-standard DOS encoding only&lt;br /&gt;
* WinZip - shareware, Unicode option (since v11.2)&lt;br /&gt;
* TotalCommander - shareware, single byte(DOS) encoding only&lt;br /&gt;
* 7-Zip - free, Unicode or DOS encoding depending on characters used in file name (since v4.58beta)&lt;br /&gt;
* Info-ZIP - free, uses some weird character set conversions&lt;br /&gt;
&lt;br /&gt;
PHP extraction:&lt;br /&gt;
* Info-ZIP binary execution - no Unicode support at all, mangles character sets in file names (depends on OS, see docs), files must be copied to temp directory before compression and after extraction&lt;br /&gt;
* PclZip PHP library - reads single byte encoded names only, problems with random problems and higher memory usage.&lt;br /&gt;
* Zip PHP extension - kind of works in latest PHP versions&lt;br /&gt;
&lt;br /&gt;
Large file support:&lt;br /&gt;
PHP running under 32bit operating systems does not support files &amp;gt;2GB (do not expect fix before PHP 6). This might be a potential problem for larger backups.&lt;br /&gt;
&lt;br /&gt;
Tar Alternative:&lt;br /&gt;
* tar with gzip compression - easy to implement in PHP + zlib extension (PclTar, Tar from PEAR or custom code)&lt;br /&gt;
* no problem with unicode in *nix, Windows again expects DOS encoding :-(&lt;br /&gt;
* seems suitable for backup/restore - yay!&lt;br /&gt;
&lt;br /&gt;
Summary:&lt;br /&gt;
# added zip processing class that fully hides the underlying library&lt;br /&gt;
# using single byte encoding &amp;quot;garbage in/garbage out&amp;quot; approach for encoding of files in zip archives; add new &#039;zipencoding&#039; string into lang packs (ex: cp852 DOS charset for Czech locale) and use it during extraction (we might support true unicode later when PHP Zip extension does that)&lt;br /&gt;
&lt;br /&gt;
== Not implemented yet ==&lt;br /&gt;
* antivirus scanning - this needs a different api because the upload of files is now handled via repository plugins&lt;br /&gt;
&lt;br /&gt;
== See also ==&lt;br /&gt;
&lt;br /&gt;
* [[Development:Using the file API]]&lt;br /&gt;
* [[Development:Repository API]]&lt;br /&gt;
* [[Development:Portfolio API]]&lt;br /&gt;
* [[Development:Resource module file API migration]]&lt;br /&gt;
* MDL-14589 - File API Meta issue&lt;br /&gt;
&lt;br /&gt;
{{CategoryDeveloper}}&lt;br /&gt;
[[Category:Files]]&lt;br /&gt;
&lt;br /&gt;
[[ja:開発:ファイルAPI]]&lt;br /&gt;
[[ru:Development:File_API]]&lt;/div&gt;</summary>
		<author><name>CHRISF</name></author>
	</entry>
	<entry>
		<id>https://docs.moodle.org/32/en/index.php?title=System_paths&amp;diff=28460</id>
		<title>System paths</title>
		<link rel="alternate" type="text/html" href="https://docs.moodle.org/32/en/index.php?title=System_paths&amp;diff=28460"/>
		<updated>2007-11-05T13:31:11Z</updated>

		<summary type="html">&lt;p&gt;CHRISF: /* Path to unzip */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Location: &#039;&#039;Administration &amp;gt; Server &amp;gt; System Paths&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==GD version==&lt;br /&gt;
&lt;br /&gt;
GD is a graphics library that manipulates graphics. It&#039;s used to create thumbnail images from uploaded files and other graphics on the fly. If you don&#039;t know what version is installed, leave this on the original setting.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Note&#039;&#039;&#039;: When setting the system paths on Windows systems, use of the 8.3 notation for the path and filename is preferred. So instead of entering &#039;&#039;c:\program files\path to aspell\aspell.exe&#039;&#039;, enter &#039;&#039;c:\progra~1\path~1\aspell.exe&#039;&#039;. Check the exact 8.3 path using the &#039;&#039;dir /x&#039;&#039; command at the prompt.&lt;br /&gt;
&lt;br /&gt;
==Path to zip==&lt;br /&gt;
&lt;br /&gt;
When compressing files Moodle uses either the PclZip library or the external zip program. The external program is faster, so if you are experiencing slow backups or other performance problems, try setting the path to your zip program. On Unix/Linux systems, find the path as follows using the which program:&lt;br /&gt;
&lt;br /&gt;
 [root@moodle ~]# which zip&lt;br /&gt;
 /usr/bin/zip&lt;br /&gt;
&lt;br /&gt;
In this example the path to enter is &#039;&#039;/usr/bin/zip&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
This program must be the PKZIP-compatible &#039;&#039;zip&#039;&#039;.  The GNU zip program &#039;&#039;gzip&#039;&#039; cannot handle the type of zip files required by Moodle.&lt;br /&gt;
&lt;br /&gt;
On Windows systems, download [[http://gnuwin32.sourceforge.net/packages/zip.htm the GNU Win32 Zip complete package]]. Run the setup.exe program to install and use the search facility in Explorer to find the location of the zip.exe file. The path should look like:&lt;br /&gt;
&lt;br /&gt;
 c:\program files\gnuwin32\bin\zip.exe&lt;br /&gt;
&lt;br /&gt;
If this does not work, shorten it to the 8.3 notation:&lt;br /&gt;
&lt;br /&gt;
 c:\progra~1\gnuwin32\bin\zip.exe&lt;br /&gt;
&lt;br /&gt;
==Path to unzip==&lt;br /&gt;
&lt;br /&gt;
When uncompressing files Moodle uses either the PclZip library or the external unzip program. As with the zip program, the external program is faster, so if you are experiencing slow backups or other performance problems, try setting the path to your unzip program. On Unix/Linux systems, find the path as follows using the which program:&lt;br /&gt;
&lt;br /&gt;
 [root@moodle ~]# which unzip&lt;br /&gt;
 /usr/bin/unzip&lt;br /&gt;
&lt;br /&gt;
In this example the path to enter is &#039;&#039;/usr/bin/unzip&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
This program must be the PKZIP-compatible &#039;&#039;unzip&#039;&#039;.  The GNU unzip program &#039;&#039;gunzip&#039;&#039; cannot handle the type of zip files created by Moodle.&lt;br /&gt;
&lt;br /&gt;
On Windows systems, download [[http://gnuwin32.sourceforge.net/packages/unzip.htm the GNU Win32 Zip complete package]]. Run the setup.exe program to install and use the search facility in Explorer to find the location of the unzip.exe file. The path should look like:&lt;br /&gt;
&lt;br /&gt;
 c:\program files\gnuwin32\bin\unzip.exe&lt;br /&gt;
&lt;br /&gt;
If this does not work, shorten it to the 8.3 notation:&lt;br /&gt;
&lt;br /&gt;
 c:\progra~1\gnuwin32\bin\unzip.exe&lt;br /&gt;
&lt;br /&gt;
==Path to aspell==&lt;br /&gt;
&lt;br /&gt;
To use spell-checking within the [[HTML editor]], you MUST have aspell 0.50 or later installed on your server, and you must specify the correct path to access the aspell binary. On Unix/Linux systems use the which program to determine the path:&lt;br /&gt;
&lt;br /&gt;
 [root@moodle ~]# which aspell&lt;br /&gt;
 /usr/bin/aspell&lt;br /&gt;
&lt;br /&gt;
In this example the path to enter is &#039;&#039;/usr/bin/aspell&#039;&#039;. &lt;br /&gt;
&lt;br /&gt;
On a Windows system, download and install [http://aspell.net/win32 GNU aspell] together with at least one dictionary and then use the search facility in Explorer to find the aspell.exe file. The path should look like:&lt;br /&gt;
&lt;br /&gt;
 c:\program files\aspell\bin\aspell.exe&lt;br /&gt;
&lt;br /&gt;
It can be best to install aspell in c:\aspell or use the 8.3 notation if you are installing in &#039;&#039;c:\program files&#039;&#039; so that the path looks like &lt;br /&gt;
&lt;br /&gt;
 c:\progra~1\aspell\bin\aspell.exe&lt;br /&gt;
&lt;br /&gt;
*[[Configuring aspell on Mac OS X]]&lt;br /&gt;
*[[Configuring aspell on Windows 2003 Server]]&lt;br /&gt;
&lt;br /&gt;
==External links==&lt;br /&gt;
&lt;br /&gt;
*[http://aspell.sourceforge.net/ GNU Aspell]&lt;br /&gt;
*[http://aspell.net/win32/ GNU Aspell (Win32 version)]&lt;br /&gt;
*[http://sourceforge.net/project/showfiles.php?group_id=9328 Du, Zip and Unzip binaries for Win32]&lt;br /&gt;
&lt;br /&gt;
==See also==&lt;br /&gt;
&lt;br /&gt;
*Using Moodle [http://moodle.org/mod/forum/discuss.php?d=28465 Check your aspell installation] forum discussion&lt;br /&gt;
*Using Moodle [http://moodle.org/mod/forum/discuss.php?d=41831 When will we be able to use TinyCME in Moodle?] forum discussion&lt;br /&gt;
&lt;br /&gt;
[[Category:Administrator]]&lt;/div&gt;</summary>
		<author><name>CHRISF</name></author>
	</entry>
	<entry>
		<id>https://docs.moodle.org/32/en/index.php?title=System_paths&amp;diff=28459</id>
		<title>System paths</title>
		<link rel="alternate" type="text/html" href="https://docs.moodle.org/32/en/index.php?title=System_paths&amp;diff=28459"/>
		<updated>2007-11-05T13:30:31Z</updated>

		<summary type="html">&lt;p&gt;CHRISF: /* Path to zip */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Location: &#039;&#039;Administration &amp;gt; Server &amp;gt; System Paths&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==GD version==&lt;br /&gt;
&lt;br /&gt;
GD is a graphics library that manipulates graphics. It&#039;s used to create thumbnail images from uploaded files and other graphics on the fly. If you don&#039;t know what version is installed, leave this on the original setting.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Note&#039;&#039;&#039;: When setting the system paths on Windows systems, use of the 8.3 notation for the path and filename is preferred. So instead of entering &#039;&#039;c:\program files\path to aspell\aspell.exe&#039;&#039;, enter &#039;&#039;c:\progra~1\path~1\aspell.exe&#039;&#039;. Check the exact 8.3 path using the &#039;&#039;dir /x&#039;&#039; command at the prompt.&lt;br /&gt;
&lt;br /&gt;
==Path to zip==&lt;br /&gt;
&lt;br /&gt;
When compressing files Moodle uses either the PclZip library or the external zip program. The external program is faster, so if you are experiencing slow backups or other performance problems, try setting the path to your zip program. On Unix/Linux systems, find the path as follows using the which program:&lt;br /&gt;
&lt;br /&gt;
 [root@moodle ~]# which zip&lt;br /&gt;
 /usr/bin/zip&lt;br /&gt;
&lt;br /&gt;
In this example the path to enter is &#039;&#039;/usr/bin/zip&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
This program must be the PKZIP-compatible &#039;&#039;zip&#039;&#039;.  The GNU zip program &#039;&#039;gzip&#039;&#039; cannot handle the type of zip files required by Moodle.&lt;br /&gt;
&lt;br /&gt;
On Windows systems, download [[http://gnuwin32.sourceforge.net/packages/zip.htm the GNU Win32 Zip complete package]]. Run the setup.exe program to install and use the search facility in Explorer to find the location of the zip.exe file. The path should look like:&lt;br /&gt;
&lt;br /&gt;
 c:\program files\gnuwin32\bin\zip.exe&lt;br /&gt;
&lt;br /&gt;
If this does not work, shorten it to the 8.3 notation:&lt;br /&gt;
&lt;br /&gt;
 c:\progra~1\gnuwin32\bin\zip.exe&lt;br /&gt;
&lt;br /&gt;
==Path to unzip==&lt;br /&gt;
&lt;br /&gt;
When uncompressing files Moodle uses either the PclZip library or the external unzip program. As with the zip program, the external program is faster, so if you are experiencing slow backups or other performance problems, try setting the path to your unzip program. On Unix/Linux systems, find the path as follows using the which program:&lt;br /&gt;
&lt;br /&gt;
 [root@moodle ~]# which unzip&lt;br /&gt;
 /usr/bin/unzip&lt;br /&gt;
&lt;br /&gt;
In this example the path to enter is &#039;&#039;/usr/bin/unzip&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
On Windows systems, download [[http://gnuwin32.sourceforge.net/packages/unzip.htm the GNU Win32 Zip complete package]]. Run the setup.exe program to install and use the search facility in Explorer to find the location of the unzip.exe file. The path should look like:&lt;br /&gt;
&lt;br /&gt;
 c:\program files\gnuwin32\bin\unzip.exe&lt;br /&gt;
&lt;br /&gt;
If this does not work, shorten it to the 8.3 notation:&lt;br /&gt;
&lt;br /&gt;
 c:\progra~1\gnuwin32\bin\unzip.exe&lt;br /&gt;
&lt;br /&gt;
==Path to aspell==&lt;br /&gt;
&lt;br /&gt;
To use spell-checking within the [[HTML editor]], you MUST have aspell 0.50 or later installed on your server, and you must specify the correct path to access the aspell binary. On Unix/Linux systems use the which program to determine the path:&lt;br /&gt;
&lt;br /&gt;
 [root@moodle ~]# which aspell&lt;br /&gt;
 /usr/bin/aspell&lt;br /&gt;
&lt;br /&gt;
In this example the path to enter is &#039;&#039;/usr/bin/aspell&#039;&#039;. &lt;br /&gt;
&lt;br /&gt;
On a Windows system, download and install [http://aspell.net/win32 GNU aspell] together with at least one dictionary and then use the search facility in Explorer to find the aspell.exe file. The path should look like:&lt;br /&gt;
&lt;br /&gt;
 c:\program files\aspell\bin\aspell.exe&lt;br /&gt;
&lt;br /&gt;
It can be best to install aspell in c:\aspell or use the 8.3 notation if you are installing in &#039;&#039;c:\program files&#039;&#039; so that the path looks like &lt;br /&gt;
&lt;br /&gt;
 c:\progra~1\aspell\bin\aspell.exe&lt;br /&gt;
&lt;br /&gt;
*[[Configuring aspell on Mac OS X]]&lt;br /&gt;
*[[Configuring aspell on Windows 2003 Server]]&lt;br /&gt;
&lt;br /&gt;
==External links==&lt;br /&gt;
&lt;br /&gt;
*[http://aspell.sourceforge.net/ GNU Aspell]&lt;br /&gt;
*[http://aspell.net/win32/ GNU Aspell (Win32 version)]&lt;br /&gt;
*[http://sourceforge.net/project/showfiles.php?group_id=9328 Du, Zip and Unzip binaries for Win32]&lt;br /&gt;
&lt;br /&gt;
==See also==&lt;br /&gt;
&lt;br /&gt;
*Using Moodle [http://moodle.org/mod/forum/discuss.php?d=28465 Check your aspell installation] forum discussion&lt;br /&gt;
*Using Moodle [http://moodle.org/mod/forum/discuss.php?d=41831 When will we be able to use TinyCME in Moodle?] forum discussion&lt;br /&gt;
&lt;br /&gt;
[[Category:Administrator]]&lt;/div&gt;</summary>
		<author><name>CHRISF</name></author>
	</entry>
	<entry>
		<id>https://docs.moodle.org/32/en/index.php?title=Performance_recommendations&amp;diff=28361</id>
		<title>Performance recommendations</title>
		<link rel="alternate" type="text/html" href="https://docs.moodle.org/32/en/index.php?title=Performance_recommendations&amp;diff=28361"/>
		<updated>2007-10-29T14:58:16Z</updated>

		<summary type="html">&lt;p&gt;CHRISF: /* MySQL performance */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Location: &#039;&#039;Administration &amp;gt; Server &amp;gt; Performance&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&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 as has 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;
&#039;&#039;&#039;See also&#039;&#039;&#039;: &lt;br /&gt;
*[http://moodle.org/mod/forum/discuss.php?d=4801 Scalability] forum discussion.&lt;br /&gt;
*[http://moodle.org/mod/forum/discuss.php?d=57202 Moodle clustering] forum discussion.&lt;br /&gt;
*[http://moodle.org/mod/forum/discuss.php?d=44470 Software load balancing] forum discussion.&lt;br /&gt;
*[http://moodle.org/mod/forum/discuss.php?d=49986 TCP load balancing] forum dicsussion.&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 (eg 4GB). 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 Case Study on a server stress test with 300 users.[http://moodle.org/mod/forum/discuss.php?d=68579]  &lt;br /&gt;
*  See this accompanying report on network traffic and server loads. [http://elearning.sgu.ac.jp/doc/PT/]&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] ([http://video.yahoo.com/video/play?vid=1040890 video]) 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] (recommended), [http://www.php-accelerator.co.uk/ PHPA], [http://trac.lighttpd.net/xcache/ Xcache] 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). Put the cached PHP pages on a [[TMPFS]] filesystem.&lt;br /&gt;
* Performance of PHP is better when installed as an &#039;&#039;&#039;Apache/IIS ISAPI module&#039;&#039;&#039; (rather than a CGI).&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.&lt;br /&gt;
&lt;br /&gt;
===Apache performance===&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, so a general rule of thumb is to divide your available memory in megabytes by 10 to get the value of MaxClients. To find the max memory usage of apache processes read the value from the shell command:&lt;br /&gt;
 #ps -ylC httpd --sort:rss&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;HostnamesLookups 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&#039;&#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;
More info: [http://www.metaskills.net/blog/heuristics/sysadmin/how-to-control-browser-caching-with-apache-2 www.metaskills.net]&lt;br /&gt;
&lt;br /&gt;
* Alternatively, you can increase web server performance by using the &#039;&#039;&#039;light-weight webserver&#039;&#039;&#039; [http://www.lighttpd.org/ lighttpd] in combination with PHP in fastCGI-mode instead of Apache. Lighttpd has a lower memory consumption than Apache. One single apache process requires more RAM than the whole lighttpd with all of its fastCGI-processes together. Note that Lighttpd is relatively difficult to configure and administration takes a more time.&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;
==Database performance==&lt;br /&gt;
&lt;br /&gt;
Moodle contains a script which will display some key database performance statistics from the [http://phplens.com/lens/adodb/docs-perf.htm ADOdb performance monitor]. Run the script in your browser as in the following example:&lt;br /&gt;
&lt;br /&gt;
 http://www.mymoodle.com/admin/dbperformance.php&lt;br /&gt;
&lt;br /&gt;
Use the data displayed as a guide to tune and improve the performance of your database server.&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). 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;
* Enable the &#039;&#039;&#039;query cache&#039;&#039;&#039; with query_cache_type = 1. For most Moodle installs, set the query_cache_size to 36M and query_cache_min_res_unit to 2K. 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 table_cache = 256 (min), and for Moodle 1.7 set table_cache = 512 (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 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;
* Moodle&#039;s tables are in the MyISAM format, so &#039;&#039;&#039;turn InnoDB off&#039;&#039;&#039; as there is no performance gain. Add &amp;lt;code&amp;gt;skip-innodb&amp;lt;/code&amp;gt; to your &amp;lt;code&amp;gt;my.cnf&amp;lt;/code&amp;gt; file. If you must use InnoDB, you&#039;ll have to convert all of Moodle&#039;s tables. To do this run the innodb script:&lt;br /&gt;
&lt;br /&gt;
 http://www.mymoodle.com/admin/innodb.php&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;
* [[Increasing the database connection lifetime | Try increasing the database connection lifetime]]&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;
&lt;br /&gt;
==Moodle Admin settings==&lt;br /&gt;
* In Moodle 1.7 or later, set the &#039;&#039;&#039;Cache type&#039;&#039;&#039; for your server: Site Admin -&amp;gt; Server -&amp;gt; Performance -&amp;gt; Cache type. There are several options available. &lt;br /&gt;
:*If you do not have eaccelerator or mmemcached installed, choose &amp;quot;internal&amp;quot; (which makes use of the record/internal cache - see the next bullet point). &lt;br /&gt;
:* If you have a single server and have compiled &#039;&#039;&#039;eaccelerator with shared memory support&#039;&#039;&#039;, set the cache type to the eaccelerator option. &lt;br /&gt;
:* If you have a &#039;&#039;&#039;separate memcached server&#039;&#039;&#039;, set the cache type to memcached and enter a csv list of server IP addresses.&lt;br /&gt;
* Enable the &#039;&#039;&#039;record/internal cache&#039;&#039;&#039;: Site Admin -&amp;gt; Server -&amp;gt; Performance -&amp;gt; Record cache = True. Set the maximum amount of memory allocated to the cache in the Int Cache Max box. This will enable a primary cache for database records, without using any database engine cache, e.g. MySQL/PostgreSQL cache. See [http://tracker.moodle.org/browse/MDL-7196 this Tracker entry] for a full discussion.&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 (Admin/Server/Cleanup).&lt;br /&gt;
* Performance can be greatly improved by allowing Moodle to use the system &#039;&#039;&#039;zip/unzip&#039;&#039;&#039; commands (rather than PHP-based zip libraries) - visit Admin/Server/System Paths and enter the path to the relevant executables. (Similarly, filling in the path to &#039;&#039;&#039;du&#039;&#039;&#039; will improve Moodle&#039;s speed at listing directory contents.)&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;
* If there are performance problems loading course pages, check the &#039;&#039;&#039;Resource module settings&#039;&#039;&#039;. The setting resource_filterexternalpages is known to slow-down course pages and should be set to &#039;No&#039; for better performance.&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;
&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. Try to optimise your database server by tuning. See [http://moodle.org/mod/forum/discuss.php?d=25616&amp;amp;parent=120770 for a brief report on performance for 55 students simultaneously using quizzes]&lt;br /&gt;
** See this Case Study for an extensive server stress test with 300 quiz users.[http://moodle.org/mod/forum/discuss.php?d=68579]  And this accompanying report on network traffic and server loads. [http://elearning.sgu.ac.jp/doc/PT/]&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;
&lt;br /&gt;
==See also==&lt;br /&gt;
&lt;br /&gt;
*Using Moodle [http://moodle.org/mod/forum/view.php?f=94 Servers and Performance] forum&lt;br /&gt;
*Using Moodle [http://moodle.org/mod/forum/discuss.php?d=57028 Performance perspectives - a little script] forum discussion&lt;br /&gt;
&lt;br /&gt;
[[Category:Performance]]&lt;br /&gt;
&lt;br /&gt;
[[fr:Performance]]&lt;br /&gt;
[[ja:パフォーマンス]]&lt;/div&gt;</summary>
		<author><name>CHRISF</name></author>
	</entry>
	<entry>
		<id>https://docs.moodle.org/32/en/index.php?title=Performance_recommendations&amp;diff=28360</id>
		<title>Performance recommendations</title>
		<link rel="alternate" type="text/html" href="https://docs.moodle.org/32/en/index.php?title=Performance_recommendations&amp;diff=28360"/>
		<updated>2007-10-29T14:57:41Z</updated>

		<summary type="html">&lt;p&gt;CHRISF: /* MySQL performance */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Location: &#039;&#039;Administration &amp;gt; Server &amp;gt; Performance&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&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 as has 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;
&#039;&#039;&#039;See also&#039;&#039;&#039;: &lt;br /&gt;
*[http://moodle.org/mod/forum/discuss.php?d=4801 Scalability] forum discussion.&lt;br /&gt;
*[http://moodle.org/mod/forum/discuss.php?d=57202 Moodle clustering] forum discussion.&lt;br /&gt;
*[http://moodle.org/mod/forum/discuss.php?d=44470 Software load balancing] forum discussion.&lt;br /&gt;
*[http://moodle.org/mod/forum/discuss.php?d=49986 TCP load balancing] forum dicsussion.&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 (eg 4GB). 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 Case Study on a server stress test with 300 users.[http://moodle.org/mod/forum/discuss.php?d=68579]  &lt;br /&gt;
*  See this accompanying report on network traffic and server loads. [http://elearning.sgu.ac.jp/doc/PT/]&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] ([http://video.yahoo.com/video/play?vid=1040890 video]) 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] (recommended), [http://www.php-accelerator.co.uk/ PHPA], [http://trac.lighttpd.net/xcache/ Xcache] 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). Put the cached PHP pages on a [[TMPFS]] filesystem.&lt;br /&gt;
* Performance of PHP is better when installed as an &#039;&#039;&#039;Apache/IIS ISAPI module&#039;&#039;&#039; (rather than a CGI).&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.&lt;br /&gt;
&lt;br /&gt;
===Apache performance===&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, so a general rule of thumb is to divide your available memory in megabytes by 10 to get the value of MaxClients. To find the max memory usage of apache processes read the value from the shell command:&lt;br /&gt;
 #ps -ylC httpd --sort:rss&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;HostnamesLookups 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&#039;&#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;
More info: [http://www.metaskills.net/blog/heuristics/sysadmin/how-to-control-browser-caching-with-apache-2 www.metaskills.net]&lt;br /&gt;
&lt;br /&gt;
* Alternatively, you can increase web server performance by using the &#039;&#039;&#039;light-weight webserver&#039;&#039;&#039; [http://www.lighttpd.org/ lighttpd] in combination with PHP in fastCGI-mode instead of Apache. Lighttpd has a lower memory consumption than Apache. One single apache process requires more RAM than the whole lighttpd with all of its fastCGI-processes together. Note that Lighttpd is relatively difficult to configure and administration takes a more time.&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;
==Database performance==&lt;br /&gt;
&lt;br /&gt;
Moodle contains a script which will display some key database performance statistics from the [http://phplens.com/lens/adodb/docs-perf.htm ADOdb performance monitor]. Run the script in your browser as in the following example:&lt;br /&gt;
&lt;br /&gt;
 http://www.mymoodle.com/admin/dbperformance.php&lt;br /&gt;
&lt;br /&gt;
Use the data displayed as a guide to tune and improve the performance of your database server.&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). 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;
* Enable the &#039;&#039;&#039;query cache&#039;&#039;&#039; with query_cache_type = 1. For most Moodle installs, set the query_cache_size to 36M and query_cache_min_res_unit to 2K. 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 table_cache = 256 (min), and for Moodle 1.7 set table_cache = 512 (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 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;
* Moodle&#039;s tables are in the MyISAM format, so &#039;&#039;&#039;turn InnoDB off&#039;&#039;&#039; as there is no performance gain. Add &amp;lt;code&amp;gt;skip-innodb&amp;lt;/code to your &amp;lt;code&amp;gt;my.cnf&amp;lt;/code&amp;gt; file. If you must use InnoDB, you&#039;ll have to convert all of Moodle&#039;s tables. To do this run the innodb script:&lt;br /&gt;
&lt;br /&gt;
 http://www.mymoodle.com/admin/innodb.php&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;
* [[Increasing the database connection lifetime | Try increasing the database connection lifetime]]&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;
&lt;br /&gt;
==Moodle Admin settings==&lt;br /&gt;
* In Moodle 1.7 or later, set the &#039;&#039;&#039;Cache type&#039;&#039;&#039; for your server: Site Admin -&amp;gt; Server -&amp;gt; Performance -&amp;gt; Cache type. There are several options available. &lt;br /&gt;
:*If you do not have eaccelerator or mmemcached installed, choose &amp;quot;internal&amp;quot; (which makes use of the record/internal cache - see the next bullet point). &lt;br /&gt;
:* If you have a single server and have compiled &#039;&#039;&#039;eaccelerator with shared memory support&#039;&#039;&#039;, set the cache type to the eaccelerator option. &lt;br /&gt;
:* If you have a &#039;&#039;&#039;separate memcached server&#039;&#039;&#039;, set the cache type to memcached and enter a csv list of server IP addresses.&lt;br /&gt;
* Enable the &#039;&#039;&#039;record/internal cache&#039;&#039;&#039;: Site Admin -&amp;gt; Server -&amp;gt; Performance -&amp;gt; Record cache = True. Set the maximum amount of memory allocated to the cache in the Int Cache Max box. This will enable a primary cache for database records, without using any database engine cache, e.g. MySQL/PostgreSQL cache. See [http://tracker.moodle.org/browse/MDL-7196 this Tracker entry] for a full discussion.&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 (Admin/Server/Cleanup).&lt;br /&gt;
* Performance can be greatly improved by allowing Moodle to use the system &#039;&#039;&#039;zip/unzip&#039;&#039;&#039; commands (rather than PHP-based zip libraries) - visit Admin/Server/System Paths and enter the path to the relevant executables. (Similarly, filling in the path to &#039;&#039;&#039;du&#039;&#039;&#039; will improve Moodle&#039;s speed at listing directory contents.)&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;
* If there are performance problems loading course pages, check the &#039;&#039;&#039;Resource module settings&#039;&#039;&#039;. The setting resource_filterexternalpages is known to slow-down course pages and should be set to &#039;No&#039; for better performance.&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;
&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. Try to optimise your database server by tuning. See [http://moodle.org/mod/forum/discuss.php?d=25616&amp;amp;parent=120770 for a brief report on performance for 55 students simultaneously using quizzes]&lt;br /&gt;
** See this Case Study for an extensive server stress test with 300 quiz users.[http://moodle.org/mod/forum/discuss.php?d=68579]  And this accompanying report on network traffic and server loads. [http://elearning.sgu.ac.jp/doc/PT/]&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;
&lt;br /&gt;
==See also==&lt;br /&gt;
&lt;br /&gt;
*Using Moodle [http://moodle.org/mod/forum/view.php?f=94 Servers and Performance] forum&lt;br /&gt;
*Using Moodle [http://moodle.org/mod/forum/discuss.php?d=57028 Performance perspectives - a little script] forum discussion&lt;br /&gt;
&lt;br /&gt;
[[Category:Performance]]&lt;br /&gt;
&lt;br /&gt;
[[fr:Performance]]&lt;br /&gt;
[[ja:パフォーマンス]]&lt;/div&gt;</summary>
		<author><name>CHRISF</name></author>
	</entry>
	<entry>
		<id>https://docs.moodle.org/32/en/index.php?title=Adminer&amp;diff=25667</id>
		<title>Adminer</title>
		<link rel="alternate" type="text/html" href="https://docs.moodle.org/32/en/index.php?title=Adminer&amp;diff=25667"/>
		<updated>2007-08-06T12:03:52Z</updated>

		<summary type="html">&lt;p&gt;CHRISF: corrected link&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;MySQL Admin or &#039;&#039;&#039;phpMyAdmin&#039;&#039;&#039; is a useful [[MySQL]] database administration tool. It may be downloaded from the [http://moodle.org/mod/data/view.php?d=13&amp;amp;rid=448 Modules and plugins database].&lt;br /&gt;
&lt;br /&gt;
==See also==&lt;br /&gt;
&lt;br /&gt;
*Using Moodle [http://moodle.org/mod/forum/discuss.php?d=56636 Remove database access] forum discussion&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{{stub}}&lt;br /&gt;
[[Category:Administrator]]&lt;br /&gt;
[[Category:SQL database]]&lt;/div&gt;</summary>
		<author><name>CHRISF</name></author>
	</entry>
	<entry>
		<id>https://docs.moodle.org/32/en/index.php?title=User:Chris_Fryer&amp;diff=25328</id>
		<title>User:Chris Fryer</title>
		<link rel="alternate" type="text/html" href="https://docs.moodle.org/32/en/index.php?title=User:Chris_Fryer&amp;diff=25328"/>
		<updated>2007-07-25T09:22:02Z</updated>

		<summary type="html">&lt;p&gt;CHRISF: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Systems administrator at the [http://clt.lse.ac.uk/ Centre for Learning Technology], London School of Economics.&lt;/div&gt;</summary>
		<author><name>CHRISF</name></author>
	</entry>
	<entry>
		<id>https://docs.moodle.org/32/en/index.php?title=Backup_restore&amp;diff=21197</id>
		<title>Backup restore</title>
		<link rel="alternate" type="text/html" href="https://docs.moodle.org/32/en/index.php?title=Backup_restore&amp;diff=21197"/>
		<updated>2007-03-07T11:22:06Z</updated>

		<summary type="html">&lt;p&gt;CHRISF: /* Restore */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Moodle has a course backup and restore process.  Each  successive version of Moodle has offered  more options in this process.   Many Moodle site administrators turn on an automated backup function, which does a full course backup on a schedule.  The on demand backup and restore functions can be found in the administrative block of a course.  &lt;br /&gt;
&lt;br /&gt;
An administrator or teacher with course creator privileges can use the backup restore functions to create, transfer or restore parts of an existing course or a whole course.  &lt;br /&gt;
&lt;br /&gt;
In this document we will use a Version 1.6 process.&lt;br /&gt;
{{Moodle 1.6}}&lt;br /&gt;
&lt;br /&gt;
==Backup==&lt;br /&gt;
[[Image:Backup icon link.JPG]]Selecting backup icon, will give the user with the correct privilages 3 screens.&lt;br /&gt;
*Screen 1: Provides options to select which activities and resources should be backed up. This screen also includes an option to include student data for each of these activities and resources.   The bottom of screen 1 asks how to handled meta courses, users, log files, user files and course files. The continue button starts the backup process.&lt;br /&gt;
&lt;br /&gt;
*Screen 2 suggests a name for the backup file, which can be edited, informs the user what is  actually going to be backed up.   For example, the number of users and course files and which modules.&lt;br /&gt;
&lt;br /&gt;
*Screen 3 reports if it was successful and has a continue button.&lt;br /&gt;
&lt;br /&gt;
==Restore==&lt;br /&gt;
[[Image:Restore icon link.JPG]]Selecting the restore icon, will give show a list of files which can be restored in the backup directory.  Select the file by clicking on restore link.&lt;br /&gt;
&lt;br /&gt;
*Screen 1- confirms the file you selected to restore and asks if you want to continue or cancel&lt;br /&gt;
*Screen 2 - shows what is available in the file you have selected to restore&lt;br /&gt;
*Screen 3 - gives many options for restoring.  &lt;br /&gt;
** Restore to option: new course, copy over a course or add to a course.&lt;br /&gt;
** Individual activity options: check off those parts of the course to be restored&lt;br /&gt;
***inclues option to restore student data for each part&lt;br /&gt;
** Restore course files option - these are image or resource files&lt;br /&gt;
*Screen 4 - Restore this course now button&lt;br /&gt;
*Screen 5 - Reports on what was successfully restored&lt;br /&gt;
&lt;br /&gt;
==Notes ==&lt;br /&gt;
*Administrators and Course Creators options are:&lt;br /&gt;
**Restore to an existing course either adding to the course (keeping existing data) or deleting all existing data; or&lt;br /&gt;
**The creation of a new course using the data in the backup file being restored.&lt;br /&gt;
*Editing Teachers options are:&lt;br /&gt;
**Restore to an existing course either adding to the course (keeping existing data) or deleting all existing data.&lt;br /&gt;
&lt;br /&gt;
==Restoring Moodle 1.6 and older courses to Moodle 1.7==&lt;br /&gt;
{{Moodle 1.7}}&lt;br /&gt;
The procedure of restoring a 1.6 or older course to a 1.7 site requires additional role mapping information to be entered (on Screen 3). Since Moodle 1.7 has a dynamic roles system, it is possible to map the old roles (i.e. editing teachers, non-editing teachers and students) onto any new roles. By default, Moodle 1.7 looks for legacy roles to map intelligently, for example Moodle 1.7 will map 1.6 students onto a 1.7 legacy student role. The roles you can map onto is determined by what you can assign in the current context (current course or site). For example, if you have the teacher role in a 1.7 course, you will not be able to map students onto admins in the restored course. There is also an option to create new roles to map onto.&lt;br /&gt;
&lt;br /&gt;
==Restoring Moodle 1.7 courses to Moodle 1.7==&lt;br /&gt;
{{Moodle 1.7}}&lt;br /&gt;
This works pretty much the same, except there is role mapping information (on Screen 3). For every role in the backup course, you may select a corresponding role to map onto. By default, Moodle 1.7 compares the role shortname string and pre-selects the same for you. As a result, if you are restoring in the same site, you don&#039;t have to worry about what roles to map onto. The roles you can map onto are determined by what you can assign in the current context (current course or site). For example, if you have the teacher role in a 1.7 course, you will not be able to map students onto admins in the restored course. There is also an option to create new roles to map onto.&lt;br /&gt;
&lt;br /&gt;
==See also==&lt;br /&gt;
*[[Restore]] how to restore a backup of a course&lt;br /&gt;
*[[Roll courses forward]], how to repeat a course again&lt;br /&gt;
*[[Import course data]] from you other courses.  1.6 feature in Moodle&lt;br /&gt;
[[Category:Teacher]]&lt;br /&gt;
[[Category:Administrator]]&lt;br /&gt;
[[Category:Backup]]&lt;br /&gt;
&lt;br /&gt;
[[ja:バックアップ リストア]]&lt;/div&gt;</summary>
		<author><name>CHRISF</name></author>
	</entry>
	<entry>
		<id>https://docs.moodle.org/32/en/index.php?title=Forum_settings&amp;diff=3739</id>
		<title>Forum settings</title>
		<link rel="alternate" type="text/html" href="https://docs.moodle.org/32/en/index.php?title=Forum_settings&amp;diff=3739"/>
		<updated>2006-01-17T12:17:17Z</updated>

		<summary type="html">&lt;p&gt;CHRISF: /* Creating a new forum */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Forums}}&lt;br /&gt;
&lt;br /&gt;
==Creating a new forum==&lt;br /&gt;
&lt;br /&gt;
In your course, click &amp;quot;Turn Editing On&amp;quot;, and go to the topic in which you want to create the forum.  From the drop-down list labeled &amp;quot;Add an activity&amp;quot;, select &amp;quot;Forum&amp;quot;.  This will take you to &amp;quot;Adding a new forum&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
==Forum name==&lt;br /&gt;
&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;
&lt;br /&gt;
==Forum type==&lt;br /&gt;
&lt;br /&gt;
For now, there are three forum types to choose from:&lt;br /&gt;
&lt;br /&gt;
# &#039;&#039;&#039;A single simple discussion&#039;&#039;&#039; - a single topic discussion developed on one page, which is useful for short focussed discussions&lt;br /&gt;
# &#039;&#039;&#039;Standard forum for general use&#039;&#039;&#039; - an open forum where anyone can start a new topic at any time; this is the best general-purpose forum&lt;br /&gt;
# &#039;&#039;&#039;Each person posts one discussion&#039;&#039;&#039; - 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;
 &lt;br /&gt;
==Forum introduction==&lt;br /&gt;
&lt;br /&gt;
Type the description of the forum here. Include precise instructions for students regarding the subject of the forum and, if necessary, the grading criteria.&lt;br /&gt;
&lt;br /&gt;
==Can a student post to this forum?==&lt;br /&gt;
&lt;br /&gt;
This option allows you to restrict students from posting new content in this forum. Again you have three options to choose from:&lt;br /&gt;
&lt;br /&gt;
# &#039;&#039;&#039;Discussions and replies are allowed&#039;&#039;&#039; This option leaves students unrestricted, which is the case for most forums. Thus, you choose to allow them to start new discussion topics (threads), and also to post replies within those threads.&lt;br /&gt;
# &#039;&#039;&#039;No discussions, but replies are allowed&#039;&#039;&#039; This option should be chosen the option if only teachers are to be allowed to start new discussions. Students will still be allowed to reply within those threads (for example within the news forum on the site home page). &lt;br /&gt;
# &#039;&#039;&#039;No discussions, no replies&#039;&#039;&#039; Choosing this option babs students from starting new discussion topics and replying within those threads. This is useful for the News forum when you only want teachers to post new items that appear on the course main page. &lt;br /&gt;
&lt;br /&gt;
==Force everyone to be subscribed?==&lt;br /&gt;
&lt;br /&gt;
When a person is subscribed to a forum it means that they will be sent email copies of every post in that forum (posts are sent about 30 minutes after the post was first written). &lt;br /&gt;
&lt;br /&gt;
People can usually choose whether or not they want to be subscribed to each forum. &lt;br /&gt;
&lt;br /&gt;
However, if you 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;
This 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;
&lt;br /&gt;
If you choose the option &amp;quot;Yes, initially&amp;quot; then all current and future course users will be subscribed initially but they can unsubscribe themselves at any time. If you choose &amp;quot;Yes, forever&amp;quot; then they will not be able to unsubscribe themselves. &lt;br /&gt;
&lt;br /&gt;
Note how the &amp;quot;Yes, initially&amp;quot; option behaves when you update an existing forum: Changing from &amp;quot;Yes, initially&amp;quot; to &amp;quot;No&amp;quot; will not unsubscribe existing users, it will only affect future course users. Similarly changing later to &amp;quot;Yes, initially&amp;quot; will not subscribe existing course users but only those enrolling later.&lt;br /&gt;
&lt;br /&gt;
==Read tracking for this forum?==&lt;br /&gt;
&lt;br /&gt;
If &#039;read tracking&#039; for forums is enabled, users can track read and unread messages in forums and discussions. The instructor can choose to force a tracking type on a forum using this setting. &lt;br /&gt;
&lt;br /&gt;
There are three choice for this setting:&lt;br /&gt;
&lt;br /&gt;
# &#039;&#039;&#039;Optional [default]&#039;&#039;&#039; - students can turn tracking on or off for the forum at their discretion &lt;br /&gt;
# &#039;&#039;&#039;On&#039;&#039;&#039; - tracking is always on&lt;br /&gt;
# &#039;&#039;&#039;Off&#039;&#039;&#039; - tracking is always off&lt;br /&gt;
&lt;br /&gt;
==Maximum attachment size==&lt;br /&gt;
&lt;br /&gt;
Attachments can be limited to a certain size file, chosen by the person who set up the forum.&lt;br /&gt;
&lt;br /&gt;
Sometimes it is possible to upload a file larger than this size, but the file will not be saved on the server and you might see an error.&lt;br /&gt;
&lt;br /&gt;
==Allow posts to be rated?==&lt;br /&gt;
&lt;br /&gt;
Here you will have to consider whether or not enable two options: &lt;br /&gt;
&lt;br /&gt;
====Use ratings====&lt;br /&gt;
 &lt;br /&gt;
If you decide to rate posts on the forum, you will have to define settings of the three following aspects: &lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Users&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
If you want everybody to rate posts, choose &#039;Everyone can rate posts&#039;. Otherwise, pick &#039;Only teachers can rate posts&#039;. &lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;View&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
If you want to keep the grades known only to the individual students graded, you should choose the option &#039;Students can only see their own ratings&#039;. If there is no such a need, opt for &#039;Students can see everyone&#039;s ratings&#039;.&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Grade&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
There are several grading scales you can choose from. You can give a number of points to each post (from 1 to 100) or you can opt for two other scales: &#039;&#039;&#039;Scale: satisfactory&#039;&#039;&#039; (Outstanding, Satisfactory and Not satisfactory) or &#039;&#039;&#039;Separate and Connected ways of knowing&#039;&#039;&#039; (Mostly Connected Knowing, Separate and Connected, Mostly Separate Knowing). More information about the latter one are to be found [[Separate and Connected ways of knowing|here]]. &lt;br /&gt;
&lt;br /&gt;
====Restrict ratings to posts with dates in this range====&lt;br /&gt;
&lt;br /&gt;
If you enable the &#039;&#039;&#039;Use ratings&#039;&#039;&#039; option, you will also face the necessity of choosing whether or not enable another option restricting ratings to posts in terms of time. &lt;br /&gt;
&lt;br /&gt;
==Visible to students==&lt;br /&gt;
&lt;br /&gt;
You can hide the activity from students by selecting &amp;quot;Hide&amp;quot; here. It is useful if you wouldn&#039;t like to make the activity available immediately.&lt;br /&gt;
&lt;br /&gt;
[[Category:Teacher]]&lt;/div&gt;</summary>
		<author><name>CHRISF</name></author>
	</entry>
	<entry>
		<id>https://docs.moodle.org/32/en/index.php?title=Forum_settings&amp;diff=3738</id>
		<title>Forum settings</title>
		<link rel="alternate" type="text/html" href="https://docs.moodle.org/32/en/index.php?title=Forum_settings&amp;diff=3738"/>
		<updated>2006-01-17T12:13:42Z</updated>

		<summary type="html">&lt;p&gt;CHRISF: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Forums}}&lt;br /&gt;
&lt;br /&gt;
==Creating a new forum==&lt;br /&gt;
&lt;br /&gt;
In your course, turn editing on.  In the topic where you want to create your forum, select &amp;quot;Forum&amp;quot; from the &amp;quot;Add an activity&amp;quot; drop-down list.&lt;br /&gt;
&lt;br /&gt;
==Forum name==&lt;br /&gt;
&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;
&lt;br /&gt;
==Forum type==&lt;br /&gt;
&lt;br /&gt;
For now, there are three forum types to choose from:&lt;br /&gt;
&lt;br /&gt;
# &#039;&#039;&#039;A single simple discussion&#039;&#039;&#039; - a single topic discussion developed on one page, which is useful for short focussed discussions&lt;br /&gt;
# &#039;&#039;&#039;Standard forum for general use&#039;&#039;&#039; - an open forum where anyone can start a new topic at any time; this is the best general-purpose forum&lt;br /&gt;
# &#039;&#039;&#039;Each person posts one discussion&#039;&#039;&#039; - 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;
 &lt;br /&gt;
==Forum introduction==&lt;br /&gt;
&lt;br /&gt;
Type the description of the forum here. Include precise instructions for students regarding the subject of the forum and, if necessary, the grading criteria.&lt;br /&gt;
&lt;br /&gt;
==Can a student post to this forum?==&lt;br /&gt;
&lt;br /&gt;
This option allows you to restrict students from posting new content in this forum. Again you have three options to choose from:&lt;br /&gt;
&lt;br /&gt;
# &#039;&#039;&#039;Discussions and replies are allowed&#039;&#039;&#039; This option leaves students unrestricted, which is the case for most forums. Thus, you choose to allow them to start new discussion topics (threads), and also to post replies within those threads.&lt;br /&gt;
# &#039;&#039;&#039;No discussions, but replies are allowed&#039;&#039;&#039; This option should be chosen the option if only teachers are to be allowed to start new discussions. Students will still be allowed to reply within those threads (for example within the news forum on the site home page). &lt;br /&gt;
# &#039;&#039;&#039;No discussions, no replies&#039;&#039;&#039; Choosing this option babs students from starting new discussion topics and replying within those threads. This is useful for the News forum when you only want teachers to post new items that appear on the course main page. &lt;br /&gt;
&lt;br /&gt;
==Force everyone to be subscribed?==&lt;br /&gt;
&lt;br /&gt;
When a person is subscribed to a forum it means that they will be sent email copies of every post in that forum (posts are sent about 30 minutes after the post was first written). &lt;br /&gt;
&lt;br /&gt;
People can usually choose whether or not they want to be subscribed to each forum. &lt;br /&gt;
&lt;br /&gt;
However, if you 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;
This 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;
&lt;br /&gt;
If you choose the option &amp;quot;Yes, initially&amp;quot; then all current and future course users will be subscribed initially but they can unsubscribe themselves at any time. If you choose &amp;quot;Yes, forever&amp;quot; then they will not be able to unsubscribe themselves. &lt;br /&gt;
&lt;br /&gt;
Note how the &amp;quot;Yes, initially&amp;quot; option behaves when you update an existing forum: Changing from &amp;quot;Yes, initially&amp;quot; to &amp;quot;No&amp;quot; will not unsubscribe existing users, it will only affect future course users. Similarly changing later to &amp;quot;Yes, initially&amp;quot; will not subscribe existing course users but only those enrolling later.&lt;br /&gt;
&lt;br /&gt;
==Read tracking for this forum?==&lt;br /&gt;
&lt;br /&gt;
If &#039;read tracking&#039; for forums is enabled, users can track read and unread messages in forums and discussions. The instructor can choose to force a tracking type on a forum using this setting. &lt;br /&gt;
&lt;br /&gt;
There are three choice for this setting:&lt;br /&gt;
&lt;br /&gt;
# &#039;&#039;&#039;Optional [default]&#039;&#039;&#039; - students can turn tracking on or off for the forum at their discretion &lt;br /&gt;
# &#039;&#039;&#039;On&#039;&#039;&#039; - tracking is always on&lt;br /&gt;
# &#039;&#039;&#039;Off&#039;&#039;&#039; - tracking is always off&lt;br /&gt;
&lt;br /&gt;
==Maximum attachment size==&lt;br /&gt;
&lt;br /&gt;
Attachments can be limited to a certain size file, chosen by the person who set up the forum.&lt;br /&gt;
&lt;br /&gt;
Sometimes it is possible to upload a file larger than this size, but the file will not be saved on the server and you might see an error.&lt;br /&gt;
&lt;br /&gt;
==Allow posts to be rated?==&lt;br /&gt;
&lt;br /&gt;
Here you will have to consider whether or not enable two options: &lt;br /&gt;
&lt;br /&gt;
====Use ratings====&lt;br /&gt;
 &lt;br /&gt;
If you decide to rate posts on the forum, you will have to define settings of the three following aspects: &lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Users&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
If you want everybody to rate posts, choose &#039;Everyone can rate posts&#039;. Otherwise, pick &#039;Only teachers can rate posts&#039;. &lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;View&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
If you want to keep the grades known only to the individual students graded, you should choose the option &#039;Students can only see their own ratings&#039;. If there is no such a need, opt for &#039;Students can see everyone&#039;s ratings&#039;.&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Grade&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
There are several grading scales you can choose from. You can give a number of points to each post (from 1 to 100) or you can opt for two other scales: &#039;&#039;&#039;Scale: satisfactory&#039;&#039;&#039; (Outstanding, Satisfactory and Not satisfactory) or &#039;&#039;&#039;Separate and Connected ways of knowing&#039;&#039;&#039; (Mostly Connected Knowing, Separate and Connected, Mostly Separate Knowing). More information about the latter one are to be found [[Separate and Connected ways of knowing|here]]. &lt;br /&gt;
&lt;br /&gt;
====Restrict ratings to posts with dates in this range====&lt;br /&gt;
&lt;br /&gt;
If you enable the &#039;&#039;&#039;Use ratings&#039;&#039;&#039; option, you will also face the necessity of choosing whether or not enable another option restricting ratings to posts in terms of time. &lt;br /&gt;
&lt;br /&gt;
==Visible to students==&lt;br /&gt;
&lt;br /&gt;
You can hide the activity from students by selecting &amp;quot;Hide&amp;quot; here. It is useful if you wouldn&#039;t like to make the activity available immediately.&lt;br /&gt;
&lt;br /&gt;
[[Category:Teacher]]&lt;/div&gt;</summary>
		<author><name>CHRISF</name></author>
	</entry>
</feed>