• weighttp 使用


    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

  • 相关阅读:
    一起谈.NET技术,.NET分布式架构开发实战之一 故事起源 狼人:
    JS替换节点
    mysql数据库的简单语句的介绍(1)
    JS对img进行操作
    POJ 1006 Biorhythms 数论(孙子定理)
    Tomcat与Jetty插件 配置根路径指定项目
    [置顶] cocos2dx 2.x版本之win32 window移植android 环境搭配 只用NDK 超级详细 android 环境搭配
    调频广播六十年
    ajax两个网页实现完美的 分页功能
    Cocos2dX数据、动作、消息的基本操作
  • 原文地址:https://www.cnblogs.com/jking10/p/5096120.html
Copyright © 2020-2023  润新知