美文网首页
ab压测命令

ab压测命令

作者: gz_tester | 来源:发表于2019-06-11 16:00 被阅读0次

    参数说明

    image.png
    image.png

    实际操作

    示例1:

    ab -c 100 -n 1000 -H "Authorization:bearer d36a78b4-8e1e-4fea-8ced-7414664f52b1" -w https://huahua.test.wang/tz-user-center/users/user-homepage/404 > /Users/huahua/test/ab/hh.html

    含义:并发100,总请求数1000, 在header中添加Authorization认证, 请求’https://huahua.test.wang/tz-user-center/users/user-homepage/404‘, 并在指定的目录下生成测试报告

    示例2:

    ab -c 100 -n 10000 -t 60 -H "Authorization:bearer d36a78b4-8e1e-4fea-8ced-7414664f52b1" -T 'application/x-www-form-urlencoded' -p https://huahua.test.wang/tz-user-center/users/user-homepage/404 > /Users/huahua/test/ab/hh

    含义:在60s内,并发100,总请求数10000【注意:可能这10000条请求在60s运行不完;如果能运行完,则改时间段内均分这些请求;所以一般设置的请求数要大一些】, 在header中添加Authorization认证,指定content-type, 请求’https://huahua.test.wang/tz-user-center/users/user-homepage/404‘, 并在指定的目录下生成测试记录

    相关文章

      网友评论

          本文标题:ab压测命令

          本文链接:https://www.haomeiwen.com/subject/dspffctx.html