JMeter - 如何处理非常大的输出 xml 文件以进行长时间测试

发布于 2024-10-03 18:35:43 字数 187 浏览 1 评论 0原文

我想长时间运行 JMeter(6 小时以上),以验证 Web 应用程序在负载下的稳定性。

问题是 jmeter 的 XML 输出文件变得很大并且用 XSL 解析非常慢。

是否可以:

  • 将输出发送到数据库(mysql 等)
  • 一旦达到最大大小,将输出拆分为多个 XML 文件

I want to run JMeter for an extended period of time (6+ hours), to validate the stability of a web application under load.

The problem is that the XML output files for jmeter get to be huge and very slow to parse with XSL.

Is it possible to:

  • Send the output to a database (mysql, etc)
  • Split the outputs into multiple XML files once they reach a max size

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

风启觞 2024-10-10 18:35:43

在 Jmeter 中,您的建议都是不可能的。您可以使用第三方工具/脚本在运行后分割 XML 文件。

您是否将输出文件限制为仅包含您想要的数据?例如,您是否需要捕获所有传递的查询的响应数据?根据我的需要,我创建了两个侦听器:一个用于所有请求,另一个仅用于失败的请求。我只写失败请求的响应数据。

Within Jmeter, neither of your proposals is possible. You could have a third party tool/script split the XML file after the run.

Have you limited the output file to just the data you want? For example, do you need to capture the response data for all passed queries? For my needs, I create two listeners: One for all requests and one for failed requests only. I only write the response data for the failed requests.

少女净妖师 2024-10-10 18:35:43

我认为这个问题在 JMeter 3.1 中已经得到解决。

在 jmeter.properties(apache-jmeter-3.1/bin) 文件中向以下参数添加更高的值并检查您的 jmeter 测试。

httpsampler.max_bytes_to_store_per_request:每个请求在内存中保留的最大字节数

httpsampler.max_buffer_size:读取服务器发送的响应时的缓冲区大小。

仅供参考(来自 JMeter 3.1 更改),
JMeter 现在能够处理大于 2GB 的指标响应,限制已增加到 9223372 TB。
为了处理如此大的响应,它现在还可以截断部分响应以避免内存溢出。请参阅 httpsampler.max_bytes_to_store_per_request 属性。

您可以参考 JMeter 3.1 更改 中的“处理大响应”部分

I think this problem is resolved in JMeter 3.1.

Add higher values to below parameters in jmeter.properties(apache-jmeter-3.1/bin) files and check your jmeter test.

httpsampler.max_bytes_to_store_per_request: Maximum number of bytes to keep in memory per request

httpsampler.max_buffer_size: Buffer size when reading response sent by the server.

FYI (from JMeter 3.1 Changes),
JMeter is now able to handle in terms of metrics responses bigger than 2GB, limit has been increased to 9223372 TB.
To handle such big responses, it can also now truncate part of the response to avoid overflooding memory. See httpsampler.max_bytes_to_store_per_request property.

You can refer the 'Handling Big responses' section in JMeter 3.1 Changes

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文