[Storm] 内部消息缓存
这篇文件翻译自 http://www.michael-noll.com/blog/2013/06/21/understanding-storm-internal-message-buffers/
当进行Storm调优时,理解Storm内部消息队列的配置十分有帮助。这篇文件将说明在Storm 0.8/0.9版本中一个Worker内部的消息通信。
Storm Worker进程内部消息传输
这里所说的“内部消息”是指单台节点上的一个Worker进程内部的消息。这种通信依赖于Storm内部各种 LMAX Disrupter(高性能多线程消息库) 支持的消息队列。
单个Worker进程内部多线程通信不同于多个worker进程之间的通信。后者通常跨网络或者机器,Storm采用 Zero MQ/Netty进行支持。
- Intra-worker communication in Storm (inter-thread on the same Storm node): LMAX Disruptor
- Inter-worker communication (node-to-node across the network): ZeroMQ or Netty
- Inter-topology communication: nothing built into Storm, you must take care of this yourself with e.g. a messaging system such as Kafka/RabbitMQ, a database, etc.
事例说明

Storm内部消息队列概要。Worker进程的消息队列标识为红色,Worker内部Executer的消息队列标识为绿色。图中为了可读性,只有一个Worker和一个Executor,而现实中通常有多个Worker,一个Worker中也可能有多个Executors。
详细描述
Worker进程
为了管理进来和出去的消息,每个Worker进程有一个监听TCP端口(configured by supervisor.slots.ports)的接收线程。类似的,每个Worker有一个发送线程负责将从transfer queue中读到的消息发送到下游消费者。
- The
topology.receiver.buffer.sizeis the maximum number of messages that are batched together at once for appending to an executor’s incoming queue by the worker receive thread (which reads the messages from the network) Setting this parameter too high may cause a lot of problems (“heartbeat thread gets starved, throughput plummets”). The default value is 8 elements, and the value must be a power of 2 (this requirement comes indirectly from LMAX Disruptor). // Example: configuring via Java API
Config conf = new Config();
conf.put(Config.TOPOLOGY_RECEIVER_BUFFER_SIZE, 16); // default is 8- Each element of the transfer queue configured with
topology.transfer.buffer.sizeis actually a list of tuples. The various executor send threads will batch outgoing tuples off their outgoing queues onto the transfer queue. The default value is 1024 elements. // Example: configuring via Java API
conf.put(Config.TOPOLOGY_TRANSFER_BUFFER_SIZE, 32); // default is 1024
Executors
一个Worker进程控制着一个或者多个Executer线程。每个Executor有自己的 incoming queue 和 outgoing queue
每个Executor有一个负责逻辑处理spout/bolt的线程, 一个接收消息线程,和一个发送消息线程。
- The
topology.executor.receive.buffer.sizeis the size of the incoming queue for an executor. Each element of this queue is a list of tuples. Here, tuples are appended in batch. The default value is 1024 elements, and the value must be a power of 2 (this requirement comes from LMAX Disruptor). // Example: configuring via Java API
conf.put(Config.TOPOLOGY_EXECUTOR_RECEIVE_BUFFER_SIZE, 16384); // batched; default is 1024- The
topology.executor.send.buffer.sizeis the size of the outgoing queue for an executor. Each element of this queue will contain a single tuple. The default value is 1024 elements, and the value must be a power of 2 (this requirement comes from LMAX Disruptor). // Example: configuring via Java API
conf.put(Config.TOPOLOGY_EXECUTOR_SEND_BUFFER_SIZE, 16384); // individual tuples; default is 1024
[Storm] 内部消息缓存的更多相关文章
- Storm内部的消息传递机制
作者:Jack47 转载请保留作者和原文出处 欢迎关注我的微信公众账号程序员杰克,两边的文章会同步,也可以添加我的RSS订阅源. 一个Storm拓扑,就是一个复杂的多阶段的流式计算.Storm中的组件 ...
- Apache Storm内部原理分析
转自:http://shiyanjun.cn/archives/1472.html 本文算是个人对Storm应用和学习的一个总结,由于不太懂Clojure语言,所以无法更多地从源码分析,但是参考了官网 ...
- 交易系统使用storm,在消息高可靠情况下,如何避免消息重复
概要:在使用storm分布式计算框架进行数据处理时,如何保证进入storm的消息的一定会被处理,且不会被重复处理.这个时候仅仅开启storm的ack机制并不能解决上述问题.那么该如何设计出一个好的方案 ...
- WebIM(2)---消息缓存
WebIM系列文章 在一步一步打造WebIM(1)一文中,已经介绍了如何实现一个简单的WebIM,但是,这个WebIM有一个问题,就是每一次添加消息监听器时,都必须访问一次数据库去查询是否有消息,显然 ...
- nordic mesh中的消息缓存实现
nordic mesh中的消息缓存实现 代码文件msg_cache.h.msg_cache.c. 接口定义 头文件中定义了四个接口,供mesh协议栈调用,四个接口如下所示,接口的实现代码在msg_ca ...
- 内部消息 微软中国云计算 内測Azure免费账号 赶紧申请 错过不再有
内部消息 微软中国云计算 顶级内測Azure免费账号 火热申请 过期不再有! 微软MSDN俱乐部 29754721, [一大波Azure免费账号来袭]Windows Azure再次开启示放免费试用账 ...
- 6张图为你分析Kafka Producer 消息缓存模型
摘要:发送消息的时候, 当Broker挂掉了,消息体还能写入到消息缓存中吗? 本文分享自华为云社区<图解Kafka Producer 消息缓存模型>,作者:石臻臻的杂货铺. 在阅读本文之前 ...
- 理解Storm可靠性消息
看过一些别人写的, 感觉有些东西没太说清楚,个人主要以源代码跟踪,参考个人理解讲述,有错误请指正. 1基本名词 1.1 Tuple: 消息传递的基本单位.很多文章中介绍都是这么说的, 个人觉得应该更详 ...
- nginx+lua+storm的热点缓存的流量分发策略自动降级
1.在storm中,实时的计算出瞬间出现的热点. 某个storm task,上面算出了1万个商品的访问次数,LRUMap 频率高一些,每隔5秒,去遍历一次LRUMap,将其中的访问次数进行排序,统计出 ...
随机推荐
- Tiny C Compiler(Tcc)
catalog . Tcc introduction . Tcc安装配置 . Tcc Programing 1. Tcc introduction TCC基本和GCC兼容 . 符合ANSI C(C8 ...
- Spring Cache 介绍
Spring Cache 缓存是实际工作中非常常用的一种提高性能的方法, 我们会在许多场景下来使用缓存. 本文通过一个简单的例子进行展开,通过对比我们原来的自定义缓存和 spring 的基于注释的 c ...
- 大一上学期C语言学习心得总结
经过一个学期的C语言学习,大体算是在这个编程语言上入了门,能够通过一些代码解决特定的问题.当然,每次成功将问题转换成代码都小有激动,虽然只是在黑框上输出了一些数字或是字符串. 编程,虽然还不是很懂,但 ...
- [Eclipse]解决: Eclipse Maven “Add Dependency”搜索无结果
转载: http://www.educity.cn/wenda/469389.html eclipse插件Maven添加依赖查询无结果的解决方法(Select Dependency doesn't w ...
- PHP之:析构函数
如何正确理解PHP析构函数 参考文献:http://developer.51cto.com/art/200912/167023.htm 初次学习PHP语言的朋友们可能对PHP析构函数有些不太了解.我们 ...
- Yocto开发笔记之《工具使用:TFTP & NFS & SSH》(QQ交流群:519230208)
QQ群:519230208,为避免广告骚扰,申请时请注明 “开发者” 字样 ======================================================== TFTP工 ...
- 【原】gulp快速入门
今天刚入职了一家新公司,结果明天就要开始项目了.上级说要用gulp来打包代码,所以今晚花了一晚来看这个gulp, 可以说已经入门了.所以做一个小小的总结 : 首先全局安装gulp npm instal ...
- ObjectInputStream类和ObjectInputStream类的使用
版权声明:本文为博主原创文章,未经博主允许不得转载. ObjectInputStream和ObjectInputStream类创建的对象被称为对象输入流和对象输出流. 创建文件输出流代码: FileO ...
- JQuery------$.get()和$.post()传递数据的使用方法
菜鸟教程地址: http://www.runoob.com/jquery/jquery-ref-ajax.html html(../Home/Index.cshtml) <!DOCTYPE ht ...
- Java关键字——final
final在Java中表示的意思是最终,使用final关键字声明类属性.方法,注意: 1.使用final声明的类不能有子类 2.使用final声明的方法不能被子类所覆写 3.使用final声明的变量即 ...