“关于压力测试和并发的那些事儿”的版本间的差异

来自linux中国网wiki
跳到导航 跳到搜索
(未显示同一用户的1个中间版本)
第34行: 第34行:
 
</pre>
 
</pre>
 
==常用的压力测试工具==
 
==常用的压力测试工具==
 +
===ab===
 
<pre> ab  参数有时比较 搞笑
 
<pre> ab  参数有时比较 搞笑
 
  10000 请求100并发
 
  10000 请求100并发
第43行: 第44行:
  
 
ab -n 1000  -c 1000  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
 
   
 
   
 
  </pre>
 
  </pre>
第77行: 第81行:
  
 
</pre>
 
</pre>
 +
 +
https://askubuntu.com/questions/932449/siege-cannot-perform-load-testing-for-more-than-255-tests
  
  

2021年4月24日 (六) 07:57的版本

start

首先是基本知识点

系统吞吐量(TPS)、用户并发量、性能测试概念和公式


这两个比较偏向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
 
 

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使用教程

如果你是 windows .net 请用

如何测试一个网站的性能(并发数)

ASP.NET压力测试

如何对Asp.Net网站做并发测试?

参考

如何测试一个web网站的性能(并发数)?

早知道早幸福——从压测工具谈并发、压力、吞吐量

如何估算网站日承受最大访问PV