哪些 DTrace 脚本使得在 Solaris 上测试和分析 Java 程序变得值得
我发现 DTrace 很有趣,但我个人没有看到它的用途-案例允许我获得在不使用 DTrace 的情况下无法获得的信息。
因此,我想听听我忽略了什么。我可以在带有 DTrace 的 vmware OpenIndiana build 148 上做什么,以便在创建独立应用程序和 Java EE Web 应用程序(其中大多数使用套接字与旧后端进行大量通信)时发挥作用?
非常受欢迎的 Dtrace 脚本非常受欢迎。
I have found the DTrace intriguing but have personally failed to see a use-case that allow me to get information that I cannot get otherwise anyway without using DTrace.
Hence, I would like to hear what I have overlooked. What can I do on my vmware OpenIndiana build 148 with DTrace that can make a difference when creating stand-alone applications and Java EE web applications (most of which communicate heavily with a legacy backend using sockets)?
Non-trivial Dtrace scripts are very welcome.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
我在 DTrace 方面获得了一些很好的经验。
我有一个客户端在 24x7 运行的生产服务器上运行我们的 Java 代码。我们的应用程序存在一些性能问题。为了附加分析器而停止 JVM 是不可能的。此外,在相同负载下,我们的实验室中不存在这种行为。
我们使用 DTrace 和 JVM 相关探测器解决了这个问题,因为我可以将其附加到正在运行的 JVM,并且引入的开销很小(在 Netra T2000 SPARC 计算机上为 1.3%)。
该方法的好处是所有调试都是通过通往客户实验室的拨号 (33kbps) 线路完成的。在这种限制下几乎不可能运行任何其他分析器/调试器(JDWP 对于这种带宽来说相当冗长)。通过我的 DTrace 脚本,我只过滤了我感兴趣的内容。
一些提示请参见:
http://java.dzone.com/articles/java-profiling-dtrace?utm_source=feedburner&utm_medium=feed&utm_campaign=Feed:+javalobby/frontpage+(Javalobby+/+Java+Zone)
< a href="http://download.oracle.com/javase/6/docs/technotes/guides/vm/dtrace.html" rel="nofollow">http://download.oracle.com/javase/6/ docs/technotes/guides/vm/dtrace.html
我已经改编了这些脚本
http://blogs.oracle.com/ahl/date/20050418#dtracing_java
另一个很大的优点是可以轻松用于创建自定义统计数据的聚合值。
但是,如果你有适当的条件,使用其他工具一切都可以更轻松地完成。 DTrace 非常强大,但它针对更多裸机条件(也许 DLight 项目会有所帮助)。
I had some good experiences with DTrace.
I had a client running our Java code on a production server running 24x7. We had some performance issues with the applications. It was impossible to stop the JVMs in order to attach the profiler. Moreover the behavior was not present in our lab under the same load.
We solved the issue using DTrace with the JVM related probes as I could attach it to the running JVMs and the overhead introduced was minimal (1.3% on a Netra T2000 SPARC machine).
The bonus of the method was that all the debugging was done via a dial-up (33kbps) line to the customer's lab. It is almost impossible to run any other profiler/debugger with this constraints (JDWP is quite verbose for this bandwidth). With my DTrace script I filtered only what it was interesting for me.
For some hints see:
http://java.dzone.com/articles/java-profiling-dtrace?utm_source=feedburner&utm_medium=feed&utm_campaign=Feed:+javalobby/frontpage+(Javalobby+/+Java+Zone)
http://download.oracle.com/javase/6/docs/technotes/guides/vm/dtrace.html
I have adapted those scripts
http://blogs.oracle.com/ahl/date/20050418#dtracing_java
Another big plus are the aggregated values that can be easily used to create custom statistics.
But, if you have appropriate conditions, everything can be done easier with othe tools. DTrace is very powerfull but it targets more bare-metal conditions (maybe DLight project would help).