zoukankan      html  css  js  c++  java
  • Web性能压力测试工具之WebBench详解

    webbench的标准测试可以向我们展示服务器的两项内容:每秒钟响应请求数和每秒钟传输数据量。

    webbench不但能具有便准静态页面的测试能力,还能对动态页面(ASP,PHP,JAVA,CGI)进 行测试的能力。
    他支持对含有SSL的安全网站例如电子商务网站进行静态或动态的性能测试。
    Webbench最多可以模拟3万个并发连接去测试网站的负载能力。
    官方主页:http://home.tiscali.cz/~cz210552/webbench.html
    1、WebBench安装
    wget  http://home.tiscali.cz/~cz210552/distfiles/webbench-1.5.tar.gz
    tar -zxvf webbench-1.5.tar.gz
    cd webbench-1.5
    make
    make install

    安装中遇到的问题及解决方法

    ctags *.c 
    /bin/sh: ctags: command not found 
    make: [tags] Error 127 (ignored) 

    意思是缺少ctags命令,用apt install ctags安装即可。

    2、测试WebBench

    webbench
    
    webbench [option]... URL
      -f|--force               Don't 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.

    3、进行测试

    webbench -c 1000 -t 60 http://192.168.80.157/phpinfo.php
    每秒钟响应请求数:24525 pages/min,每秒钟传输数据量20794612 bytes/sec.
    并发1000运行60秒后产生的TCP连接数12000多个,已经显示有87个连接failed了,说明超负荷了。

    参考链接:https://www.jianshu.com/p/97e4d312e83d

  • 相关阅读:
    android 网络加载图片,对图片资源进行优化,并且实现内存双缓存 + 磁盘缓存
    Web前端框架与类库的思考
    android应用开发(十):widget的使用
    响应式WEB设计的9项基本原则
    谈一下关于CQRS架构如何实现高性能
    迪杰斯特拉算法——PAT 1003
    Android开发-SQLite数据库
    寻找水王(2)
    PAT-1003
    PAT-1002
  • 原文地址:https://www.cnblogs.com/lfri/p/12727264.html
Copyright © 2011-2022 走看看