How can I profile Apache Storm topologies without using the web dashboard?

你。 提交于 2019-12-10 22:09:35

问题


The title pretty much says it all, I have some Storm topologies and I'd like to measure their latencies, that is, the amount of time between a message coming in from Kafka and the last bit of related execution in the final bolt. Bonus points if I can drill into the results to see the latency across each bolt.

Can this be done by simply tweaking the Storm configuration?

If not, is http://storm.incubator.apache.org/apidocs/backtype/storm/hooks/info/SpoutAckInfo.html backtype.storm.hooks.info.SpoutAckInfo.completeLatencyMs the thing I'm looking for?


回答1:


For general profiling, we have a fork of storm where I enable the supervisor to dynamically set and open the JMX port equal to 1000 higher than the worker port (of course, this limits the number of workers we could assign, but we're nowhere near that problem now). Then with the supervisor.childopts value we assign the worker's JMX port and connect with Visual VM.

Specific to your metrics question, you can use the BaseTaskHook to push the storm metrics to something with an MBean (we use codahale metrics) and again, browse the values over JMX. I posted an example gist. Note we haven't uplifted to 3.x of codahale metrics.

With Java 7 tools, I believe you're able to turn on JMX on a running JVM, so if you're on Java 7+, that would also help you.



来源:https://stackoverflow.com/questions/25042914/how-can-i-profile-apache-storm-topologies-without-using-the-web-dashboard

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!