PHP opcache

PHP opcache

  1. ; enable the opcache
  2. opcache.enable=1;
  3.  
  4. ; set validate_timestamps to 1 to cause PHP to check if the file
  5. ; has been modified.
  6. ; This check will happen every revalidate_freq seconds.
  7. ; If a file is older than revalidate_freq seconds AND it has changed
  8. ; it will be removed from the cache and recompiled next time the
  9. ; page is accessed.
  10. opcache.validate_timestamps=1
  11. opcache.revalidate_freq=600 ; set this to 0 to cause PHP to check the timestamps on each access.
  12.  
  13. ; optionally, you may set opcache.validate_timestamps=0 which
  14. ; will mean that PHP will never check for newer versions of your
  15. ; cache files. This means if you make code changes you MUST
  16. ; restart PHP to see the changes. A pain, but for really busy site
  17. ; with few code changes this does improve speed and load.
  18.  
  19.  
  20.  
  21. ; How many files can the opcache cache? This should ideally be set
  22. ; to a number higher than your actual number of php files. You can
  23. ; check that with this command:
  24. ; find . -type f -print | grep php | wc -l
  25. opcache.max_accelerated_files=7963
  26.  
  27. ; opcache stores the cache in RAM. This makes it super fast but
  28. ; does require a certain amount of memory. Typically on modern
  29. ; systems this is not a huge problem. This value is in Mb
  30. opcache.memory_consumption=192
  31.  
  32. ; Interned strings are a PHP optimisation which takes strings in PHP
  33. ; which are repeat over and over and places 1 instance in memory
  34. ; with a pointer to it. This setting then shares that memory accross
  35. ; all your php processes.
  36. opcache.interned_strings_buffer=16
  37.  
  38. ; Causes your destructors to be called faster at the end of a page request
  39. ; so that the PHP process is recycled quicker back to the pool of available
  40. ; workers
  41. opcache.fast_shutdown=1
  42.  
Comments are closed.