tofacebook.com -专业IT技术社区 【百家号】脸书百科,webbench压力测试部署步骤 [email protected] [email protected] [email protected] Web程序 - tofacebook.com-专业IT技术社区
71°

【百家号】脸书百科,webbench压力测试部署步骤 [email protected] [email protected] [email protected] Web程序

标签:load   benchmark   force   col   gcc   http   baidu   protoc   wal   

以centos系统为例:

 

[[email protected] guest]# yum install -y gcc ctags

[[email protected] guest]# wget http://www.ha97.com/code/webbench-1.5.tar.gz

[[email protected] guest]# tar -xvf webbench-1.5.tar.gz

 [[email protected] guest]#cd  webbench-1.5

[[email protected] webbench-1.5]# make && make install

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
install -s webbench /usr/local/bin
install -m 644 webbench.1 /usr/local/man/man1
install: cannot create regular file `/usr/local/man/man1‘: No such file or directory
make: *** [install] Error 1


[[email protected] webbench-1.5]# mkdir /usr/local/man
[[email protected] webbench-1.5]# mkdir /usr/local/man/man1
[[email protected] webbench-1.5]# make &&make install
make: Nothing to be done for `all‘.
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
[[email protected] webbench-1.5]# we
weak-modules webbench webmail.ddl

#查看帮助信息
[[email protected] webbench-1.5]# webbench --     
webbench: Missing URL!
webbench [option]... URL
-f|--force Don‘t wait for reply from server.
-r|--reload Send reload request - Pragma: no-cache.
-t|--time <sec> Run benchmark for <sec> seconds. Default 30.
-p|--proxy <server:port> Use proxy server for request.
-c|--clients <n> Run <n> HTTP clients at once. Default one.
-9|--http09 Use HTTP/0.9 style requests.
-1|--http10 Use HTTP/1.0 protocol.
-2|--http11 Use HTTP/1.1 protocol.
--get Use GET request method.
--head Use HEAD request method.
--options Use OPTIONS request method.
--trace Use TRACE request method.
-?|-h|--help This information.
-V|--version Display program version.

#使用此工具模拟对一个项目进行压测,使用两个参数 c 并发客户端数,t 运行时长,我们来对http://www.baidu.com 做压测看测试报告内容

执行命令:webbench -c 10 -t 30 http://www.baidu.com/   其中-c 为指定终端数量,-t为运行时间。即为10个终端并发访问百度网址30秒。

[[email protected] webbench-1.5]# webbench -c 10 -t 30 http://www.baidu.com/
Webbench - Simple Web Benchmark 1.5
Copyright (c) Radim Kolar 1997-2004, GPL Open Source Software.

Benchmarking: GET http://www.baidu.com/
10 clients, running 30 sec.

Speed=534 pages/min, 1068835 bytes/sec.
Requests: 267 susceed, 0 failed.

#上述红色字体为此轮运行结果。

webbench压力测试部署步骤

标签:load   benchmark   force   col   gcc   http   baidu   protoc   wal   

原文地址:https://www.cnblogs.com/ddpeng/p/9368095.html


本文由百家号/熊掌号作者上传并发布,百家号仅提供信息发布平台。文章仅代表作者个人观点,不代表百度立场。