PHP opcache

PHP opcache

; enable the opcache
opcache.enable=1;

; set validate_timestamps to 1 to cause PHP to check if the file 
; has been modified. 
; This check will happen every revalidate_freq seconds.
; If a file is older than revalidate_freq seconds AND it has changed
; it will be removed from the cache and recompiled next time the
; page is accessed.
opcache.validate_timestamps=1
opcache.revalidate_freq=600 ; set this to 0 to cause PHP to check the timestamps on each access.

; optionally, you may set opcache.validate_timestamps=0 which
; will mean that PHP will never check for newer versions of your 
; cache files. This means if you make code changes you MUST
; restart PHP to see the changes. A pain, but for really busy site
; with few code changes this does improve speed and load.



; How many files can the opcache cache? This should ideally be set
; to a number higher than your actual number of php files. You can 
; check that with this command:
; find . -type f -print | grep php | wc -l
opcache.max_accelerated_files=7963

; opcache stores the cache in RAM. This makes it super fast but 
; does require a certain amount of memory. Typically on modern
; systems this is not a huge problem. This value is in Mb
opcache.memory_consumption=192

; Interned strings are a PHP optimisation which takes strings in PHP
; which are repeat over and over and places 1 instance in memory
; with a pointer to it. This setting then shares that memory accross
; all your php processes.
opcache.interned_strings_buffer=16

; Causes your destructors to be called faster at the end of a page request
; so that the PHP process is recycled quicker back to the pool of available
; workers
opcache.fast_shutdown=1

Comments are closed.