压力测试工具httperf使用方法

ftp://ftp.hpl.hp.com/pub/httperf/

下载后放到linux的/usr/local/src目录下

通过tar zxvf解压httperf-0.9.0.tar.gz

cd usr/local/src
tar zxvf httperf-0.9.0.tar.gz

进入目录

cd httperf-0.9.0

安装c++编译环境

yum install -y ncurses-devel libaio-devel cmake gcc gcc-c++ glibc

开始编译

./configure --prefix=/usr/local/httperf
make && make install

进入编译后的bin目录

cd /usr/local/httperf/bin

开始测试

./httperf --client=0/1 --server ip或域名 --port 8080 --uri /user --num-conns 30000 --rate 30000 --hog

--client=I/N 指定当前客户端I,是N个客户端中的第几个。用于多个客户端发请求,希望确保每个客户端发的请求不是完全一致。一般不用指定

• --server 所测试的的网站名(主机名,域名或者ip地址)

• --uri 指定的下载文件

• --rate 每秒发送的请求

• --num-conn 连接的总数

• --num-call 每个连接发送的请求数目

• --timeout 超时时间

实例:
[root@192 bin]# ./httperf --client=0/1 --server guixiang.top --port 8080 --uri /user --num-conns 30000 --rate 30000 --hog
httperf --hog --client=0/1 --server=guixiang.top --port=8080 --uri=/user --rate=30000 --send-buffer=4096 --recv-buffer=16384 --num-conns=30000 --num-calls=1
httperf: warning: open file limit > FD_SETSIZE; limiting max. # of open files to FD_SETSIZE
httperf: connection failed with unexpected error 113
^[[A^CMaximum connect burst length: 6347 Total: connections 1021 requests 0 replies 0 test-duration 93.509 s Connection rate: 10.9 conn/s (91.6 ms/conn, <=1022 concurrent connections)
Connection time [ms]: min 0.0 avg 0.0 max 0.0 median 0.0 stddev 0.0
Connection time [ms]: connect 41076.2
Connection length [replies/conn]: 0.000 Request rate: 0.0 req/s (0.0 ms/req)
Request size [B]: 0.0 Reply rate [replies/s]: min 0.0 avg 0.0 max 0.0 stddev 0.0 (18 samples)
Reply time [ms]: response 0.0 transfer 0.0
Reply size [B]: header 0.0 content 0.0 footer 0.0 (total 0.0)
Reply status: 1xx=0 2xx=0 3xx=0 4xx=0 5xx=0 CPU time [s]: user 7.38 system 86.08 (user 7.9% system 92.1% total 99.9%)
Net I/O: 0.0 KB/s (0.0*10^6 bps) Errors: total 29999 client-timo 0 socket-timo 0 connrefused 970 connreset 0
Errors: fd-unavail 28979 addrunavail 0 ftab-full 0 other 50

注意113是因为防火墙原因

关了之后:
[root@192 bin]# ./httperf --client=0/1 --server 192.168.117.170 --port 8080 --uri /user --num-conns 30000 --rate 30000 --hog
httperf --hog --client=0/1 --server=192.168.117.170 --port=8080 --uri=/user --rate=30000 --send-buffer=4096 --recv-buffer=16384 --num-conns=30000 --num-calls=1
httperf: warning: open file limit > FD_SETSIZE; limiting max. # of open files to FD_SETSIZE
Maximum connect burst length: 13605 Total: connections 2552 requests 0 replies 0 test-duration 1.009 s Connection rate: 2528.6 conn/s (0.4 ms/conn, <=1022 concurrent connections)
Connection time [ms]: min 0.0 avg 0.0 max 0.0 median 0.0 stddev 0.0
Connection time [ms]: connect 213.7
Connection length [replies/conn]: 0.000 Request rate: 0.0 req/s (0.0 ms/req)
Request size [B]: 0.0 Reply rate [replies/s]: min 0.0 avg 0.0 max 0.0 stddev 0.0 (0 samples)
Reply time [ms]: response 0.0 transfer 0.0
Reply size [B]: header 0.0 content 0.0 footer 0.0 (total 0.0)
Reply status: 1xx=0 2xx=0 3xx=0 4xx=0 5xx=0 CPU time [s]: user 0.01 system 0.99 (user 1.4% system 98.3% total 99.7%)
Net I/O: 0.0 KB/s (0.0*10^6 bps) Errors: total 30000 client-timo 0 socket-timo 0 connrefused 2552 connreset 0
Errors: fd-unavail 27448 addrunavail 0 ftab-full 0 other 0

压力测试工具httperf使用方法的更多相关文章

  1. linux web站点常用压力测试工具httperf

    一.工具下载&&安装 软件获取 ftp://ftp.hpl.hp.com/pub/httperf/ 这里使用的是如下的版本 ftp://ftp.hpl.hp.com/pub/httpe ...

  2. php压力测试工具简单实用方法

    命令 ab -h 指令帮助 ab -n100 -c10 http://www.baidu.com 发起100个请求 并发数为10 设置测试地址是百度,注意测试测试时候请求数和并发数尽量设置低一点 Re ...

  3. 压力测试工具ab及centos下单独安装方法 nginx和tomcat静态资源的性能测试

    Apache安装包中自带的压力测试工具Apache Benchmark(简称ab)简单易用,这里采用ab作为压国测试工具. 独立安装: ab运行需要信赖apr-util包: # yum install ...

  4. 压力测试工具ab及centos下单独安装方法

    压力测试工具Ab简介 Apache安装包中自带的压力测试工具 Apache Benchmark(简称ab) 简单易用,这里就采用 ab作为压力测试工具了. 1.独立安装 ab运行需要依赖apr-uti ...

  5. 支持https的压力测试工具

    支持https的压力测试工具 测试了linux下的几种压力测试工具,发现有些不支持https,先简单总结如下: 一.apache的ab工具 /home/webadm/bin/ab -c 50 -n 1 ...

  6. Linux下四款Web服务器压力测试工具(http_load、webbench、ab、siege)介绍

    一.http_load程序非常小,解压后也不到100Khttp_load以并行复用的方式运行,用以测试web服务器的吞吐量与负载.但是它不同于大多数压力测试工具,它可以以一个单一的进程运行,一般不会把 ...

  7. Linux压力测试工具Tsung安装、使用和图形报表生成

    简介 Tsung 是一个压力测试工具,可以测试包括HTTP, WebDAV, PostgreSQL, MySQL, LDAP, and XMPP/Jabber等服务器.针对 HTTP 测试,Tsung ...

  8. 网站性能Web压力测试工具webbench

    webbench最多可以模拟3万个并发连接去测试网站的负载能力,个人感觉要比Apache自带的ab压力测试工具好,安装使用也特别方便. 1.适用系统:Linux 2.编译安装: wget http:/ ...

  9. 推荐一个linux下的web压力测试工具神器webbench

    推荐一个linux下的web压力测试工具神器webbench2014-04-30 09:35:29   来源:   评论:0 点击:880 用多了apache的ab工具之后你就会发现ab存在很多问题, ...

  10. Apache中压力测试工具ab的操作说明

    1.压力测试工具ab(ApacheBench)的简单说明 1)     网站性能压力测试是性能调优过程中必不可少的一环.只有让服务器处在高压情况下才能真正体现出各种设置所暴露的问题.Apache中有个 ...

随机推荐

  1. Java中GUI

    目录 1.Java GUI 概述 2.容器 2.1 窗口 2.2 弹窗和对话框 对话框 自定义弹窗 2.3 面板 普通面板 滚动面板 分隔面板 选项卡面板 3.布局 3.1.流式布局 3.2.网格布局 ...

  2. 穿透 wsl 和 ssh, 新版本 neovim 跨设备任意复制,copy anywhere!

    获得更好的阅读体验,欢迎查看原文:穿透 wsl 和 ssh, 新版本 neovim 跨设备任意复制,copy anywhere! 1. 创作动机 最近一个星期,我入坑了 neovim, 然后开始配置各 ...

  3. c# 语音识别 | 智能对话

    在.NET4.0中,我可以借助System.Speech组件让电脑来识别我们的声音. 以上,当我说"name",显示"Darren",我说"age&q ...

  4. 纯css+html做emoji动态表情

    <!DOCTYPE html> <html lang="zh-CN"> <head> <meta charset="UTF-8& ...

  5. REACT 前端界面提交

    在react项目中安装代理中间件 setupProxy.js文件 const { createProxyMiddleware: proxy } = require('http-proxy-middle ...

  6. 将MP4(视频)转换为MP3(音频)

    使用VLC Media Player 步骤1. 在计算机上启动VLC Media Player,点击「媒体」并选择「转换/储存」. 步骤2. 点击「加入」以浏览并打开MP4文件,然后点击「Conver ...

  7. FolkMQ 1.6.0(纯血国产,适合信创)

    FolkMQ 是个"新式"的消息中间件.强调:"简而强".可内嵌,可单机,可集群(部署包为 9Mb). 功能简表 角色 功能 生产者(客户端) 发布普通消息.Q ...

  8. LLM微调方法(Efficient-Tuning)六大主流方法:思路讲解&优缺点对比[P-tuning、Lora、Prefix tuing等]

    LLM微调方法(Efficient-Tuning)六大主流方法:思路讲解&优缺点对比[P-tuning.Lora.Prefix tuing等] 由于LLM参数量都是在亿级以上,少则数十亿,多则 ...

  9. python 动态导入模块并结合反射,动态获取类、方法(反射太好用),动态执行方法

    背景: 关键字驱动框架,不同的关键字方法分别定义在不同的类,真正执行关键字方法又在不同的类(简称A),这样就需要在执行前,要在文件A下import要使用的模块,如果有很多页面操作或很多模块时,就需要每 ...

  10. POJ2247,hdu1058(Humble Numbers)

    Problem Description A number whose only prime factors are 2,3,5 or 7 is called a humble number. The ...