您的位置:首页 > 理论基础 > 计算机网络

Nginx性能测试工具之http_load

2014-10-11 15:38 274 查看
http_load基于linux平台的一种性能测工具.用以测试web服务器的吞吐量与负载,测试web页面的性能.工具简单轻巧容易测试,但只能在Linux系统上使用,且只能测试web服务,不能对数据库进行测试.以下就用一台虚拟机测试一下nginx性能,测试只是写出方法并不是生产环境. 1.下载和安装http_load[root@centos home]# wget http://www.acme.com/software/http_load/http_load-14aug2014.tar.gz[root@centos home]# tar xvf http_load-14aug2014.tar.gz[root@centos home]# cd http_load-14aug2014
[root@centos http_load-14aug2014]# make && make install[root@centos http_load-14aug2014]# ll
总用量 128
-rw-r--r--. 1 root root 51 10月 9 18:15 1.txt
-r--r--r--. 1 root root 97 7月 16 2001 FILES
-rwxr-xr-x. 1 root root 24400 10月 9 18:00 http_load
-r--r--r--. 1 root root 5414 5月 21 2005 http_load.1
-r--r--r--. 1 root root 47394 8月 15 10:48 http_load.c
-rw-r--r--. 1 root root 1682 8月 12 03:13 Makefile
-r-xr-xr-x. 1 root root 1178 9月 14 2000 make_test_files
-r--r--r--. 1 root root 2397 8月 3 02:04 port.h
-r--r--r--. 1 root root 1035 3月 13 2006 README
-r--r--r--. 1 root root 7362 7月 10 08:25 timers.c
-r--r--r--. 1 root root 3832 7月 10 08:09 timers.h
-rw-r--r--. 1 root root 4760 10月 9 18:00 timers.o
-r--r--r--. 1 root root 163 8月 14 06:53 version.h
[root@centos http_load-14aug2014]# 2.将要测试的地址写入文件中[root@centos http_load-14aug2014]# vim 1.txthttp://192.168.1.179/test.php --可以写多个http://192.168.1.179 3.测试文件中的地址参数介绍:-fetches 简写-f :含义是总计的访问次数
-rate 简写-r :含义是每秒的访问频率
-seconds 简写-s :含义是总计的访问时间
-parallel 简写-p:并发访问的线程数
urls是一个url 列表,每个url 单独的一行。可以单个页面 开始测试[root@centos http_load-14aug2014]# ./http_load -p 10 -s 5 1.txt
2059 fetches, 10 max parallel, 5.44223e+07 bytes, in 5.00237 seconds
26431.4 mean bytes/connection
411.605 fetches/sec, 1.08793e+07 bytes/sec
msecs/connect: 0.078831 mean, 0.874 max, 0.028 min
msecs/first-response: 6.322 mean, 3003.78 max, 0.071 min
HTTP response codes:
code 200 -- 2059
[root@centos http_load-14aug2014]# 分析结果2059 fetches, 10 max parallel, 5.44223e+07 bytes, in 5.00237 seconds一共请求连接2059次,最大并发线程10个,持续5.00237秒内,总传输速率为5.44223e+07 bytes26431.4 mean bytes/connection每次请求连接平均数据量(5.44223e+07÷41)411.605 fetches/sec, 1.08793e+07 bytes/sec每秒的响应请求连接数为411.605 个,每秒传输的数据为1.08793e+07bytes/毫秒msecs/connect: 0.078831 mean, 0.874 max, 0.028 min每次连接平均响应时间:0.078831 264.607毫秒,最大时间: 0.874 毫秒,最小时间:0.028 毫秒msecs/first-response: 6.322 mean, 3003.78 max, 0.071 min每次连接平均返回时间:6.322 毫秒,最大时间:3003.78 毫秒,最小时间:0.071 毫秒code 200 -- 2059HTTP返回码:200 ,一共2059次
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: