Drupal 8: Cache Backend

Drupal PHP APCu and OPcache errors on Acquia Cloud

PHP: user_cache_size

Drupal 8 attempts to use APCu as a cache backend by default if possible. Unfortunately, on our platform, we assign a hard 8 MB limit to this cache backend, which is adequate for small cache pools, but was not meant to be used as a default cache backend. We're currently tracking a bug with APC in which PHP itself becomes unresponsive when it encounters a resource insufficiency when attempting to store data in APC user cache, and our engineers are still working on a fix for this issue at a platform level. Please file a ticket through your Insight page to increase the APCu (<code> PHP user_cache_size</code> to 32M if you are seeing the following types of errors:

[07-Apr-2016 22:14:11 UTC] <em>PHP Warning: apcu_store(): Unable to allocate memory for pool.</em> in /mnt/www/html/siteenv/docroot/vendor/symfony/class-loader/ApcClassLoader.php on line 126 request_id="v-0e1d2b98-fd0e-afjafsfd-9ad5-1231381f81ca"

Additional Information about identifying and resolving PHP/FPM errors on Acquia Cloud: https://docs.acquia.com/article/findingresolving-memory-related-php-errors-acquia-cloud

 

Note:  if you  added the following to your settings.php file, based on previous versions of this documentation, comment it out and file a support ticket to increase the PHP APCu  (user_cache) setting.  

# settings['cache']['default'] = 'cache.backend.database';

comment out similar code that may have been  settings.services.yml and file a support ticket to increase the PHP APCu  (user_cache) setting.

services:
 # cache.backend.chainedfast:
 #   class: Drupal\Core\Cache\ChainedFastBackendFactory
 #   arguments: ['@settings', 'cache.backend.database', 'cache.backend.database']
    calls:
  #    - [setContainer, ['@service_container']]

this is being tracked at Acquia and also through https://www.drupal.org/node/2662844

OP cache Memory consumption

Please file a *Support* ticket through your Insight page to increase the OPcache (PHP apc_cache_size) If you are seeing the following types of errors

Warning: require_once() [function.require-once]: Unable to allocate memory for pool.

 

Additional Information about identifying and resolving PHP/FPM errors on Acquia Cloud: https://docs.acquia.com/article/findingresolving-memory-related-php-errors-acquia-cloud

 

Memcache

We recommend that you install memcache on Drupal 8 following the instructions here: Using Memcached

Twig Cache

Twig is used for Drupal 8 theming, and it relies on having its own cache of complied Twig templates, which is separate from other caches that are cleared with the drush cr all command in Drupal 8. Drupal 8 websites on Acquia Cloud Enterprise can run into issues where cached Twig templates fall out of sync on different web server instances when changes to themes are being made and a code deployment has been performed. The problem arises from having separate copies of the compiled Twig templates on each web server instance and (the related Drupal core issue https://www.drupal.org/node/2752961 ) When you make changes to themes in Drupal 8 websites on Acquia Cloud Enterprise, connect to each web server instance and run a command like this, to remove the outdated Twig templates:

drush @[sitename].[prod] --uri=http://[site_URL]/ ev '\Drupal\Core\PhpStorage\PhpStorageFactory::get("twig")->deleteAll();'

This workaround can temporarily be automated via a mix of Cloud Hooks and Cloud API's https://cloudapi.acquia.com/#GET__sites__site_envs__env_servers__server-instance_route

Add new comment

Plain text

  • No HTML tags allowed.
  • Lines and paragraphs break automatically.
  • Web page addresses and email addresses turn into links automatically.

Contact supportStill need assistance? Contact Acquia Support