• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

php-stress-tester: 基于Swoole协程的HTTP压力测试工具

原作者: [db:作者] 来自: 网络 收藏 邀请

php-stress-tester

Build Status

Description

A simple stress tester based on swoole coroutine.

Requirements

  1. Swoole2.1.0+ (编译时请添加参数 --enable-openssl --enable-coroutine)
  2. PHP7.1+
  3. 勿同时安装opencensus扩展,经测试有内存泄漏问题

Usage

# GETphp start.php -c 100 -n 1000 -host www.baidu.com -uri / -port 443 -ssl 1 -step 1# POSTphp start.php -c 100 -n 1000 -host www.baidu.com -uri / -port 443 -ssl 1 -step 1 -http_method POST -http_body {\"foo\":\"bar\"}# PUTphp start.php -c 100 -n 1000 -host www.baidu.com -uri / -port 443 -ssl 1 -step 1 -http_method PUT -http_body {\"foo\":\"bar\"}# DELETEphp start.php -c 100 -n 1000 -host www.baidu.com -uri / -port 443 -ssl 1 -step 1 -http_method DELETE -http_body {\"foo\":\"bar\"}# Helpphp start.php -help# Draw QPS graphpython tools/draw.py ~/php-stress-tester/reports/report_20180601144315278353823169.csv qps 1

Output

测试中...最大请求并发: 100请求并发: 100请求总数: 1000平均耗时: 41.335484266281毫秒最大耗时: 165.99607467651毫秒最小耗时: 25.51007270813毫秒成功请求总数: 1000成功率: 100%成功平均耗时: 41.335484266281毫秒成功最大耗时: 165.99607467651毫秒成功最小耗时: 25.51007270813毫秒失败请求总数: 0失败率: 0%失败平均耗时: 0毫秒失败最大耗时: 0毫秒失败最小耗时: 0毫秒实时QPS: 1000平均QPS: 1000内存占用: 2012.72KB

QPS Graph

QPS Figure

Arguments

  1. -c Concurrency
  2. -n Requests
  3. -host Hostname
  4. -uri Uri
  5. -port Port
  6. -ssl SSL
  7. -step Concurrency Step
  8. -http_method HTTP Method
  9. -http_body HTTP Body
  10. -memory_limit Memory Limit
  11. -max_coroutine Max Coroutine

鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
热门推荐
热门话题
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap