|  | 
 
| 本帖最后由 lujscn 于 2013-8-8 18:03 编辑 
 我的服务器已经配置好memcached, 调试了好几天都有问题,开始是memcached直接用不了,后来根据以下两个帖子改了:
 http://codeigniter.org.cn/forums/thread-10071-1-1.html
 http://codeigniter.org.cn/forums/thread-14066-1-1.html
 改了之后是能用了,可是还不完善,
 后来我下载了CI3,果然这个故障不再存在。
 
 我的控制器代码是:
 
 PHP复制代码 复制代码 
echo '-';
$this->load->driver('cache',  array('adapter' => 'memcached', 'backup' => 'file') );
$this->cache->save('foo', 'bar', 10);
$x = $this->cache->get('foo');
echo $x;
                
if ($this->cache->memcached->is_supported())
{
          echo "-memcached yes!";
}
else echo "-memcached no!";
                
if ($this->cache->file->is_supported())
{
          echo "-file yes!";
}
else echo "-file no!";
                
echo '*<pre>';
print_r($this->cache->cache_info());
echo '</pre>';
 在CI2.1.4下得到的结果是:
 
 
 --memcached no!-file yes!*Array
 (
 [index.html] => Array
 (
 [name] => index.html
 [server_path] => /data/web/wdocs/mai-hua_com/ci/application/cache/index.html
 [size] => 114
 [date] => 1375953133
 [relative_path] => application/cache/
 )
 
 )
 在config中增加migration.php故障依然。
 
 在CI3得到的结果是:
 
 -bar-memcached yes!-file yes!*Array
 (
 [pid] => 3978
 [uptime] => 170984
 [time] => 1375956200
 [version] => 1.4.15
 [libevent] => 1.4.13-stable
 [pointer_size] => 64
 [rusage_user] => 21.844679
 [rusage_system] => 40.076907
 [curr_connections] => 73
 [total_connections] => 396
 [connection_structures] => 86
 [reserved_fds] => 20
 [cmd_get] => 3326501
 [cmd_set] => 226730
 [cmd_flush] => 0
 [cmd_touch] => 0
 [get_hits] => 3243606
 [get_misses] => 82895
 [delete_misses] => 5278
 [delete_hits] => 30341
 [incr_misses] => 0
 [incr_hits] => 0
 [decr_misses] => 0
 [decr_hits] => 0
 [cas_misses] => 0
 [cas_hits] => 0
 [cas_badval] => 0
 [touch_hits] => 0
 [touch_misses] => 0
 [auth_cmds] => 0
 [auth_errors] => 0
 [bytes_read] => 182014672
 [bytes_written] => 2305296578
 [limit_maxbytes] => 67108864
 [accepting_conns] => 1
 [listen_disabled_num] => 0
 [threads] => 4
 [conn_yields] => 0
 [hash_power_level] => 16
 [hash_bytes] => 524288
 [hash_is_expanding] => 0
 [bytes] => 8172876
 [curr_items] => 12318
 [total_items] => 222150
 [expired_unfetched] => 83
 [evicted_unfetched] => 0
 [evictions] => 0
 [reclaimed] => 142
 )
 
 CI2.1.4按上两个帖子改过以后的结果:
 
 -bar-memcached yes!-file yes!*Array
 (
 [pid] => 3978
 [uptime] => 170037
 [time] => 1375955253
 [version] => 1.4.15
 [libevent] => 1.4.13-stable
 [pointer_size] => 64
 [rusage_user] => 21.298762
 [rusage_system] => 39.035065
 [curr_connections] => 72
 [total_connections] => 387
 [connection_structures] => 86
 [reserved_fds] => 20
 [cmd_get] => 3246496
 [cmd_set] => 219476
 [cmd_flush] => 0
 [cmd_touch] => 0
 [get_hits] => 3165342
 [get_misses] => 81154
 [delete_misses] => 5143
 [delete_hits] => 29561
 [incr_misses] => 0
 [incr_hits] => 0
 [decr_misses] => 0
 [decr_hits] => 0
 [cas_misses] => 0
 [cas_hits] => 0
 [cas_badval] => 0
 [touch_hits] => 0
 [touch_misses] => 0
 [auth_cmds] => 0
 [auth_errors] => 0
 [bytes_read] => 177420773
 [bytes_written] => 2250850753
 [limit_maxbytes] => 67108864
 [accepting_conns] => 1
 [listen_disabled_num] => 0
 [threads] => 4
 [conn_yields] => 0
 [hash_power_level] => 16
 [hash_bytes] => 524288
 [hash_is_expanding] => 0
 [bytes] => 8150443
 [curr_items] => 12274
 [total_items] => 214898
 [expired_unfetched] => 83
 [evicted_unfetched] => 0
 [evictions] => 0
 [reclaimed] => 141
 )
 看来CI3确实比CI2.1.4强,不知道正式版什么时候出来。
 
 都想直接用dev版了!
 
 
 
 | 
 |