Apache Benchmark 使用

0. 简介

apache benchmark 是 apache http 对应的压力检查工具,它不仅可以对 http 服务器进行网站压力测试,也可对其他类型的服务器进行压力测试,如 nignx, tomcat,iis 等服务器

1. 安装

windows:从 apache 官网下载对应的 apache 安装包即可,里面包含对应的 ab.exe
centos:yum install httpd-tools
ubuntu:apt install apache2-utils

2. 使用

  • 参数
    -n 发送请求的总次数
    -c 同一时间每次并发的请求数
    -t 请求持续时间
    -s 每个请求的延时,默认30秒
    -b 每次tcp接受的缓存大小
  • 实例
    ab -n 1000 -c 100 -t 60 -s 10 http://baidu.com/

你可能感兴趣的:(Apache Benchmark 使用)