apache ab压测入门

压测

  • wrk
const http = require('http');

const hostname = '127.0.0.1';
const port = 1337;

http.createServer((req, res) => {
  res.writeHead(200, { 'Content-Type': 'text/plain' });
  res.end('Hello World\n');
}).listen(port, hostname, () => {
  console.log(`Server running at http://${hostname}:${port}/`);
});
wrk -t24 -c140 -d20s http://127.0.0.1:1337

Running 20s test @ http://127.0.0.1:1337
  24 threads and 140 connections
  Thread Stats   Avg      Stdev     Max   +/- Stdev
    Latency     4.97ms  628.84us  20.96ms   95.34%
    Req/Sec     1.01k    47.70     1.32k    75.98%
  483525 requests in 20.03s, 71.94MB read
Requests/sec:  24137.35
Transfer/sec:      3.59MB
  • AB
bin>ab -k -n 2000 -c 2000 localhost:3000/a
// post
ab -n 100 -c 100 -p ./post.txt -T application/x-www-form-urlencoded "http://beatlegend.lol.qq.com/v3/select/hero"
./post文件内容格式 openUuid=YY0202&skinId=song_002&heroId=1
  • QPS(TPS)= 并发数/平均响应时间
  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值