CentOS7單獨安裝Apache Bench壓力測試工具

用於併發測試。apache

1.安裝centos

# need to run ab,apache portable runtime
yum install apr-util

# 
yum install yum-utils

# 建立一個臨時目錄
mkdir /opt/ad_tmp
cd /opt/ad_tmp

# 下載rpm包
yumdownloader httpd-tools

# 從RPM文件中提取文件
rpm2cpio httpd-tools-2.4.6-88.el7.centos.x86_64.rpm | cpio -idmv

# 
mv usr/bin/ab /usr/bin/ab

cd /opt

# 刪除臨時目錄
rm -rf ad_tmp

2.使用語法服務器

-n requests Number of requests to perform
-c concurrency Number of multiple requests to make併發

下面的命令表示一共有100個請求,也就是服務器接收到的請求一共有100次,ab分兩批發起請求,每次的併發量爲50。測試

相關文章
相關標籤/搜索