分享web开发知识

注册/登录|最近发布|今日推荐

主页 IT知识网页技术软件开发前端开发代码编程运营维护技术分享教程案例
当前位置:首页 > 运营维护

webbench压力测试部署步骤

发布时间:2023-09-06 02:05责任编辑:郭大石关键词:压力测试

以centos系统为例:

[root@ProEIM guest]# yum install -y gcc ctags

[root@ProEIM guest]# wget http://www.ha97.com/code/webbench-1.5.tar.gz

[root@ProEIM guest]# tar -xvf webbench-1.5.tar.gz

 [root@ProEIM guest]#cd  webbench-1.5

[root@ProEIM 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


[root@ProEIM webbench-1.5]# mkdir /usr/local/man
[root@ProEIM webbench-1.5]# mkdir /usr/local/man/man1
[root@ProEIM 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
[root@ProEIM webbench-1.5]# we
weak-modules ?webbench ?????webmail.ddl

#查看帮助信息
[root@ProEIM 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秒。

[root@ProEIM 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压力测试部署步骤

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

知识推荐

我的编程学习网——分享web前端后端开发技术知识。 垃圾信息处理邮箱 tousu563@163.com 网站地图
icp备案号 闽ICP备2023006418号-8 不良信息举报平台 互联网安全管理备案 Copyright 2023 www.wodecom.cn All Rights Reserved