webBenchmark

wget https://github.com/maintell/webBenchmark/releases/download/0.5/webBenchmark_linux_x64

chmod +x webBenchmark_linux_x64

开始测压:

官网命令
./webBenchmark_linux_x64 -c [COUNT] -s [URL] -r [REFERER]

-c int
      concurrent routines for download (default 16)
      下载线程数,默认16线程
-r string
      referer url
      从哪里跳转到该网站,这个主要针对设置了防盗链的资源
-s string
      target url (default "https://baidu.com")
      压力测试目标网址
-i string
      custom ip address for that domain, multiple addresses automatically will be assigned randomly
      网站IP,指定网站IP即使套了CDN,数据包也不会经过CDN而是直接到源站
-H http header pattern
      http header pattern, use Random with number prefix will generate random string, same key will be overwritten
-f string
      randomized X-Forwarded-For and X-Real-IP address
-p string
      post content
./webBenchmark_linux_x64 -c 512 -s http://xxx

AB软件

安装

yum -y install httpd-tools
ab -c 10 -n 100 http://a.ilanni.com/index.php

-c10表示并发用户数为10

-n100表示请求总数为100

Last modification:March 27, 2023
如果觉得我的文章对你有用,请随意赞赏