~/talk

PHP OPCache, Realpath Cache and Preloading

Talkat PHP UK Conference 2020 · 2020-02-19..02-21· [php, web-performance]
slides:none on file

Explains concrete fixes: realpath cache in process memory so cold FPM children rebuild paths and default size is 4MB; OPcache stores compiled opcodes in shared memory (default block ~46MB) and wastes space instead of defragmenting so doubling memory often ends restart loops and the wasted-memory threshold (default ~5%) triggers restarts; OPcache file_cache for faster CLI/startup and priming new FPM pools avoids compile spikes; preloading is global to the PHP process and boots classes into memory requiring full restart, with real-world gains varying by how many “hot” classes are preloaded.

AI-written summary · about

  1. 0:00Intro
  2. 1:34PHP-FPM
  3. 3:12Shared memory???
  4. 5:40Latency Comparison Numbers (-2012)
  5. 9:12Realpath Cache
  6. 15:17Throwaway language
  7. 16:11Vulcan Logic Dumper
  8. 19:27OPCache Optimizer
  9. 25:05Interned strings
  10. 26:30Wasted memory
  11. 27:53Opcache restarts
  12. 33:40PHPArch Opcache article
  13. 34:26Disaster Recovery Scenarios
  14. 35:25php.net/manual/en/opcache.configuration.php
  15. 39:49Opcache Priming / Deployment Strategies
  16. 46:09Preloading in the wild
  17. 48:23Composer benchmarks
  18. 50:56Preloading issues
  19. 53:25Preload resources
  20. 53:50PHP Performance
  21. 54:36Elastic Stack @ Combell
~/search
type to search 6,249 conferences, 138,987 speakers and 185,172 talks
~/help
cmdctrl k
search every conference, speaker and series
/
focus the filter search
h
home
c
conferences
s
speakers
e
series
t
light / dark — the status bar button does the same
?
this help
esc
close this, then clear every filter — or just the search, while you are typing in it

Ignored while you are typing. Pages without a filter rail have no search to focus.