硬件配置

型号

# dmidecode | grep "Product Name"

Product Name: VMware Virtual Platform
Product Name: 440BX Desktop Reference Platform

CPU

# cat /proc/cpuinfo | grep name | cut -f2 -d: | uniq

 Intel(R) Xeon(R) CPU E5- v4 @ .00GHz

内存

# dmidecode|grep -P -A5 "Memory\s+Device" | grep Size |grep -v Range | cat -n

           Size:  MB
Size: MB

软件环境

操作系统

# cat /etc/redhat-release

CentOS Linux release 7.2. (Core)

服务版本

# /usr/local/openresty/nginx/sbin/nginx -v

nginx version: openresty/1.11.2.4

测试软件

# ab -V

This is ApacheBench, Version 2.3 <$Revision:  $>

并发测试

说明:测试基于Linux系统。

1000并发

测试1000并发,处理10000请求:

# ab -c 1000 -n 10000 http://10.27.88.50/index.html

Benchmarking 10.27.88.50 (be patient)
Completed requests
Completed requests
Completed requests
Completed requests
Completed requests
Completed requests
Completed requests
Completed requests
Completed requests
Completed requests
Finished requests Server Software: openresty/1.11.2.4
Server Hostname: 10.27.88.50
Server Port: Document Path: /index.html
Document Length: bytes
Concurrency Level:
Time taken for tests: 0.874 seconds
Complete requests:
Failed requests:
Write errors:
Total transferred: bytes
HTML transferred: bytes
Requests per second: 11437.38 [#/sec] (mean)
Time per request: 87.433 [ms] (mean)
Time per request: 0.087 [ms] (mean, across all concurrent requests)
Transfer rate: 9505.09 [Kbytes/sec] received Connection Times (ms) min mean[+/-sd] median max
Connect: 5.9
Processing: 27.8
Waiting: 27.7
Total: 29.9 Percentage of the requests served within a certain time (ms)
%
%
%
%
%
%
%
%
% (longest request)

2000并发

测试2000并发,处理50000请求:

# ab -c 2000 -n 50000 http://10.27.88.50/index.html

Benchmarking 10.27.88.50 (be patient)
Completed requests
Completed requests
Completed requests
Completed requests
Completed requests
Completed requests
Completed requests
Completed requests
Completed requests
Completed requests
Finished requests Server Software: openresty/1.11.2.4
Server Hostname: 10.27.88.50
Server Port: Document Path: /index.html
Document Length: bytes Concurrency Level:
Time taken for tests: 2.689 seconds
Complete requests: Failed requests:
(Connect: , Receive: , Length: , Exceptions: ) Write errors:
Non-2xx responses:
Total transferred: bytes
HTML transferred: bytes
Requests per second: 18593.35 [#/sec] (mean)
Time per request: 107.565 [ms] (mean)
Time per request: 0.054 [ms] (mean, across all concurrent requests)
Transfer rate: 15451.92 [Kbytes/sec] received Connection Times (ms) min mean[+/-sd] median max Connect: 137.3
Processing: 121.7
Waiting: 121.7
Total: 236.7 Percentage of the requests served within a certain time (ms) %
%
%
%
%
%
%
%
% (longest request)

3000并发

测试3000并发,处理100000请求:

# ab -c 3000 -n 100000 http://10.27.88.50/index.html

Benchmarking 10.27.88.50 (be patient)

Completed  requests
Completed requests
Completed requests
Completed requests
Completed requests
Completed requests
Completed requests
Completed requests
Completed requests
Completed requests
Finished requests Server Software: openresty/1.11.2.4
Server Hostname: 10.27.88.50
Server Port: Document Path: /index.html
Document Length: bytes Concurrency Level:
Time taken for tests: 5.065 seconds
Complete requests:
Failed requests: (Connect: , Receive: , Length: , Exceptions: ) Write errors:
Non-2xx responses:
Total transferred: bytes
HTML transferred: bytes
Requests per second: 19744.76 [#/sec] (mean)
Time per request: 151.939 [ms] (mean)
Time per request: 0.051 [ms] (mean, across all concurrent requests)
Transfer rate: 16408.79 [Kbytes/sec] received Connection Times (ms) min mean[+/-sd] median max Connect: 329.4
Processing: 185.9
Waiting: 185.9
Total: 433.0 Percentage of the requests served within a certain time (ms) %
%
%
%
%
%
%
%
% (longest request)

测试总结

数据汇总

请求连接数

并发数

请求失败数

每秒处理请求数

一次并发数请求响应时间(ms)

全体请求完成时间(s)

请求成功率

10000

1000

0

11437

87.43

0.874

100.00%

50000

2000

1

18593

107.57

2.689

99.998%

10000

3000

2

19744

151.94

5.065

99.998%

数据分析

通过测试结果可得如下分析:

1、Nginx的每秒请求处理能力是10000+,满足需求标准;

2、随着并发数的增大,一次并发请求的响应时间相应增大,满足需求标准;

3、随着请求连接数的增加,相应的总体请求完成时间也增加,当请求连接数从50k增加至100k时,总体请求时间增加至2倍,具有一定的稳定性和速度性,满足需求标准;

4、当请求连接数和并发数依次递增时,出现偶尔的请求失败数,全部请求成功率大于99.99%,满足需求标准;

5、单台服务器支持3000并发正常,满足需求标准。

NGINX压力测试的更多相关文章

  1. Nginx压力测试工具之WebBench

    Nginx压力测试工具之WebBench   在Apache中有自带的ab命令可以测试服务的压力,而nginx没有自带的命令,必须要采用第三方软件来测试,今天就简单介绍一下webbench对nginx ...

  2. nginx压力测试和并发预估

    一.Nginx并发预估 预估算法:{(?G)*1024-system}/请求大小 (?G):表示内存大小1024:表示内存容量标准进制system:表示系统和服务占用的额外内存和需要预留的内存请求大小 ...

  3. CentOS 6.7平台nginx压力测试(ab/webbench)

    压力测试工具一:webbench 1.安装 wget http://home.tiscali.cz/~cz210552/distfiles/webbench-1.5.tar.gz tar zxvf w ...

  4. nginx压力测试webbench

    下载压力测试工具webbench wget http://home.tiscali.cz/~cz210552/distfiles/webbench-1.5.tar.gz 安装依赖包 yum -y in ...

  5. nginx压力测试和优化配置

    115 yum -y install gcc automake autoconf libtool make 116 yum install ctags 117 mkdir -m 644 -p /usr ...

  6. Nginx压力测试问题

    [root@aa~]# This is ApacheBench, Version 2.3 <Revision:655654Revision:655654> Copyright 1996 A ...

  7. 自己开发的网站压力测试(阿里云1M带宽)

    背景 项目采用微服务架构设计,独立商城系统,博客系统,搜索系统,sso单点系统部署在docker环境下 商城系统(django) 博客系统(flask) 搜索系统(es+flask+restful) ...

  8. 记录一次自己对nginx+fastcgi(fpm)+mysql压力测试结果

    nginx + fastcgi(fpm) 压力测试: CentOS release 5.9 16核12G内存 静态页面: 并发1000,压测200秒,测试结果: 系统最大负载5.47 成功响应: 25 ...

  9. Nginx配置性能优化与压力测试webbench【转】

    这一篇我们来说Nginx配置性能优化与压力测试webbench. 基本的 (优化过的)配置 我们将修改的唯一文件是nginx.conf,其中包含Nginx不同模块的所有设置.你应该能够在服务器的/et ...

随机推荐

  1. Windows 窗体中的事件顺序(WinForm)

    引用MSDN,以便以后查看 引用:https://msdn.microsoft.com/zh-cn/library/86faxx0d.aspx 应用程序启动和关闭事件  Form 和 Control  ...

  2. 前端JS面试题汇总 Part 3 (宿主对象与原生对象/函数调用方式/call与apply/bind/document.write)

    原文:https://github.com/yangshun/front-end-interview-handbook/blob/master/questions/javascript-questio ...

  3. JMeter使用(Linux)

    JMeter是一个Java桌面应用程序,用户界面采用Swing Java Api实现,支持并发和多线程或者线程组的执行,对于配置负载测试和压力测试非常有用.Jmeter是开源.免安装的,只需要有jdk ...

  4. Wireshark抓包常见出现错误

    转自这里 1.   tcp out-of-order(tcp有问题) 解答: 1).    应该有很多原因.但是多半是网络拥塞,导致顺序包抵达时间不同,延时太长,或者包丢失,需要重新组合数据单元 因为 ...

  5. ASP.NET没有魔法——ASP.NET MVC 模型绑定解析(下篇)

    上一篇<ASP.NET没有魔法——ASP.NET MVC 模型绑定解析(上篇)>文章介绍了ASP.NET MVC模型绑定的相关组件和概念,本章将介绍Controller在执行时是如何通过这 ...

  6. freemarker.core.ParseException:Unexpected end of file reached

    1.错误原因 freemarker.core.ParseException:Unexpected end of file reached 2.错误原因 由于在宏定义中,运用组件时没有关闭标签,导致出错 ...

  7. “玲珑杯”ACM比赛 Round #4 B Best couple

    一眼的KM,但是建图的时候记得不用的点设为0,点少的一边补齐,这个非常重要,因为KM追求完全匹配,如果无法完全匹配会非常慢 #include<bits/stdc++.h> using na ...

  8. 异常-----freemarker.core.InvalidReferenceException问题解决

    案例一 1.1.错误描述 五月 28, 2014 9:56:48 下午 freemarker.log.JDK14LoggerFactory$JDK14Logger error 严重: Template ...

  9. C# 图解教程 第四章 类的基本概念

    类的基本概念 类的概述声明类 类成员字段方法 创建变量和类的实例为数据分配内存实例成员访问修饰符 私有访问和公用访问 从类的内部访问成员从类的外部访问成员综合应用 类的基本概念 类的概述 类是一种活动 ...

  10. RobotFramework自动化测试框架-移动手机自动化测试Get Network Connection Status和Set Network Connection Status关键字的使用

    Get Network Connection Status关键字用来获取手机的网络连接状态.在获取到连接状态后,会返回不同的数字. Set Network Connection Status关键字用来 ...