You are here

README.txt in Asynchronous Prefetch Database Query Cache 7

------------------------------------------
Asynchronous Prefetch Database Query Cache
------------------------------------------


CONTENTS OF THIS FILE
---------------------

 - Requirements
 - Installation
 - Features & benefits
 - Configuration
 - Troubleshooting


REQUIREMENTS
------------

 - MySQL 5.5+
 - mysqlnd Driver
 - PHP 5.3+


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';

If you are using memcache or apcu then using the status report page is
recommended.


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.
 - 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.


CONFIGURATION
-------------

Settings page is located at:
`admin/config/development/performance/apdqc`

**Global Options**

 - Cache garbage collection frequency: The frequency with which cache bins are
   cleared on cron.
 - Prefetch cached data: Control prefetching of cache items.
 - Devel - Output prefetch info from apdqc: Display prefetch info in the devel
   query log output.

**Operations page**

Located at `admin/config/development/performance/apdqc/operations`. This is a
collection of things to do for the semaphore & cache tables; better optimizing
them. There are no configuration options here.
 - Convert semaphore table: Convert the table to use InnoDB or MEMORY depending
   on the version of MySQL installed.
 - Convert cache tables collations: Using the utf8_bin collation is faster and
   more accurate when matching cache ids since no unicode normalization is done
   to cache queries

**Hidden Settings**

The following settings are not configurable from the admin UI and must be set in
settings.php. In general they are settings that should not be changed. The
current defaults are shown.

    // If TRUE run DELETE instead of TRUNCATE on all cache bins.
    $conf['cache_no_truncate'] = FALSE;

    // If FALSE do not prefetch the cache_bootstrap cache bin.
    $conf['cache_bootstrap_prefetch'] = TRUE;

    // If TRUE call apdqc_cache_clear_alter() & apdqc_cache_clear() on cc.
    $conf['apdqc_call_hook_on_clear'] = FALSE;

    // If TRUE use _apdqc_dblog_watchdog instead of dblog_watchdog.
    $conf['apdqc_dblog_watchdog'] = TRUE;


TROUBLESHOOTING
---------------

Fix all APDQC warnings and errors on the status report page
`admin/reports/status`. You might need to install the mysqlnd extension.

Disable prefetching on the `admin/config/development/performance/apdqc` page.

If you are having issues be sure to report it here:
`https://www.drupal.org/node/add/project-issue/apdqc`

File

README.txt
View source
  1. ------------------------------------------
  2. Asynchronous Prefetch Database Query Cache
  3. ------------------------------------------
  4. CONTENTS OF THIS FILE
  5. ---------------------
  6. - Requirements
  7. - Installation
  8. - Features & benefits
  9. - Configuration
  10. - Troubleshooting
  11. REQUIREMENTS
  12. ------------
  13. - MySQL 5.5+
  14. - mysqlnd Driver
  15. - PHP 5.3+
  16. INSTALLATION
  17. ------------
  18. The quick and easy way to set this up is to install the module and go to the
  19. status report page `admin/reports/status`. Works with MySQL only at this point.
  20. Below is what you'll typically need to add to your settings.php file.
  21. $databases['default']['default']['init_commands']['isolation'] =
  22. "SET SESSION tx_isolation='READ-COMMITTED'";
  23. $databases['default']['default']['init_commands']['lock_wait_timeout'] =
  24. "SET SESSION innodb_lock_wait_timeout = 20";
  25. $databases['default']['default']['init_commands']['wait_timeout'] =
  26. "SET SESSION wait_timeout = 600";
  27. $conf['cache_backends'][] = 'sites/all/modules/apdqc/apdqc.cache.inc';
  28. $conf['cache_default_class'] = 'APDQCache';
  29. $conf['lock_inc'] = 'sites/all/modules/apdqc/apdqc.lock.inc';
  30. $conf['session_inc'] = 'sites/all/modules/apdqc/apdqc.session.inc';
  31. If you are using memcache or apcu then using the status report page is
  32. recommended.
  33. FEATURES & BENEFITS
  34. -------------------
  35. - Eliminates deadlocks & metadata locks for all cache tables.
  36. - Faster page load times for logged in and anonymous users due to cache
  37. prefetching.
  38. - Outputs query information to the devel query log. Will output prefetch info
  39. as well.
  40. - Better handing of the minimum cache lifetime; does smarter garbage collection
  41. of the cache bins. Purges caches based on individual records' timestamps
  42. instead of just using the expire column, the created column is used as well.
  43. - Changes the collation of cache tables to utf8_bin. Using the utf8_bin
  44. collation is faster and more accurate when matching cache ids since no
  45. unicode normalization is done to cache query conditions. D8 backport.
  46. - Changes the semaphore table to use the MEMORY engine if using MySQL 5.5 or
  47. lower. This will speed up writes to the lock table for older versions of
  48. MySQL.
  49. CONFIGURATION
  50. -------------
  51. Settings page is located at:
  52. `admin/config/development/performance/apdqc`
  53. **Global Options**
  54. - Cache garbage collection frequency: The frequency with which cache bins are
  55. cleared on cron.
  56. - Prefetch cached data: Control prefetching of cache items.
  57. - Devel - Output prefetch info from apdqc: Display prefetch info in the devel
  58. query log output.
  59. **Operations page**
  60. Located at `admin/config/development/performance/apdqc/operations`. This is a
  61. collection of things to do for the semaphore & cache tables; better optimizing
  62. them. There are no configuration options here.
  63. - Convert semaphore table: Convert the table to use InnoDB or MEMORY depending
  64. on the version of MySQL installed.
  65. - Convert cache tables collations: Using the utf8_bin collation is faster and
  66. more accurate when matching cache ids since no unicode normalization is done
  67. to cache queries
  68. **Hidden Settings**
  69. The following settings are not configurable from the admin UI and must be set in
  70. settings.php. In general they are settings that should not be changed. The
  71. current defaults are shown.
  72. // If TRUE run DELETE instead of TRUNCATE on all cache bins.
  73. $conf['cache_no_truncate'] = FALSE;
  74. // If FALSE do not prefetch the cache_bootstrap cache bin.
  75. $conf['cache_bootstrap_prefetch'] = TRUE;
  76. // If TRUE call apdqc_cache_clear_alter() & apdqc_cache_clear() on cc.
  77. $conf['apdqc_call_hook_on_clear'] = FALSE;
  78. // If TRUE use _apdqc_dblog_watchdog instead of dblog_watchdog.
  79. $conf['apdqc_dblog_watchdog'] = TRUE;
  80. TROUBLESHOOTING
  81. ---------------
  82. Fix all APDQC warnings and errors on the status report page
  83. `admin/reports/status`. You might need to install the mysqlnd extension.
  84. Disable prefetching on the `admin/config/development/performance/apdqc` page.
  85. If you are having issues be sure to report it here:
  86. `https://www.drupal.org/node/add/project-issue/apdqc`