web壓力測試-Web Bench,壓力測試-webbench

來源:互聯網
上載者:User

web壓力測試-Web Bench,壓力測試-webbench

1.web bench下載,地址:http://home.tiscali.cz/~cz210552/webbench.html

2.wen bench安裝

[root@web111 tmp]#tar -zxvf webbench-1.5.tar.gz

[root@web111 tmp]# cd webbench-1.5

[root@vstar111 webbench-1.5]# ll
total 28
lrwxrwxrwx 1 1001 root    16 Nov 15 10:45 ChangeLog -> debian/changelog
lrwxrwxrwx 1 1001 root    16 Nov 15 10:45 COPYRIGHT -> debian/copyright
drwxr-xr-x 2 1001 root  4096 Jun 25  2004 debian
-rw-r--r-- 1 1001 1001  1063 Jun 25  2004 Makefile
-rw-r--r-- 1 1001 1001  1491 Jan 12  2004 socket.c
-rw-r--r-- 1 1001 1001  2411 Jan 14  2004 webbench.1
-rw-r--r-- 1 1001 1001 10978 Jun 25  2004 webbench.c

[root@web111 webbench-1.5]# make
cc -Wall -ggdb -W -O   -c -o webbench.o webbench.c
webbench.c: In function ‘alarm_handler’:
webbench.c:77: warning: unused parameter ‘signal’
cc -Wall -ggdb -W -O  -o webbench webbench.o  
ctags *.c
[root@web111 webbench-1.5]# make install
install -s webbench /usr/local/bin
install -m 644 webbench.1 /usr/local/man/man1
install -d /usr/local/share/doc/webbench
install -m 644 debian/copyright /usr/local/share/doc/webbench
install -m 644 debian/changelog /usr/local/share/doc/webbench

至此,安裝完成

3.使用

[root@web111 webbench-1.5]# man webbench

裡面有具體的文法,參數等詳細資料

測試1:1024次

[root@web111 webbench-1.5]# webbench -c 1024 http://10.244.170.110/
Webbench - Simple Web Benchmark 1.5
Copyright (c) Radim Kolar 1997-2004, GPL Open Source Software.

Benchmarking: GET http://10.244.170.110/
1024 clients, running 30 sec.
Speed=103590 pages/min, 537553 bytes/sec.
Requests: 51795 susceed, 0 failed.

測試2:10240次

[root@web111 webbench-1.5]# webbench -c 10240 http://10.244.170.110/
Webbench - Simple Web Benchmark 1.5
Copyright (c) Radim Kolar 1997-2004, GPL Open Source Software.


Benchmarking: GET http://10.244.170.110/
1024 clients, running 30 sec.

Speed=93646 pages/min, 482920 bytes/sec.
Requests: 46559 susceed, 264 failed.

對比2次測試結果,發現,第二次,速度慢,且失敗次數大大增加;

查看zabbix監控,比對CPU,測試的時候cpu使用率很高!多次測試後,發現大量的測試佔用記憶體較高,導致伺服器直接重啟了

copy別人的測試基準:

1、壓力測試工作應該放到產品上線之前,而不是上線以後 ;

2、測試的時候,最好把測試機的監控都開啟;

3、測試時盡量跨公網進行,而不是內網;

4、測試時並發應當由小逐漸加大,比如並發100時觀察一下網站負載是多少、開啟是否流暢,並發200時又是多少、網站開啟緩慢時並發是多少、網站打不開時並發又是多少 

5、 應盡量進行單元測試,如B2C網站可以著重測試購物車、推廣頁面等,因為這些頁面占整個網站訪問量比重較大





聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.