一.webbench简单介绍
Webench是一款轻量级的网站测压工具,最多可以对网站模拟3w左右的并发请求,可以控制时间、是否使用缓存、是否等待服务器回复等等,且对中小型网站有明显的效果,基本上可以测出中小型网站的承受能力,对于大型的网站,如百度、淘宝这些巨型网站没有意义,因为其承受能力非常大。同时测试结果也受自身网速、以及自身主机的性能与内存的限制,性能好、内存大的主机可以模拟的并发就明显要多。
Webbench能测试处在相同硬件上,不同服务的性能以及不同硬件上同一个服务的运行状况。webbench的标准测试可以向我们展示服务器的两项内容:每秒钟相应请求数和每秒钟传输数据量。webbench不但能具有便准静态页面的测试能力,还能对动态页面(ASP,PHP,JAVA,CGI)进 行测试的能力。还有就是他支持对含有SSL的安全网站例如电子商务网站进行静态或动态的性能测试。
Webbench最多可以模拟3万个并发连接去测试网站的负载能力。
二.Webbench实现的核心原理
Webbench实现的核心原理是:父进程fork若干个子进程,每个子进程在用户要求时间或默认的时间内对目标web循环发出实际访问请求,父子进程通过管道进行通信,子进程通过管道写端向父进程传递在若干次请求访问完毕后记录到的总信息,父进程通过管道读端读取子进程发来的相关信息,子进程在时间到后结束,父进程在所有子进程退出后统计并给用户显示最后的测试结果,然后退出。
三.安装
wget wget http://www.ha97.com/code/webbench-1.5.tar.gz
tar xf webbench-1.5.tar.gz
yum install gcc* ctags* -y
make && make install
命令:webbench -c 300 -t 60 http://baidu.com/
Comments | 28 条评论
If you want to use the photo it would also be good to check with the artist beforehand in case it is subject to copyright. Best wishes. Aaren Reggis Sela
Thank you ever so for you article post. Much thanks again. Keep writing. Allie Derk Clifford
You completed several nice points there. I did a search on the issue and found the majority of folks will consent with your blog. Verene Aldwin Felice
I am in fact thankful to the owner of this web site who has shared this enormous piece of writing at at this time. Ardath Byram Meras
Greate article. Keep posting such kind of info on your blog. Lynnette Abel Margret
Im grateful for the article. Really looking forward to read more. Fantastic. Kial Clevie Olympias
My name is Albert. And I am a professional academic writer with many years of experience in writing. Devondra Denver Zeralda
I was examining some of your articles on this website and I think this site is rattling informative ! Keep on putting up. Maggee Justinian Oneal
I want to be with you, even if it is a headless and tailless farce, hold a small lamp and stand in the memory waiting for you. Lexie Malcolm Royo
This is a same important post. Thanks quest of posting this. Lonni Gaspard Vachil
Well I really liked reading it. This information offered by you is very helpful for correct planning. Amanda Etan Chavez
I was looking through some of your articles on this site and I believe this internet site is very instructive! Keep on putting up. Shoshanna Stan Keithley
Hello! I could have sworn I’ve been to this blog before but after browsing through some of the post I realized it’s new to me. Anyways, I’m definitely happy I found it and I’ll be book-marking and checking back frequently!
Hello! I could have sworn I’ve been to this blog before but after browsing through some of the post I realized it’s new to me. Anyways, I’m definitely happy I found it and I’ll be book-marking and checking back frequently!
You made some nice points there. I looked on the internet for the subject matter and found most individuals will agree with your site.
I read a great article with pleasure, I hope it will continue
I am thinking of visiting your website again Thanks
It was very useful, I can say it was a useful article for me.
Very informative blog article.Much thanks again. Fantastic.
Robot is the best solution for everyone who wants to earn.
Link – https://24crypto.de/deposit-btc-into-cryptopia.php
I loved your blog.Really looking forward to read more. Will read on…
Wow, great blog article.Really thank you! Really Great.
Awesome article post.Much thanks again.
I loved your blog.Really looking forward to read more. Will read on…
Thanks again for the article. Really Cool.
I love surfing on your pleasant site
I get very useful information on your page, I feel lucky
I must say I read a great article with pleasure