【问题标题】:How to pass the real data in load testing using ApacheBench?如何使用 ApacheBench 在负载测试中传递真实数据?
【发布时间】:2017-01-23 04:15:52
【问题描述】:

我们的项目快结束了。现在我们要进行负载测试了。我们已经使用下面的评论ab -kc 1000 -n 10000 http://www.sample.com/index.php测试了静态页面

现在,如何传递真实数据以便我可以检查负载测试。

【问题讨论】:

标签: load-testing apachebench


【解决方案1】:

在 Post 方法中:

 ab -n 1 -c 1   -p text.txt  -T "multipart/form-data; boundary=1234567890"   www.project.com/post_data.php

文本文件具有以下类型的格式化数据。

text.txt

 --1234567890
 Content-Disposition: form-data; name="auth_token"

 MTQ3NDg2ODQxMjExOTAxMQ==
 --1234567890
 Content-Disposition: form-data; name="image"; filename="admmin.jpg"
 Content-Type: image/jpeg

 Base64 (Image Code Put Here)
 --1234567890--
  • Content-Disposition 是 form-data
  • 名称是发布的数据名称
  • Content-Type : 如果您使用了任何文件,则必须将文件值设为 Base64 格式
  • 值和内容描述之间必须有一个空格

在获取方法中:

使用下面的方法发布

**ab -n 1 -c 1 http://sample.com/api/v1.0/users/authentication/forgot_password.php?data="{\"email\":\"exmple@gmail.com\",\"type\":\"ut\"}"**

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 2015-03-05
    • 1970-01-01
    • 2010-12-03
    • 1970-01-01
    • 2018-09-18
    • 1970-01-01
    • 2020-06-23
    相关资源
    最近更新 更多