“关于压力测试和并发的那些事儿”的版本间的差异
跳到导航
跳到搜索
(→ab) |
(→ab) |
||
第108行: | 第108行: | ||
</pre> | </pre> | ||
[https://www.jianshu.com/p/3afa6ecca808 ab压测] | [https://www.jianshu.com/p/3afa6ecca808 ab压测] | ||
+ | |||
+ | [https://www.cnblogs.com/linjiqin/p/9058432.html 网站性能压力测试工具--apache ab使用详解] | ||
===siege === | ===siege === |
2021年4月24日 (六) 08:49的版本
目录
start
首先是基本知识点
这两个比较偏向web 测试
并发承载
10W 活跃用户 访问4个页面 一次页面加3次接口 10w*4*4 =160W 一般人睡觉8个小时 so 一天 24-8=16h 10W日活 * 4次访问数*每次4个接口或者页面 = 160W 16h*60min*60s= 57 600 s 160w/57600=28QPS OR TPS 真实情况下 5 分钟内的活跃用户为1000 100*4*4=1600 1600/(5*6)=53QPS 反来说 如果一个系统的qps 100 一天能顶的访问量为 100*60*60*24=8 640 000 也就是864W ps TPS:Transactions Per Second(每秒传输的事物处理个数) QPS(TPS):每秒钟 request/事务 数量,在互联网领域,指每秒响应请求数(指http请求)
常用的压力测试工具
ab
ab 参数有时比较 搞笑 10000 请求100并发 ab -n 10000 -c 100 ip Usage: ab [options] [http[s]://]hostname[:port]/path ab -n 100 -c 10 http://192.168.88.173/index.html ab -n 1000 -c 1000 http://192.168.88.173/index.html 可能就动不了了 ab -n 10000 -c 10000 http://192.168.88.173/index.html eg # ab -n 1000 -c 1000 http://192.168.88.173/index.html This is ApacheBench, Version 2.3 <$Revision: 1879490 $> Copyright 1996 Adam Twiss, Zeus Technology Ltd, http://www.zeustech.net/ Licensed to The Apache Software Foundation, http://www.apache.org/ Benchmarking 192.168.88.173 (be patient) Completed 100 requests Completed 200 requests Completed 300 requests Completed 400 requests Completed 500 requests Completed 600 requests Completed 700 requests Completed 800 requests Completed 900 requests Completed 1000 requests Finished 1000 requests Server Software: Apache Server Hostname: 192.168.88.173 Server Port: 80 Document Path: /index.html Document Length: 196 bytes Concurrency Level: 1000 Time taken for tests: 0.404 seconds Complete requests: 1000 Failed requests: 0 Non-2xx responses: 1000 Total transferred: 360000 bytes HTML transferred: 196000 bytes Requests per second: 2473.61 [#/sec] (mean) Time per request: 404.268 [ms] (mean) Time per request: 0.404 [ms] (mean, across all concurrent requests) Transfer rate: 869.63 [Kbytes/sec] received Connection Times (ms) min mean[+/-sd] median max Connect: 1 26 23.5 18 75 Processing: 13 170 108.4 234 323 Waiting: 1 170 108.5 234 323 Total: 14 196 128.7 246 392 Percentage of the requests served within a certain time (ms) 50% 246 66% 279 75% 300 80% 312 90% 369 95% 380 98% 387 99% 389 100% 392 (longest request)
siege
可能得修改一下配置 siege -c 2000 -t 60s http:192.168.88.173 ================================================================ WARNING: The number of users is capped at 255. To increase this limit, search your .siegerc file for 'limit' and change its value. Make sure you read the instructions there... ================================================================ vim .siege/siege.conf # ex: limit = 1023 (default is 255) # limit = 2559 100并发 30s siege -c 100 -t 30s http:ip wrk 可以lua脚本 4个线程 wrk -c 100 -d 30s -t 4 ip
https://askubuntu.com/questions/932449/siege-cannot-perform-load-testing-for-more-than-255-tests
介绍几款Web服务器性能压力测试工具ApacheBench(ab) Siege详解
Web服务器性能/压力测试工具http_load、webbench、ab、Siege使用教程