Access log replay for load testing? Jmeter Pitfalls and Competitors

后端 未结 3 1328
旧时难觅i
旧时难觅i 2021-02-04 07:39

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 jm

3条回答
  •  傲寒
    傲寒 (楼主)
    2021-02-04 08:14

    I will describe how do we solve this problem using our own LT tool called Yandex Tank It can handle simple access.log but only 'GET' requests, too. When there's a need to make other types of requests, we use other ammo formats (ammo is a file containing all the requests that we gonna send to our server). Example:

    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
    

    A number ('342') on the first line is the size of a following request. Request is in it's raw format. You could write a simple script in your favourite language that generates such ammo files from your access.log and then use it for load testing.

    Such ammo format makes it really flexible. For example, this code generates ammo from FCGI logs (POST bodies are encoded in Base64). But on the other hand you will need to handle sessions manually.

提交回复
热议问题