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 | ||
v5:userguide:memcached [2021/01/25 02:30] – mnewnham | v5:userguide:memcached [2022/03/09 08:58] – [Adding Weighted Server Groups] dregad | ||
---|---|---|---|
Line 56: | Line 56: | ||
</ | </ | ||
===== Adding Weighted Server Groups ===== | ===== Adding Weighted Server Groups ===== | ||
- | From ADOdb version 5.22, the **memcached** library supports the use of **// | + | |
+ | From ADOdb version 5.22, the **memcached** library supports the use of **// | ||
+ | |||
+ | If the feature is used, the total weighting of the server group must equal 100%. To achieve this, the configuration of the servers must be defined in a different way to the default. Each host is defined as an array: | ||
<code php> | <code php> | ||
Line 62: | Line 65: | ||
' | ' | ||
' | ' | ||
- | ' | + | ' |
); | ); | ||
</ | </ | ||
Line 82: | Line 85: | ||
/* | /* | ||
- | * Add the weighted servers | + | * Add the weighted servers |
*/ | */ | ||
$db-> | $db-> | ||
+ | </ | ||
+ | |||
+ | ===== Adding options to the memcached server ===== | ||
+ | From ADOdb version 5.22, [[https:// | ||
+ | |||
+ | <code php> | ||
+ | |||
+ | $hosts = array( | ||
+ | array(' | ||
+ | array(' | ||
+ | ); | ||
+ | |||
+ | $db = NewADOConnection($driver=' | ||
+ | |||
+ | /* | ||
+ | * Enable memcache | ||
+ | */ | ||
+ | $db-> | ||
+ | |||
+ | /* | ||
+ | * Add the weighted servers in $memCacheHosts | ||
+ | */ | ||
+ | $db-> | ||
+ | |||
+ | /* | ||
+ | * Set some options | ||
+ | */ | ||
+ | $db-> | ||
</ | </ | ||
v5/userguide/memcached.txt · Last modified: 2022/03/29 18:29 by dregad