@@ -25,8 +25,8 @@ the most widely used byte code cache is `APC`_.
25
25
Using a byte code cache really has no downside, and Symfony has been architected
26
26
to perform really well in this type of environment.
27
27
28
- Further Optimizations
29
- ~~~~~~~~~~~~~~~~~~~~~
28
+ Monitoring Source File Changes
29
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
30
30
31
31
Most byte code caches monitor the source files for changes. This ensures that if
32
32
the source of a file changes, the byte code is recompiled automatically.
@@ -44,6 +44,18 @@ For the same reasons, the byte code cache must also be cleared when deploying
44
44
the application (for example by calling ``apc_clear_cache() `` PHP function when
45
45
using APC and ``opcache_reset() `` when using OPCache).
46
46
47
+ Optimizing all the Files Used by Symfony
48
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
49
+
50
+ By default, PHP's OPcache saves up to 2,000 files in the byte code cache. This
51
+ number is too low for the typical Symfony applications, so you should set a
52
+ higher limit with the `opcache.max_accelerated_files `_ configuration option:
53
+
54
+ .. code-block :: ini
55
+
56
+ ; php.ini
57
+ opcache.max_accelerated_files = 20000
58
+
47
59
.. index ::
48
60
single: Performance; Autoloader
49
61
@@ -180,6 +192,7 @@ Learn more
180
192
181
193
.. _`byte code caches` : https://en.wikipedia.org/wiki/List_of_PHP_accelerators
182
194
.. _`OPcache` : http://php.net/manual/en/book.opcache.php
195
+ .. _`opcache.max_accelerated_files` : http://php.net/manual/en/opcache.configuration.php#ini.opcache.max-accelerated-files
183
196
.. _`APC` : http://php.net/manual/en/book.apc.php
184
197
.. _`autoload.php` : https://github.com/symfony/symfony-standard/blob/master/app/autoload.php
185
198
.. _`bootstrap file` : https://github.com/sensiolabs/SensioDistributionBundle/blob/master/Composer/ScriptHandler.php
0 commit comments