Excessive database load may overwhelm the Drupal’s semaphore
table, which can cause deadlocks. Encountering deadlocks during database write operations (including INSERT
, UPDATE
, and DELETE
operations) can indicate that Drupal’s lock API is in conflict with InnoDB’s row-level locking mechanism on Drupal’s semaphore
table.
Acquia recommends you keep the semaphore locking mechanism in your InnoDB database, due to your InnoDB database being a persistent storage location. Due to semaphore locks being intended for persistent storage, Memcached (as non-persistent storage) isn’t an ideal location for this use case.
Stampede protection
You can also use Memcached to provide stampede protection. In certain situations, using Memcached can help reduce the risk of performance degradation when several requests simultaneously try to write to the cache.
Stampede protection uses Drupal’s locking layer to allow only one process at a time to try to send an item to Memcached. However, MySQL’s InnoDB storage engine isn’t well-suited to managing locks in the semaphore
table when experiencing high loads. Due to this behavior, it’s important to also move lock management out of the database and into memory if you enable stampede protection.
Acquia strongly recommends that you review the Memcache module’s README.txt
file for complete documentation about its configuration:
Enabling stampede protection and lock management in Memcache
For instructions about how to enable stampede protection and Memcache lock management in your Drupal application, select the tab that indicates your installed version of Drupal:
Disabling stampede protection and lock management in Memcache
To disable stampede protection and lock management in Memcache: