Nginx性能测试工具之http_load

简介:

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.txt

http://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 bytes

26431.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 -- 2059

HTTP返回码:200 ,一共2059次










本文转自 xinsir999 51CTO博客,原文链接:http://blog.51cto.com/xinsir/1562556,如需转载请自行联系原作者
相关实践学习
通过性能测试PTS对云服务器ECS进行规格选择与性能压测
本文为您介绍如何利用性能测试PTS对云服务器ECS进行规格选择与性能压测。
目录
相关文章
|
JSON 前端开发 JavaScript
Nginx http相关常用配置总结
Nginx http相关常用配置总结
133 0
|
存储 缓存 负载均衡
01.Nginx基础Http原理
1.Http协议概述HTTP全称HyperText Transfer Protocol中文名为超文本传输协议1.什么是超文本?包含有超链接(Link)和各种多媒体元素标记的文本。这些超文本文件彼此链接,形成网状(Web),因此又被称为网页(Web Page)。这些链接使用URL表示。最常见的超文本格式是超文本标记语言HTML。html文件->包含各种各样的元素(URL链接)->形成web page简称web页面。2.那什么是URL,URL简称统一资源定位符。那URL的组成部分是由协议, 域名:端口, 路径和文件名3.那超文本传输http协议是什么?是一种按照URL指示,将超文本文档从一台主机(
198 0
|
Web App开发 Linux 应用服务中间件
NGINX Plus 现在完全支持 HTTP/2
 为什么要使用 HTTP/2?   HTTP/2 使数据传输更高效,对你的应用程序更安全。 HTTP/2 相比于 HTTP/1.x 有五个提高性能特点:   完全复用 – 在一个保持激活(keepalive)的连接上,HTTP/1.1 强制按严格的顺序来处理请求。
1652 0
|
应用服务中间件 Linux 测试技术
|
应用服务中间件 nginx
|
测试技术 应用服务中间件 nginx
|
Web App开发 JavaScript 应用服务中间件
|
监控 负载均衡 应用服务中间件
|
应用服务中间件 网络安全 nginx
|
应用服务中间件 nginx 缓存

热门文章

最新文章