从 Apache Log 捕获/重放会话的好方法?
对于性能测试,我想从生产服务器捕获一些流量,并将其用作向测试服务器重放请求的基础,以便模拟我们的开发环境中的实际负载。这些都是无状态查询,因此不存在有关 cookie、会话等的问题。Apache
日志将所有内容的时间戳记精确到 1 秒,但这对于我们的高峰时间来说还不够细。捕获更细粒度的时间戳以供重播的最佳方法是什么?是否有一些类似于 ab 的负载生成程序可以使用这些数据来复制负载?
For performance testing, I would like to capture some traffic from a production server and use that as a basis to replay the request to a test server in order to simulate a realistic load in our development environment. These are all stateless queries, so no issues regarding cookies, sessions, etc.
The Apache log timestamps everything down to a 1 second resolution, but that's not fine enough granularity for our peak times. What's the best way to capture more fine-grained timestamps for replay? And is there some ab
-like load generating program that can use this data to replicate load?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
使用jmeter。
https://serverfault.com/questions/84041/how-can-i-replay-apache-access-logs-back-at-my-servers-to-do-real-world-load-test
http://jmeter.apache.org/usermanual/component_reference.html#Access_Log_Sampler
就时间戳的粒度而言,你不会得到比这更好的了。但是,您可以在 jmeter 中随机化时间段。即使您的生产流量日志显示每秒都有点击量,您也可以告诉 jmeter 大幅加快速度。
Use jmeter.
https://serverfault.com/questions/84041/how-can-i-replay-apache-access-logs-back-at-my-servers-to-do-real-world-load-test
http://jmeter.apache.org/usermanual/component_reference.html#Access_Log_Sampler
As far as granularity with timestamps, you're not going to get better than that. However, you can randomize the time slots within jmeter. Even if your production traffic logs show hits every second, you can tell jmeter to speed that up drastically.
您可以捕获生产运行的网络数据,对其进行解析,然后将其用作重播机制,比较生产运行和测试运行的结果(如果需要)。 Oren Eini (Ayende Rahien) 谈到了一些非常相似的事情 在他的博客上。
我知道有(或曾经)有一个工具可以让您根据记录的会话进行负载/性能测试,但我现在找不到它:(。
You could capture the network data of a production run, parse it, and then use that as a replay mechanism comparing the results of the production run and the test run (where desired). Oren Eini (Ayende Rahien) talks about something quite similar on his blog.
I know that there is (or was) a tool that allowed you to do load/performance testing based on recorded sessions, but I can't find it right now :(.
您还可以使用 BadBoy 捕获会话以通过 JMeter 重放:
http://www.badboysoftware.biz/docs/jmeter.htm
You can also use BadBoy to capture sessions to replay w/ JMeter:
http://www.badboysoftware.biz/docs/jmeter.htm