海运的博客

HTTP性能测试工具httping

发布时间:August 2, 2012 // 分类:网络工具 // No Comments

Httping是一款类似于ping的http响应测试工具,可用于HTTP测试及监控。
安装:

wget http://www.vanheusden.com/httping/httping-1.5.3.tgz
tar zxvf httping-1.5.3.tgz 
cd httping-1.5.3
make install

使用参数:

-g url         url (e.g. -g http://localhost/)
-h hostname    hostname (e.g. localhost)
-p portnr      portnumber (e.g. 80)
-x host:port   hostname+portnumber of proxyserver
-c count       how many times to connect
-i interval    delay between each connect, can be only smaller than 1 if user is root
-t timeout     timeout (default: 30s)
-Z             ask any proxies on the way not to cache the requests
-Q             use a persistent connection. adds a 'C' to the output if httping had to reconnect
-6             use IPv6
-s             show statuscodes
-S             split time in connect-time and processing time
-G             do a GET request instead of HEAD (read the
               contents of the page as well)
-b             show transfer speed in KB/s (use with -G)
-B             like -b but use compression if available
-L x           limit the amount of data transferred (for -b)
               to 'x' (in bytes)
-X             show the number of KB transferred (for -b)
-l             connect using SSL
-z             show fingerprint (SSL)
-f             flood connect (no delays)
-a             audible ping
-m             give machine parseable output (see
               also -o and -e)
-o rc,rc,...   what http results codes indicate 'ok'
               coma seperated WITHOUT spaces inbetween
               default is 200, use with -e
-e str         string to display when http result code
               doesn't match
-I str         use 'str' for the UserAgent header
-R str         use 'str' for the Referer header
-r             resolve hostname only once (usefull when
               pinging roundrobin DNS: also takes the first
               DNS lookup out of the loop so that the first
               measurement is also correct)
-n warn,crit   Nagios-mode: return 1 when avg. response time
               >= warn, 2 if >= crit, otherwhise return 0
-N x           Nagios mode 2: return 0 when all fine, 'x'
               when anything failes
-y ip[:port]   bind to ip-address (and thus interface) [/port]
-q             quiet, only returncode
-A             Activate Basic authentication
-U Username    needed for authentication
-P Password    needed for authentication
-C cookie=value Add a cookie to the request
-V             show the version

应用示例:

httping -S -G -s -b -c 5 www.qq.com 
PING www.qq.com:80 (www.qq.com):
connected to 125.39.127.25:80 (285 bytes), seq=0 time=38.88+723.79=762.67 ms 200 OK 381KB/s
connected to 125.39.207.172:80 (285 bytes), seq=1 time=35.89+729.76=765.64 ms 200 OK 378KB/s
connected to 111.161.48.38:80 (285 bytes), seq=2 time=34.50+1231.31=1265.82 ms 200 OK 219KB/s
connected to 111.161.48.39:80 (285 bytes), seq=3 time=39.15+779.30=818.45 ms 200 OK 355KB/s
connected to 111.161.48.52:80 (285 bytes), seq=4 time=42.51+763.95=806.46 ms 200 OK 364KB/s
--- www.qq.com ping statistics ---
5 connects, 5 ok, 0.00% failed
round-trip min/avg/max = 762.7/883.8/1265.8 ms
Transfer speed: min/avg/max = 219/340/381 KB

Iptables数据包大小匹配模块length应用

发布时间:June 29, 2012 // 分类:Iptables // No Comments

Iptables下length模块可对数据包的大小进行匹配操作,拒绝非必要的数据进入。
length使用参数:

-m length --length num #匹配指定大小的数据
-m length ! --length num #匹配非指定大小数据
-m length --length num: #匹配大于或等于
-m length --length :92 #匹配小于或等于
-m length --length num:num #匹配指定区间

length应用示例:

iptables -I INPUT -p icmp --icmp-type 8 -m length --length :60 -j ACCEPT 
#仅允许数据包小于或等于60字节的ping请求数据进入

PING测试Wwindows下ping默认发送32字节数据,包含IP、ICMP头28字节,共60字节。

ping www.haiyun.me
正在 Ping www.haiyun.me [184.164.141.188] 具有 32 字节的数据:
来自 184.164.141.188 的回复: 字节=32 时间=183ms TTL=51
来自 184.164.141.188 的回复: 字节=32 时间=212ms TTL=51
来自 184.164.141.188 的回复: 字节=32 时间=185ms TTL=51
来自 184.164.141.188 的回复: 字节=32 时间=178ms TTL=51
#默认可以PING通过,然后自定义数据大小PING
ping -l 40 www.haiyun.me 
正在 Ping www.haiyun.me 具有 40 字节的数据:
请求超时。
请求超时。
请求超时。
请求超时。
#可见如果PING发送数据超过系统限制会拒绝数据包进入
分类
最新文章
最近回复
  • opnfense: 谢谢博主!!!解决问题了!!!我之前一直以为内置的odhcp6就是唯一管理ipv6的方式
  • liyk: 这个方法获取的IPv6大概20分钟之后就会失效,默认路由先消失,然后Global IPV6再消失
  • 海运: 不好意思,没有。
  • zongboa: 您好,請問一下有immortalwrt設定guest Wi-Fi的GUI教學嗎?感謝您。
  • 海运: 恩山有很多。
  • swsend: 大佬可以分享一下固件吗,谢谢。
  • Jimmy: 方法一 nghtp3步骤需要改成如下才能编译成功: git clone https://git...
  • 海运: 地址格式和udpxy一样,udpxy和msd_lite能用这个就能用。
  • 1: 怎么用 编译后的程序在家里路由器内任意一台设备上运行就可以吗?比如笔记本电脑 m参数是笔记本的...
  • 孤狼: ups_status_set: seems that UPS [BK650M2-CH] is ...