autobench快速入門

2021-06-08 17:41:52 字數 2063 閱讀 6863

前言

我們經常會用loadrunner來做效能測試,但有時候loadrunner沒法完成一些效能測試,這時候就需要其他工具了,今天就給大家介紹乙個autobench。簡介

autobench 是一款基於httperf的perl指令碼。它會在一次測試中呼叫多次httperf來對web伺服器進行測試,每次會按照給定的引數增加併發連線數,將httperf的測試結果儲存為csv格式的檔案,該檔案可以被excel直接讀取,方便生成測試報告。借助於autobench自帶的bench2graph工具可以生成漂亮的測試結果對比圖。

1、先安裝httperf

2、安裝gnuplot

tar xvzf gnuplot-4.2.0.tar.gz

cd gnuplot-4.2.0

./configure

make && make install

cp /usr/local/bin/bench2graph /usr/local/bin/bench2png

sed -i 's/postscript color/png xffffff/g' /usr/local/bin/bench2png

注意這裡一定要開啟:echo set data style linespoints >> gnuplot.cmd

3、安裝autobench

tar xvzf autobench-2.1.2.tar.gz

cd autobench-2.1.2

make && make install

4、使用

4.1 測試單台主機

./autobench \

--single_host \

--host1=your_ip \

--port1=80 \

--uri1=/home/www/mysql_con.php \

--quiet \

--low_rate=5 \

--high_rate=100 \

--rate_step=5 \

--num_call=5 \

--num_conn=1000 \

--timeout=10 \

--file /tmp/con_results.tsv

4.2 測試多台機器

./autobench \

--host1=your_ip1 \

--port1=80 \

--uri1=/home/www/mysql_con.php \

--host2=your_ip2 \

--port2=80 \

--uri2=/home/www/mysql_pcon.php \

--quiet \

--low_rate=5 \

--high_rate=100 \

--rate_step=5 \

--num_call=5 \

--num_conn=1000 \

--timeout=10 \

--file /tmp/results.tsv

4.3 引數含義

--signle_host 只測單機

--host1 測試主機位址

--uri1 host1 測試uri

--quiet 安靜模式

--low_rate 測試時最低請求數(指 httperf)

--hight_rate 測試時最高請求數

--rate_step 每次測試請求數增加步長

--num-call 同httperf

--num_conn 同httperf

--file 測試結果輸出的 tsv檔案

4.4 生成

5、參考文章

man/autobench.html#index

autobench快速入門

前言 我們經常會用loadrunner來做效能測試,但有時候loadrunner沒法完成一些效能測試,這時候就需要其他工具了,今天就給大家介紹乙個autobench。簡介 autobench 是一款基於httperf的perl指令碼。它會在一次測試中呼叫多次httperf來對web伺服器進行測試,每...

AutoBench的使用分析

本實驗中,我將使用autobench來進行web服務端的效能測試,借助於httperf來實現集群測試。本文接著上篇文章中的測試url來進行分析autobench的測試過程。首先我們建立測試的命令列如下 autobench single host host1 127.0.0.1 port1 8081 ...

Flask入門二 快速入門

from flask import flask 路由裝飾器 defhello world 檢視函式 return hello world 返回乙個字串 if name main 把程式儲存為hello.py 用python直譯器執行 python hello.py running on訪問 會看見 ...