码迷,mamicode.com
首页 > Web开发 > 详细

WebBench源码分析

时间:2015-05-05 23:15:26      阅读:196      评论:0      收藏:0      [点我收藏+]

标签:

源码分析共享地址:https://github.com/fivezh/WebBench

下载源码后编译源程序后即可执行:

sudo make clean

sudo make & make install

 

1. 使用方法

five@master:~/github/OpenCCode/WebBench$ ./webbench 
webbench [option]... URL
  -f|--force               Dont wait for reply from server.
  -r|--reload              Send reload request - Pragma: no-cache.
  -t|--time <sec>          Run benchmark for <sec> seconds. Default 30.
  -p|--proxy <server:port> Use proxy server for request.
  -c|--clients <n>         Run <n> HTTP clients at once. Default one.
  -9|--http09              Use HTTP/0.9 style requests.
  -1|--http10              Use HTTP/1.0 protocol.
  -2|--http11              Use HTTP/1.1 protocol.
  --get                    Use GET request method.
  --head                   Use HEAD request method.
  --options                Use OPTIONS request method.
  --trace                  Use TRACE request method.
  -?|-h|--help             This information.
  -V|--version             Display program version.

 

实例:./webbench -t 10 -c 50 http://www.baidu.com/

five@master:~/github/OpenCCode/WebBench$ ./webbench -t 10 -c 50 http://www.baidu.com/
Webbench - Simple Web Benchmark 1.5
Copyright (c) Radim Kolar 1997-2004, GPL Open Source Software.

Benchmarking: GET http://www.baidu.com/
50 clients, running 10 sec.

Speed=492 pages/min, 918494 bytes/sec.
Requests: 82 susceed, 0 failed.

 

2. 源码分析

 

知识点1:

volatile用法,

参考:

http://blog.csdn.net/bigloomy/article/details/6645810

http://www.cnblogs.com/chio/archive/2007/11/24/970632.html

WebBench源码分析

标签:

原文地址:http://www.cnblogs.com/xfiver/p/4480417.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!