浏览 1684 次
锁定老帖子 主题:memcache proxy magent
精华帖 (0) :: 良好帖 (0) :: 新手帖 (0) :: 隐藏帖 (0)
|
|
---|---|
作者 | 正文 |
发表时间:2011-03-07
最后修改:2011-03-07
It features: keeps connections to memcached servers supports following memcached commands get gets delete incr decr add set replace prepend append cas event-driven by using libevent library supports ketama algorithm backup servers farm unix domain socket http://code.google.com/p/memagent/ 使用proxy 和未使用proxy 性能对比,未开启 ketama key allocation algorithm 测试环境 / memcache 1 proxy ------------------ \ memcache 2 mc = memcache.Client(["memcache"]) ... n = time.time() ... for i in xrange(100): ... mc.set("%s" % i * 10,i) ... ... for i in xrange(100): ... mc.get("%s" % i * 10 ) ... ... print time.time() - n 0.7 - 0.9 23: 99 >>> mc = memcache.Client(["proxy"]) ... n = time.time() ... for i in xrange(100): ... mc.set("%s" % i * 10,i) ... ... for i in xrange(100): ... mc.get("%s" % i * 10 ) ... ... print time.time() - n 0.9 - 1.1 24: 99 使用proxy 和未使用proxy 性能对比,开启ketama key allocation algorithm mc = memcache.Client(["proxy"]) ... n = time.time() ... for i in xrange(100): ... mc.set("%s" % i * 10,i) ... ... for i in xrange(100): ... mc.get("%s" % i * 10 ) ... ... print time.time() - n 0.946000099182 - 1.1 75: 99 通过开启一致性哈希测试2台cache key的分布并不均匀 ,需要增加更多的memcache节点。 声明:ITeye文章版权属于作者,受法律保护。没有作者书面许可不得转载。
推荐链接
|
|
返回顶楼 | |