参考:https://www.cnblogs.com/flkin/p/ab_wrk.html
https://www.jianshu.com/p/5f5008250137
###1、ab
https://blog.csdn.net/foreverling_ling/article/details/81667857
https://blog.csdn.net/foreverling_ling/article/details/81667857
1、get
ab -n 100 -c 10 http://test_url
abs -n 1 -c 1 “https://blog.csdn.net/”
# -n 表示请求数,-c 表示并发数. -t 表示多少s内并发和请求
ab:http请求
abs:https请求
-n:测试几次
-c: 模拟多少客户端
-T:内容类型。这个一般和-p 一起使用
-p:包含POST参数的文件
2、post
abs -n 1 -c 1 -p post.txt -T application/x-www-form-urlencoded “https://blog.csdn.net”
post参数写在了post.txt中,post.txt放在ab.exe同一目录下
2、wrk
https://github.com/wg/wrk
与 ab 的区别是 wrk 可以指定持续压测的时间
wrk -t 2 -c 6 -d 5s https://www.baidu.com
开2个线程,建立6个连接,持续请求百度5s