Asynchronous Prefetch Database Query Cache
Categories
Component ID
2382953
Component name
Asynchronous Prefetch Database Query Cache
Component type
module
Maintenance status
Development status
Component security advisory coverage
not-covered
Downloads
10433
Component created
Component changed
Component body
A pretty darn quick cache. Uses asynchronous connections & prefetching to speed up cache calls & eliminate deadlocks & metadata locks on the cache tables.
Requirements
MySQL 5.5+, PHP 5.3+, and the mysqlnd driver.
Features & Benefits
- Eliminates deadlocks & metadata locks for all cache tables.
- Faster page load times for logged in and anonymous users due to cache prefetching.
- Outputs query information to the devel query log. Will output prefetch info as well.
- Better handing of the minimum cache lifetime; does smarter garbage collection of the cache bins. Purges caches based on individual records' timestamps instead of just using the expire column, the created column is used as well.
- Changes the collation of cache tables to utf8_bin. Using the utf8_bin collation is faster and more accurate when matching cache ids since no unicode normalization is done to cache query conditions. D8 backport of (#2352207: Database cache backend does not treat cid as case sensitive).
- Changes the semaphore table to use the MEMORY engine if using MySQL 5.5 or lower. This will speed up writes to the lock table for older versions of MySQL.
- Writes to the watchdog table from the dblog module are done using an async query.
- Session initialization is done with 1 query instead of 2. Session writes use async queries.
- Configurable, per bin deflate compression of the data blob resulting in smaller cache tables in the database and faster network transfers if MySQL is on a different box.
Installation
The quick and easy way to set this up is to install the module and go to the status report page admin/reports/status
. Works with MySQL only at this point.
Below is what you'll typically need to add to your settings.php file.
$databases['default']['default']['init_commands']['isolation'] = "SET SESSION tx_isolation='READ-COMMITTED'";
$databases['default']['default']['init_commands']['lock_wait_timeout'] = "SET SESSION innodb_lock_wait_timeout = 20";
$databases['default']['default']['init_commands']['wait_timeout'] = "SET SESSION wait_timeout = 600";
$conf['cache_backends'][] = 'sites/all/modules/apdqc/apdqc.cache.inc';
$conf['cache_default_class'] = 'APDQCache';
$conf['lock_inc'] = 'sites/all/modules/apdqc/apdqc.lock.inc';
$conf['session_inc'] = 'sites/all/modules/apdqc/apdqc.session.inc';
Known Issues
The current version of Parallels Plesk does not support php-mysqlnd. It should be fixed in the next release of that software.
Similar Modules
https://www.drupal.org/project/mysql_async
https://www.drupal.org/project/adbc
https://www.drupal.org/project/cache_heuristic
https://www.drupal.org/project/lcache