v5:userguide:memcached
Differences
This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revisionNext revision | Previous revisionNext revisionBoth sides next revision | ||
reference:memcached [2015/12/19 17:11] – mnewnham | v5:userguide:memcached [2017/04/15 18:24] – mnewnham | ||
---|---|---|---|
Line 1: | Line 1: | ||
====== Memcached Setup ====== | ====== Memcached Setup ====== | ||
<WRAP tip> | <WRAP tip> | ||
- | There are 2 pear modules for connection | + | There are 2 PEAR modules for connecting |
- | * Windows support is only available for the older Memcache library. | + | * Windows support is only available for the Memcache library. |
- | * ADOdb has only been tested against | + | * Memcache should be used in PHP 5.x environments on UNIX platforms. |
+ | * Memcached should be used in PHP 7.x environments on UNIX platforms. | ||
+ | * If both the memcache and memcached libraries are available, the memcache | ||
</ | </ | ||
===== Description ===== | ===== Description ===== | ||
- | This section describes | + | This section describes |
===== The Memcache Library ===== | ===== The Memcache Library ===== | ||
Line 14: | Line 16: | ||
$db = NewADOConnection($driver=' | $db = NewADOConnection($driver=' | ||
+ | |||
/* | /* | ||
- | * Enable memcache | + | * Enable memcache |
- | */ | + | */ |
$db-> | $db-> | ||
+ | |||
/* | /* | ||
- | * Add one or more servers, for use in distributed systems | + | * Add one or more servers, for use in distributed systems |
- | */ | + | */ |
- | $db-> | + | $db-> |
/* | /* | ||
- | * Optionally add the server port if it differs from the default | + | * Optionally add the server port if it differs from the default |
- | */ | + | */ |
$db-> | $db-> | ||
+ | |||
/* | /* | ||
- | * Use ' | + | * Use ' |
- | */ | + | * Note; Compression is only supported using the memcache library. This |
- | $db-> | + | |
+ | */ | ||
+ | $db-> | ||
/* | /* | ||
- | * We connect to the database, not the memcache server | + | * We connect to the database, not the memcache server |
- | */ | + | */ |
$db-> | $db-> | ||
/* | /* | ||
- | * look for a cached query with a life of 2400 seconds | + | * look for a cached query with a life of 2400 seconds |
- | */ | + | */ |
$sql = ' | $sql = ' | ||
$db-> | $db-> | ||
Line 44: | Line 52: | ||
</ | </ | ||
===== Using Debug Mode ===== | ===== Using Debug Mode ===== | ||
- | The size of query results that can be cached by the memcached server is limited by server configuration. The default is quite small. If the query is too large, and [[reference: | + | The size of query results that can be cached by the memcached server is limited by server configuration. The default is quite small. If the query is too large, and [[v5: |
Line 50: | Line 58: | ||
(this is a notice and not an error) | (this is a notice and not an error) | ||
-----< | -----< | ||
- | | + | |
- | (mysqli): SELECT * FROM employees | + | (mysqli): SELECT * FROM employees |
- | + | ||
-----< | -----< | ||
Notice: MemcachePool:: | Notice: MemcachePool:: | ||
Line 58: | Line 66: | ||
(3) in C: | (3) in C: | ||
Failed to save data at the memcached server! | Failed to save data at the memcached server! | ||
- | | + | |
Cache write error | Cache write error | ||
- | | + | |
PHP Notice: | PHP Notice: | ||
- | SERVER_ERROR object too large for cache (3) | + | SERVER_ERROR object too large for cache (3) |
in C: | in C: | ||
- | | ||
- | ADOdb currently has no mechanism for splitting large queries into smaller chunks. | ||
- | | ||
- | ===== Using a memcached server with metacaching ===== | ||
- | with the introduction of the [[dictionary: | + | ADOdb currently has no mechanism for splitting large queries into smaller chunks. |
- | - A request is made for metadata | ||
- | - If the metadata is available from the local metacache, serve the request from there | ||
- | - Check the metacache on the memcached server. If available there, copy to the local metacache and serve the request. | ||
- | - If not available from the memcached server, request from the database, and store in both the local cache and on the memcached server for later use. | ||
- | The functionality can be enabled by calling the following method '' | + | {{tag>[memcached cache]}} |
- | {{tag> |
v5/userguide/memcached.txt · Last modified: 2022/03/29 18:29 by dregad