v5:userguide:memcached
Differences
This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revisionNext revision | Previous revisionLast revisionBoth sides next revision | ||
v5:userguide:memcached [2019/12/16 00:53] – mnewnham | v5:userguide:memcached [2022/03/20 18:07] – [Adding Weighted Server Groups] fix syntax error in code sample dregad | ||
---|---|---|---|
Line 55: | Line 55: | ||
</ | </ | ||
+ | ===== Adding Weighted Server Groups ===== | ||
+ | |||
+ | 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> | ||
+ | array( | ||
+ | ' | ||
+ | ' | ||
+ | ' | ||
+ | ); | ||
+ | </ | ||
+ | |||
+ | The host arrays are then combined together. In this example 86.91 serves 70% of requests and 86.92 serves 30% | ||
+ | <code php> | ||
+ | |||
+ | $hosts = array( | ||
+ | array(' | ||
+ | array(' | ||
+ | ); | ||
+ | |||
+ | $db = NewADOConnection($driver=' | ||
+ | |||
+ | /* | ||
+ | * Enable memcache | ||
+ | */ | ||
+ | $db-> | ||
+ | |||
+ | /* | ||
+ | * Add the weighted servers in $memCacheHosts. All other parameters are ignored. | ||
+ | */ | ||
+ | $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-> | ||
+ | </ | ||
+ | |||
===== Using Debug Mode ===== | ===== Using Debug Mode ===== | ||
v5/userguide/memcached.txt · Last modified: 2022/03/29 18:29 by dregad