日韩av黄I国产麻豆传媒I国产91av视频在线观看I日韩一区二区三区在线看I美女国产在线I麻豆视频国产在线观看I成人黄色短片

歡迎訪問 生活随笔!

生活随笔

當前位置: 首頁 >

软件压力测试linux服务器,使用http_load来给Linux系统的服务器做压力测试

發布時間:2024/10/8 52 豆豆
生活随笔 收集整理的這篇文章主要介紹了 软件压力测试linux服务器,使用http_load来给Linux系统的服务器做压力测试 小編覺得挺不錯的,現在分享給大家,幫大家做個參考.

介紹個http_load壓力測試工具,http_load,類似的工具還有webbench、ab、Siege。

1、下載

官方網站:http://acme.com/software/http_load/

復制代碼代碼如下:

cd /root

wget http://acme.com/software/http_load/http_load-12mar2006.tar.gz

tar xzf http_load-12mar2006.tar.gz

2、安裝

復制代碼代碼如下:

cd http_load-12mar2006

make

執行完make,會在當前目錄生成一個http_load二進制文件。

3、使用方法

復制代碼代碼如下:

root@www:~/http_load-12mar2006# ./http_load --help

usage: ./http_load [-checksum] [-throttle] [-proxy host:port] [-verbose] [-timeout secs] [-sip sip_file]

-parallel N | -rate N [-jitter]

-fetches N | -seconds N

url_file

One start specifier, either -parallel or -rate, is required.

One end specifier, either -fetches or -seconds, is required.

主要參數說明:

-parallel 簡寫-p :含義是并發的用戶進程數。

-rate 簡寫-r :含義是每秒的訪問頻率

-fetches 簡寫-f :含義是總計的訪問次數

-seconds簡寫-s :含義是總計的訪問時間

選擇參數時,-parallel和-rate選其中一個,-fetches和-seconds選其中一個。

示例:

http_load -parallel 50 -s 10 urls.txt

這段命令行是同時使用50個進程,隨機訪問urls.txt中的網址列表,總共訪問10秒。

http_load -rate 50 -f 5000 urls.txt

每秒請求50次,總共請求5000次停止。

4、基本的返回值

(1).49 fetches, 2 max parallel, 289884 bytes, in 10.0148 seconds

說明在上面的測試中運行了49個請求,最大的并發進程數是2,總計傳輸的數據是289884bytes,運行的時間是10.0148秒

(2).5916 mean bytes/connection

說明每一連接平均傳輸的數據量289884/49=5916

(3).4.89274 fetches/sec, 28945.5 bytes/sec

說明每秒的響應請求為4.89274,每秒傳遞的數據為28945.5 bytes/sec

(4).msecs/connect: 28.8932 mean, 44.243 max, 24.488 min

說明每連接的平均響應時間是28.8932 msecs,最大的響應時間44.243 msecs,最小的響應時間24.488 msecs

(5).msecs/first-response: 63.5362 mean, 81.624 max, 57.803 min

(6).HTTP response codes: code 200 -- 49

說明打開響應頁面的類型,如果403的類型過多,那可能要注意是否系統遇到了瓶頸。

特殊說明:這里,我們一般會關注到的指標是fetches/sec、msecs/connect

他們分別對應的常用性能指標參數Qpt-每秒響應用戶數和response time,每連接響應用戶時間。測試的結果主要也是看這兩個值。當然僅有這兩個指標并不能完成對性能的分析,我們還需要對服務器的cpu、men進行分析,才能得出結論

5、如果你需要測試https,你必須將 Makefile中

復制代碼代碼如下:

# CONFIGURE: If you want to compile in support for https, uncomment these

# definitions. You will need to have already built OpenSSL, available at

# http://www.openssl.org/ Make sure the SSL_TREE definition points to the

# tree with your OpenSSL installation - depending on how you installed it,

# it may be in /usr/local instead of /usr/local/ssl.

SSL_TREE = /usr

SSL_DEFS = -DUSE_SSL

SSL_INC = -I$(SSL_TREE)/include

SSL_LIBS = -L$(SSL_TREE)/lib -lssl -lcrypto

由于使用到openssl,你必須安裝openssl和相應的開發環境

復制代碼代碼如下:

apt-get install openssl

apt-get install libssl-dev

find -name ssl.h

/usr/include/openssl/ssl.h

所以上面紅色字體部分必須修改

總結

以上是生活随笔為你收集整理的软件压力测试linux服务器,使用http_load来给Linux系统的服务器做压力测试的全部內容,希望文章能夠幫你解決所遇到的問題。

如果覺得生活随笔網站內容還不錯,歡迎將生活随笔推薦給好友。