Weighttp 地址 http://redmine.lighttpd.net/projects/weighttp/wiki

Weighttp的介绍:weighttp  is 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

weighttp 使用的更多相关文章

  1. Lua入门记录

    学习资料 Lua入门和Lua高阶章节 Lua中文文档 阅读笔记,只是记录了知识点和一些注意点,详细的看上面提供的学习资料链接 Lua 基础数据类型 nil(空) boolean(布尔) Lua 中 n ...

  2. Error While Loading Shared Libraries, Cannot Open Shared Object File

    In the "I wish the Internet had an actual correct answer" category comes a question from a ...

随机推荐

  1. Java编程思想 4th 第3章 操作符

    有了数据,还需要进行数据间的运算,因此Java中也有数据间运算的各种符号,书本称之为操作符,正确的翻译应该是运算符. Java中的运算符同C++相同,运算符同运算符对象构成表达式,表达式是运算对象及运 ...

  2. 【codeforces】【比赛题解】#872 CF Round #440 (Div.2)

    链接. [A]寻找漂亮数字 题意: 给定了两列非零数字.我们说一个数是漂亮的,当它的十进制表达中有至少一个数从数列一中取出,至少有一个数从数列二中取出.最小的漂亮数字是多少? 输入: 第一行两个数\( ...

  3. Count of Smaller Number before itself

    Give you an integer array (index from 0 to n-1, where n is the size of this array, value from 0 to 1 ...

  4. from setuptools import setup ImportError: No module named setuptools【转】

    转自:http://www.cnblogs.com/chinacloud/archive/2010/12/24/1915644.html from setuptools import setupImp ...

  5. 虚拟环境pipenv的使用

    安装虚拟环境 安装python3.6 python -m site --user-base 找到 用户基础目录 指定python版本的方式 pipenv --python 3.8 安装 用户范围内安装 ...

  6. 十、springcloud之Consul注销实例

    @Autowired //com.ecwid.consul.v1.ConsulClient private ConsulClient consulClient; @PostMapping(" ...

  7. docker stack 部署 mysql 5.6

    =============================================== 2018/7/1_第1次修改                       ccb_warlock === ...

  8. Python模块:Random(未完待续)

    本文基于Python 3.6.5的官文random编写. random模块简介 random为各种数学分布算法(distributions)实现了伪随机数生成器. 对于整数,是从一个范围中均匀选择(u ...

  9. day10作业

    1.Java中,用{}括起来的代码称为代码块. 代码块分为局部代码块,构造代码块,静态代码块,同步代码块 局部代码块:在方法中出现,限定生命周期,及早释放,提高内存利用率 构造代码块:在类中方法外出现 ...

  10. git —— 异常1,index.lock

    git提交过程中出现的问题 解决方法:找到 index.lock文件将其删除 一般 index.lock 在.git下面, 有时 .git 是隐藏的,但是无论怎样, 可以通过 everything 找 ...