Note: You are currently viewing documentation for Moodle 3.8. Up-to-date documentation for the latest stable version of Moodle may be available here: OPcache.

OPcache: Difference between revisions

From MoodleDocs
(environment template, category)
m (small polishing)
Line 1: Line 1:
{{Environment}}
{{Environment}}
{{New features}}
{{New features}}
Standard OPCache extension is strongly recommended; since Moodle 2.6, it is the only solution officially supported by PHP developers. The benefits are increased performance and significantly lower memory use.
The standard OPcache extension is strongly recommended; since Moodle 2.6, it is the only solution officially supported by PHP developers. The benefits are increased performance and significantly lower memory usage.


==Installation==
==Installation==
Line 30: Line 30:
;opcache.fast_shutdown = 1
;opcache.fast_shutdown = 1
;opcache.enable_cli = 1 ; Speeds up CLI cron
;opcache.enable_cli = 1 ; Speeds up CLI cron
;opcache.load_comments = 0 ; May lower memory use, might not be compatible with addons and other apps.
;opcache.load_comments = 0 ; May lower memory use, might not be compatible with add-ons and other apps.
</code>
</code>



Revision as of 08:45, 12 November 2013

New feature
in Moodle 3.8!

The standard OPcache extension is strongly recommended; since Moodle 2.6, it is the only solution officially supported by PHP developers. The benefits are increased performance and significantly lower memory usage.

Installation

The OPcache extension is distributed as part of PHP 5.5.0 and later. It is available also for older stable PHP releases from PECL under the original name ZendOPcache.

Configuration

PHP.ini settings:

[opcache] opcache.enable = 1 opcache.memory_consumption = 128 opcache.max_accelerated_files = 4000 opcache.revalidate_freq = 60

Required for Moodle

opcache.use_cwd = 1 opcache.validate_timestamps = 1 opcache.save_comments = 1 opcache.enable_file_override = 0

If something does not work in Moodle
opcache.revalidate_path = 1 ; May fix problems with include paths
Experimental for Moodle 2.6 and later
opcache.fast_shutdown = 1
opcache.enable_cli = 1 ; Speeds up CLI cron
opcache.load_comments = 0 ; May lower memory use, might not be compatible with add-ons and other apps.

See also