1、下载webbench包;
2、下载完毕后,在linux中安装
[email protected]:~/software# tar xvzf webbench-1.5.tar.gz
[email protected]:~/software/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 //如果此处报错:解决方法是安装ctags,安装方法见后面
[email protected]:~/software/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
[email protected]:~/software/webbench-1.5#
[email protected]:~/software/webbench-1.5# webbench webs
ctags安装方式:
解压后
$ cd ctags-5.8
$ ./configure
$ make
# make install
ctags安装好之后,继续make,此时就不会报错,然后make install时可能也会报错,如下图:
解决方式如下:
[[email protected] webbench-1.5]# mkdir /usr/local/man
[[email protected] webbench-1.5]# make && make install
[[email protected] webbench-1.5]# webbench -c 500 -t 30 http://127.0.0.1/index.html
结果:
Webbench - Simple Web Benchmark 1.5
Copyright (c) Radim Kolar 1997-2004, GPL Open Source Software.
Benchmarking: GET http://127.0.0.1/phpinfo.php
500 clients, running 30 sec.
Speed=10052 pages/min, 7572446 bytes/sec.
Requests: 5026 susceed, 0 failed.