weighttp 使用
2016-01-03 12:57
1156 查看
Weighttp 地址 http://redmine.lighttpd.net/projects/weighttp/wiki
Weighttp的介绍:
weighttpis a lightweight and small benchmarking tool for webservers。Weighttp只支持HTTP协议的一小部分,因此精艺、简单,使用起来也非常容易、快速。支持多线程,异步IO。
Weighttp的事件驱动依靠libev,支持高性能接口:epoll or kqueue等。
安装
Weighttp安装需要libev,找一个libev-4.04.tar.gz包,解压,configure,make,install就可以了,安装之后最好将库添加到系统链接库中
#yum install libev
或
#wget http://dist.schmorp.de/libev/libev-4.22.tar.gz
[root@localhost ]# echo "/usr/local/lib" >> /etc/ld.so.conf [root@localhost ]# /sbin/ldconfig
现在开始编译安装Weighttp
tar zxvf weighttp-master.tar.gz cd weighttp-master ./waf configure ./waf build ./waf install
在任何目录下都可运行直接运行命令:weighttp
[root@server1 ~]# weighttp weighttp - a lightweight and simple webserver benchmarking tool error: missing url argument weighttp <options> <url> -n num number of requests (mandatory) 请求数量 -t num threadcount (default: 1)线程数量 -c num concurrent clients (default: 1)并发用户数量 -k keep alive (default: no)长连接,默认短连接 -6 use ipv6 (default: no)Ip6 -H str add header to request 增加消息头Header -h show help and exit -v show version and exit example: weighttpd -n 10000 -c 10 -t 2 -k -H "User-Agent: foo" localhost/index.html
Weighttp使用示例
在本机启动一个Web服务器,用Weighttp进行测试,我用的是Jetty7.4
[root@server1 ~]#weighttp -n 1 -k http://192.168.30.13:8080/hello weighttp - a lightweight and simple webserver benchmarking tool starting benchmark... spawning thread #1: 1 concurrent requests, 1 total requests progress: 100% done finished in 0 sec, 204 millisec and 32 microsec, 4 req/s, 0 kbyte/s requests: 1 total, 1 started, 1 done, 1 succeeded, 0 failed, 0 errored status codes: 1 2xx, 0 3xx, 0 4xx, 0 5xx traffic: 191 bytes total, 141 bytes http, 50 bytes data
几个与Weighttp相似的工具:apache ab,httperf,httpress
相关文章推荐
- 使用tapestry-prop提高Tapestry运行效率
- pcap_sf结构(libpcap使用总结)
- 在.NET 中使用WIN32 API的宝库
- Eclips使用秘技简述
- 使用def文件却倒不出函数的解决方法
- SDL使用触屏模拟鼠标点击事件
- 使用jsp+JavaBean简单实现计算器
- 【转】GNU Screen的使用方法
- Android Handler的使用
- jquery.autocomplete的使用
- asp.net开发使用Js读取word
- 在使用Math.random()生成6位随机数遇到的问题,并成功得到6位随机数
- 关于cvCreateTrackbar()使用
- all 、any 、some的使用
- 使用mysql函数实现多步查询中的回滚操作
- centos 使用vsftpd问题
- (转)Preference的使用
- 智能搜索jquery-autocomplete 自动填充插件使用方法及参数使用说明
- emlog发布模块如何使用?
- 使用text-overflow:ellipsis对溢出文本显示省略号