redis的pipeline
来源:互联网 发布:怎样查到淘宝的访客数 编辑:程序博客网 时间:2024/06/03 11:24
Pipeline
官方的说明是:starts a pipeline,which is a very efficient way to send lots of command and read all the responses when you finish sending them。简单点说pipeline适用于批处理。当有大量的操作需要一次性执行的时候,可以用管道。
示例:
官方的说明是:starts a pipeline,which is a very efficient way to send lots of command and read all the responses when you finish sending them。简单点说pipeline适用于批处理。当有大量的操作需要一次性执行的时候,可以用管道。
示例:
Jedis jedis = new Jedis(String, int);
Pipeline p = jedis.pipelined();
p.set(key,value);//每个操作都发送请求给redis-server
p.get(key,value);
p.sync();//这段代码获取所有的response
Pipeline p = jedis.pipelined();
p.set(key,value);//每个操作都发送请求给redis-server
p.get(key,value);
p.sync();//这段代码获取所有的response
这里我进行了20w次连续操作(10w读,10w写),不用pipeline耗时:187242ms,用pipeline耗时:1188ms,可见使用管道后的性能上了一个台阶。看了代码了解到,管道通过一次性写入请求,然后一次性读取响应。也就是说jedis是:request response,request response,...;pipeline则是:request request... response response的方式。这样无需每次请求都等待server端的响应。
原文如下:http://www.blogjava.net/masfay/archive/2012/07/03/382080.html
阅读全文
0 0
- redis pipeline的使用
- Redis的pipeline
- Redis的pipeline方式
- redis的pipeline
- Redis的pipeline
- jedis redis pipeline的理解
- redis的pipeline测试分析
- Redis pipeline
- redis pipeline
- redis pipeline
- Redis-pipeline
- redis的pipeline机制解析与注意事项
- 五.redis pipeline
- Redis:五、pipeline
- 五.redis pipeline
- 五.redis pipeline
- Redis:五、pipeline
- Redis 之 Pipeline
- 往MySQL中存储图片
- ubuntu下bundle install报mysql 的Failed to build gem native extension错误
- H5 30
- HDU
- 关于web项目中的图片上传、并显示问题
- redis的pipeline
- TF/05_Nearest_Neighbor_Methods/03 Working with Text Distances04 Computing with Mixed Distance Functi
- 为什么我们不建议使用函数模板具体化
- 【转】校园招聘面试-操作系统知识总结
- 安卓Activity启动模式
- 知识图谱技术原理介绍
- (116)在线会话节点
- Android应用保存数据到系统数据库(Settings.System.putString、Settings.System.putInt)
- 浅谈语义角色