- wget http://blog.s135.com/soft/linux/webbench/webbench-1.5.tar.gz
- tar zxvf webbench-1.5.tar.gz
- cd webbench-1.5
- make && make install
- [[email protected]]# 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
- /bin/sh: ctags: command not found
- make: [tags] Error 127 (ignored)
是没安装ctags组件,使用yum -y install ctags,yun install gcc 解决问题
mkdir -m 644 -p /usr/local/man/man1
webbench -c 500 -t 30 http://127.0.0.1/test.jpg
数说明:-c表示并发数,-t表示时间(秒)
测试结果示例:
[html] view plaincopy
- Webbench - Simple Web Benchmark 1.5
- Copyright (c) Radim Kolar 1997-2004, GPL Open Source Software.
- Benchmarking: GET http://127.0.0.1/test.jpg
- 500 clients, running 30 sec.
- Speed=3230 pages/min, 11614212 bytes/sec.
- Requests: 1615 susceed, 0 failed.
每秒钟响应请求数:3230/60= X pages/sec,每秒钟传输数据量11614212 bytes/sec。
当并发1615时,已经显示有0个连接failed了,说明未负荷了。
时间: 2024-10-28 08:19:22