您好,欢迎来到三六零分类信息网!老站,搜索引擎当天收录,欢迎发信息

Memcached分布式部署方案设计(含PHP代码)

2025/11/23 6:36:18发布21次查看
php代码
<?php function test($key='name'){ $md5 = substr(md5($key), 0, 8); $seed = 31; $hash = 0; for($i=0; $i'192.168.1.2', 'port'=>6379), array('host'=>'192.168.1.3', 'port'=>6379), array('host'=>'192.168.1.4', 'port'=>6379), array('host'=>'192.168.1.5', 'port'=>6379), ); $key = 'username'; $value = 'lane'; //根据key获取hash $hash = $this->test($key); $count = count($mamcachelist); $mamcache = $mamcachelist[$hash % $count]; $mc = new mamcached($mamcache); $mc->set($key, $value); ?>
该用户其它信息

VIP推荐

免费发布信息,免费发布B2B信息网站平台 - 三六零分类信息网 沪ICP备09012988号-2
企业名录 Product