14

Context

We wish to use "replay" web server access logs to generate load tests. JMeter had come to mind as I'd recently read blog posts about using jmeter in the cloud (e.g. firing up a number of Amazon EC2 instances to generate the load)

For years I had heard of JMeter's ability to replay access logs, but in reviewing this feature I found the following.

Access Log Sampler

  • DOES:

    • recreate sessions, i.e. handle the jsessionId token (thought it tries to approximate sessions by IP address);
  • DOES NOT:

    • handle POST data (even if you could configure apache/tomcat to write out post data to the access log, jmeter access log sampler only handles 'common' log format).

Post data would go a long way toward recreating actual load.

Additionally, the documentation describes the Access Log Sampler as "alpha code" even though it's 8 years old. It doesn't seem actively maintained. (That's longer than Gmail's beta.)

HttpPerf

Another blog post pointed me to the httpperf tool. I've started to read up on it:

Summary

  • What's the best way to generate load testing 'scripts' from real user data?
  • What has worked best for you?
  • Pros and cons of various tools?
4

3 回答 3

1

JMeter + HTTP 原始请求 + 原始数据源对我来说效果很好

于 2011-03-23T10:17:33.710 回答
0

我将描述我们如何使用我们自己的名为Yandex Tank的 LT 工具来解决这个问题 。它可以处理简单的 access.log,但也只能处理“GET”请求。当需要发出其他类型的请求时,我们会使用其他 ammo 格式(ammo 是一个包含我们要发送到服务器的所有请求的文件)。例子:

342
POST / HTTP/1.1^M
Host: xxx.xxx.xxx.xxx:8080^M
Connection: keep-alive^M
Keep-Alive: 300^M
Content-Type: multipart/form-data; boundary=AGHTUNG^M
Content-Length: 1400^M
Connection: Close^M
^M
--AGHTUNG^M
Content-Disposition: form-data; name="fp"; filename="fp_tank"^M
Content-Type: application/octet-stream^M
Content-Transfer-Encoding: binary^M
...
--AGHTUNG--^M

第一行的数字('342')是后续请求的大小。请求是原始格式。你可以用你喜欢的语言编写一个简单的脚本,从你的 access.log 中生成这样的弹药文件,然后用它来进行负载测试。

这种弹药格式使其非常灵活。例如,代码从 FCGI 日志生成弹药(POST 正文以 Base64 编码)。但另一方面,您将需要手动处理会话。

于 2014-02-25T12:02:05.670 回答
0

您可以使用ZebraTester轻松重放包含 POST数据的访问日志。它有许多类似于 JMeter 的插件,并且还能够添加内联脚本,使用这些脚本您可以轻松地从访问日志中定位 POST 有效负载、URL、时间戳等。您可以在本地直接从该工具运行负载测试或将录制的脚本复制到SaaS 门户以运行海量的百万虚拟用户负载测试

于 2017-03-07T19:07:22.067 回答