检测ActiveMQ流控
我有一个生产系统,它使用 ActiveMQ (5.3.2) 将消息从服务器 A 发送到服务器 B。几周前,系统莫名其妙地开始花费 10 秒以上的时间来发送消息。生产者重新启动后,系统运行良好。
经过调查,我很确定这是由于生产者流量控制造成的。 (我有一个相当标准的 activemq 设置)。发生这种情况的前一天(由于其他原因)我的消费者软件运行不稳定,甚至有一段时间停止接受连接。所以我猜这触发了这个。 (令我困惑的是,一天后请求仍然受到限制)。
问题 - 我如何确认请求已被限制。我对服务器进行了堆转储——内存中是否有我可以查找的数据?
编辑:我发现了以下内容: 对于内存中的三个 WireFormatNegotiator 实例之一,WireFormatNegotiator.tcpNoDelayEnabled=false。我正在试图找出是什么造成了这一点。
其次(也是更重要的),有没有办法可以使用 JMX 来判断消息是否受到限制?我想设置 Nagios 警报,让我知道将来是否会发生这种情况。我应该使用 JMX 检查哪些属性?
I have a production system that uses ActiveMQ (5.3.2) to send messages from server A to server B. A few weeks ago, the system inexplicably started taking 10+ second to send a message. After a reboot of the producer, the system worked fine.
After investigation, I'm pretty sure this is due to producer flow control. (I have a fairly standard activemq setup). The day before this happened (for other reasons) my consumer software had been acting erratically and had even stopped accepting connections for a while. So I'm guessing this triggered this. (It does puzzle me that the requests were still being throttled a day later).
Question -- how can I confirm that the requests were being throttled. I took a heap dump of the server -- is there data in memory I can look for?
Edit: I've found the following:
WireFormatNegotiator.tcpNoDelayEnabled=false for one of three WireFormatNegotiator instances in the memory. I'm trying to figure out what sets this.
And second (and more important), is there a way I can use JMX to tell if the messages are being throttled? I'd like to set up a Nagios alert to let me know if this happens in the future. What property should I check for with JMX?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
您可以配置您的生产者客户端以抛出 javax.jms.ResourceAllocationException 异常,然后可以被检测/记录等。只需设置以下其中一项...
you can configure your producer client to throw javax.jms.ResourceAllocationException exceptions which can then be detected/logged, etc. just set one of the following...