My Apache Storm topology is getting slow. I wanted to know which of methods are consuming most time and slowing down the topology. Can I profile Apache Storm topology to know where is performance bottleneck, for example use visualvm to show methods consuming a lot of time, something as follows:
Or is there any other standard / preferrable / recommended approach?
Yes, you can profile Storm just like any other Java process. This link describes the settings you need to set on the JVMs (ignore the Docker parts). You can add these parameters to your worker JVMs by setting the topology.worker.childopts
configuration setting. After that, you should be able to attach VisualVM to each worker process you want to look at.
Regarding other ways to find bottlenecks, you can look in Storm UI at the capacity metric for your bolts. Most likely your bottlenecks will have a high capacity.