

原帖由 qwe123 于 2009-9-20 12:07 发表
memcached和memcache扩展不一样啊,你是只装展了还是两个都装了,还是只装扩展了?我现在所有的mysql 缓存都在内存中,不在硬盘上![]()



没明白啥意思
原帖由 qwe123 于 2009-9-20 13:00 发表
对,没有cache这个文件夹,缓存都进了memcached的共享内存中去了,我的在wp-config.php中填加这句
global $memcached_servers;
$memcached_servers = array('default' => array(’127.0.0.1:13112′));就是把缓存放到mecac ...
原帖由 qwe123 于 2009-9-20 13:00 发表
对,没有cache这个文件夹,缓存都进了memcached的共享内存中去了,我的在wp-config.php中填加这句
global $memcached_servers;
$memcached_servers = array('default' => array(’127.0.0.1:13112′));就是把缓存放到mecac ...


,只能装EA和zend原帖由 tumour 于 2009-9-20 13:21 发表
APC和ZEND不兼容??
我的网站程序 wordpress + discuz!论坛
想用nginx
探讨一下
nginx下 + eA + memcached + ZEND 是否可行?
memcached 和那个一键安装包的memcache 有区别? ...
$memcachehost = '127.0.0.1';
$memcacheport = 11211;
$memcachelife = 60;
$mem = new Memcache;
$mem->connect($memcachehost, $memcacheport);
function fetch_array($query, $result_type = MYSQL_ASSOC) {
return is_resource($query) ? mysql_fetch_array($query, $result_type) : $query[0];
}
function query_memcache($sql, $type = '') {
global $mem,$memcachelife;
$key = md5($sql);
if(!($query = $mem->get($key))) {
$query = $this->query($sql, $type);
while($item = $this->fetch_array($query)) {
$res[] = $item;
}
$query = $res;
$mem->set($key, $query , 0, $memcachelife);
}
return $query;
}
function query($sql, $type = '') {
global $debug, $discuz_starttime, $sqldebug, $sqlspenttimes;
$func = $type == 'UNBUFFERED' && @function_exists('mysql_unbuffered_query') ?
'mysql_unbuffered_query' : 'mysql_query';
if(!($query = $func($sql, $this->link)) && $type != 'SILENT') {
$this->halt('MySQL Query Error', $sql);
}
if(substr($sql, 0, 6) == 'SELECT') {
echo '<font color="red">Cache SQL</font>:<font color="green">'.$sql.'</font><br /><br />';
} else {
echo '<font color="red">Flash SQL</font>:<font color="green">'.$sql.'</font><br /><br />';
}
$this->querynum++;
return $query;
}
$db->query(
$db->query_memcache(
while($post = $db->fetch_array($query)) {
foreach($query as $post) {
preg_replace("/while\([$](\w+)\s*\=\s*[$]db->fetch_array\([$]query\)\)/is", "foreach(\$query as \$\\1)", $file);

原帖由 cpuer 于 2009-9-20 17:46 发表
http://www.mydays.org/html/y2009/1614.html 可以打开啊,速度很快呢。
22 queries. 0.320 seconds.
memcached 没起作用吧?![]()




善意的谎言。
| 欢迎光临 全球主机交流论坛 (https://hostloc-workers.ikyomon.com/) | Powered by Discuz! X3.4 |