Skip to content

Commit b9d94b8

Browse files
committed
Added a mention to opcache.max_accelerated_files
1 parent c1b64cc commit b9d94b8

File tree

1 file changed

+15
-2
lines changed

1 file changed

+15
-2
lines changed

performance.rst

Lines changed: 15 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,8 +25,8 @@ the most widely used byte code cache is `APC`_.
2525
Using a byte code cache really has no downside, and Symfony has been architected
2626
to perform really well in this type of environment.
2727

28-
Further Optimizations
29-
~~~~~~~~~~~~~~~~~~~~~
28+
Monitoring Source File Changes
29+
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
3030

3131
Most byte code caches monitor the source files for changes. This ensures that if
3232
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
4444
the application (for example by calling ``apc_clear_cache()`` PHP function when
4545
using APC and ``opcache_reset()`` when using OPCache).
4646

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+
4759
.. index::
4860
single: Performance; Autoloader
4961

@@ -180,6 +192,7 @@ Learn more
180192

181193
.. _`byte code caches`: https://en.wikipedia.org/wiki/List_of_PHP_accelerators
182194
.. _`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
183196
.. _`APC`: http://php.net/manual/en/book.apc.php
184197
.. _`autoload.php`: https://github.com/symfony/symfony-standard/blob/master/app/autoload.php
185198
.. _`bootstrap file`: https://github.com/sensiolabs/SensioDistributionBundle/blob/master/Composer/ScriptHandler.php

0 commit comments

Comments
 (0)