APCu and OpCache optimization for a large Drupal site

Public

This is the combo that I use w/ ELMSLN that's pretty killer. I'm getting authenticated page loads of 140-170 modules clocking in at 11-12 megs per page and around 300 ms on modest resources.

This applies to php 5.5+

Put this in your /etc/php.d/opcache.ini or similar file

</> CopyGet raw version
php
  1. # enhance opcache beyond defaults
  2. opcache.enable=1
  3. opcache.memory_consumption=256
  4. opcache.max_accelerated_files=100000
  5. opcache.max_wasted_percentage=10
  6. opcache.revalidate_freq=240
  7. opcache.validate_timestamps=0
  8. opcache.fast_shutdown=1
  9. opcache.interned_strings_buffer=8
  10. opcache.enable_cli=1

If you use the APCu user bin to cache various drupal cache bins in memory then you can futhur optimize / tune things with this in /etc/php.d/apcu.ini or similar file. This also provides support to drupal for upload progress w/o needing pecl

</> CopyGet raw version
php
  1. apc.rfc1867=1
  2. apc.rfc1867_prefix=upload_
  3. apc.rfc1867_name=APC_UPLOAD_PROGRESS
  4. apc.rfc1867_freq=0
  5. apc.rfc1867_ttl=3600