Java 如何在负载测试期间测量 CPU 和内存
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/4192722/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
How to measure CPU and memory during load test
提问by Thomas Zuberbühler
We are using JMeter in a heterogeneous environment and we would like to measure CPU and memory while we are producing heavy load on a server where our service or web application is running. What would you recommend to use? Is there any software solution (open source or commercial) available which records CPU and memory usage in a file or to a database?
我们在异构环境中使用 JMeter,当我们在运行服务或 Web 应用程序的服务器上产生大量负载时,我们希望测量 CPU 和内存。你会推荐使用什么?是否有任何软件解决方案(开源或商业)可以在文件或数据库中记录 CPU 和内存使用情况?
Thank you!
谢谢!
采纳答案by zengr
From the java perspective, you can use jconsoleor write your own codeto monitor the memory usage.
从java的角度,可以使用jconsole或者自己编写代码来监控内存使用情况。
- Measure CPU and memory consumption of a Java application
- javasysmonon github
- dstatfor linux and perfmon for windows. Read more
- 测量 Java 应用程序的 CPU 和内存消耗
- github 上的 javasysmon
- dstatfor linux 和 perfmon for windows。阅读更多
回答by Stephane
You can use our JMeter perfmon pluginto measure CPU, memory and a lot of other metrics:
您可以使用我们的 JMeter perfmon 插件来测量 CPU、内存和许多其他指标:
回答by liulinyang
回答by user2981810
One you install the Perfmon plugin, I also had to install the server agent, and open the firewall port 4444.
一个你安装Perfmon插件,我还得安装服务器代理,并打开防火墙端口4444。
Here's a link which I found super useful.
这是我发现非常有用的链接。