apache ab测试
网站并发测试,网站服务使用的是apache2.4 因此使用ab来测试网站性能。
windows使用cms 打开apache/bin 运行ab.exe (......../apache/bin/ab),提示出很多参数,大家可以去查看,我就看了n和c其余没注意,
...... ab -n 200-c 100 http://localhost/test.php >>d:**** 测试结果会保持到****文件里。
第一次测试 200请求数 100并发 结果OK
第二次测试 500请求数 500并发 结果 近2000次fail
很是费解,查资料 需要配置apache的什么“多处理模块” 也就是conf目录下extra下的httpd-mpm.conf文件配置
默认:
<IfModule mpm_prefork_module>
StartServers 5
MinSpareServers 5
MaxSpareServers 10
MaxRequestWorkers 250
MaxConnectionsPerChild 0
</IfModule>
修改后
<IfModule mpm_prefork_module>
ServerLimit 1000
StartServers 30
MinSpareServers 30
MaxSpareServers 40
MaxRequestWorkers 1000
MaxConnectionsPerChild 4000
</IfModule>
StartServers:当Apache被启动时,Apache会自动创建StartServers个进程,
MinSpareServers :将空闲进程数保持在MinSpareServers和MaxSpareServers之间。
MaxSpareServers :将空闲进程数保持在MinSpareServers和MaxSpareServers之间。
如果空闲进程小于MinSpareServers,Apache将会以大约每秒1个的速度新建进程。
如果空闲进程大于MaxSpareServers,Apache将会删除多余的空闲进程,释放服务器资源。
进程数的最大值由MaxRequestWorkers 控制,在Apache1.3中最大只能设置为256,但在Apache2.0中,可以通过在配置开头增加ServerLimit项目来突破256的限制,此时必须MaxClients ≤ ServerLimit ≤ 20000
MaxConnectionsPerChild 用来控制每个进程在处理了多少次请求之后自动销毁,这个参数可以设置为0表示无限(即不销毁进程)。
重启apache
继续测试
现在结果好多了
This is ApacheBench, Version 2.3 <$Revision: 1430300 $>
Copyright 1996 Adam Twiss, Zeus Technology Ltd, http://www.zeustech.net/
Licensed to The Apache Software Foundation, http://www.apache.org/
Benchmarking www.site1.com (be patient)
Server Software: Apache/2.4.4
Server Hostname: www.site1.com
Server Port: 80
Document Path: /search/pf/1.html
Document Length: 28355 bytes
Concurrency Level: 1000
Time taken for tests: 298.971 seconds
Complete requests: 5000
Failed requests: 10
(Connect: 3, Receive: 0, Length: 7, Exceptions: 0)
Write errors: 0
Total transferred: 143335307 bytes
HTML transferred: 141760307 bytes
Requests per second: 16.72 [#/sec] (mean)
Time per request: 59794.294 [ms] (mean)
Time per request: 59.794 [ms] (mean, across all concurrent requests)
Transfer rate: 468.19 [Kbytes/sec] received
Connection Times (ms)
min mean[+/-sd] median max
Connect: 0 55 165.9 0 1089
Processing: 13703 54289 13103.4 57385 70505
Waiting: 12896 36895 12487.2 37135 69721
Total: 13703 54344 13104.2 57412 70593
Percentage of the requests served within a certain time (ms)
50% 57412
66% 60102
75% 61825
80% 64498
90% 67807
95% 69000
98% 69520
99% 69998
100% 70593 (longest request)
apache ab测试的更多相关文章
- Apache ab 测试工具使用(一)
简述: 试用apache ab测试工具 下载点 http://httpd.apache.org/download.cgi 参考: http://jingyan.baidu.com/article/e3 ...
- apache ab测试介绍
apache ab测试介绍 安装ab命令 环境为ubuntu16.04.2 LTS,安装的命令为: sudo apt-get install apache2-utils 使用说明 格式为:ab [op ...
- Apache ab测试工具使用方法(无参、get传参、post传参)(转)
转自Apache ab测试工具使用方法(无参.get传参.post传参) Ab测试工具是apache自带的测试工具,具有简单易上手的特性,下面我总结一下我的使用方法,首先去官方下载apache程序包, ...
- Apache ab测试工具使用方法(无参、get传参、post传参)
Ab测试工具是apache自带的测试工具,具有简单易上手的特性,下面我总结一下我的使用方法,首先去官方下载apache程序包,我下的最新版本apache2.4.23,下载地址http://httpd. ...
- MAC系统上安装Apache ab测试工具
第一步:下载 Apache HTTP Server http://httpd.apache.org/download.cgi#apache24 第二步:安装brew工具 https://brew.sh ...
- Apache ab 测试结果的分析
以前安装好APACHE总是不知道该如何测试APACHE的性能,现在总算找到一个测试工具了.就是APACHE自带的测试工具AB(apache benchmark).在APACHE的bin目录下.格式: ...
- 【原创】Apache ab测试时出现:apr_socket_recv "connection reset by peer" 104
今天在用Apache自带的ab工具做以下简单的压测,本来是随便填几个参数,发现ab在1000并发以上报错:apr_socket_recv "connection reset by peer& ...
- apache ab 测试 apr_socket_connect(): 由于目标机器积极拒绝 无法连接
遇到这种情况一般是你开的并行数量太多了...例如:ab -c 1000 -n 10000 http://localhost/index.html 如此大的请求就会挂掉,不过还是有补救措施的,可以通过增 ...
- Apache 的ab测试
<!-- 博主所有文章仅是作为自己的笔记 如有不足 请见谅--> Apache的ab测试 和 ab测试 不是一个东西(百度 ab测试可以了解) 网站性能压力测试是服务器网站性能调优过程 ...
随机推荐
- http 使用curl发起https请求报错的解决办法
使用curl发起https请求的时候报错:“SSL certificate problem, verify that the CA cert is OK. Details: error:1409008 ...
- [React] Detect user activity with a custom useIdle React Hook
If the user hasn't used your application for a few minutes, you may want to log them out of the appl ...
- Linux内核project导论——linux学习和职业曲线(刚開始学习的人,中级,高级都可參考)
Linux世界介绍 给自己定级 门外汉: 不会安装操作系统 不会用虚拟机(安装和使用) 入门级: 熟悉常见的发行版,甚至装过而且能用一些特殊发行版(比如kali)做过一些简单的图形界面的使用. 会一些 ...
- FastIV图像处理
新建一图像处理算法群,主要讨论图像处理与计算机视觉中的快速算法及其工程实现. 群号码:322687422
- vue项目中provide和inject的运用
类型: provide:Object | () => Object inject:Array<string> | { [key: string]: string | Symbol | ...
- 【MVC5】使用权限+角色
1.在Ticket中设置用户角色 在权限的Ticket中设置用户的角色(这里是逗号分割). List<string> roles = new List<string>(); i ...
- webDriver API——第5部分Special Keys
The Keys implementation. class selenium.webdriver.common.keys.Keys Bases: object Set of special keys ...
- C# 重载和默认参数(那种情况下使用更好)
当你提供函数,外部因为要传入不同参数个数,重载会导致 外部if增加, 默认参数可以消除外部的if.当外部调用函数需要判断调用那个函数,根据调用次数增多 if跟着调用持续增多两种不同的调用 //重载 ...
- Node.js开发入门—HelloWorld再分析
在Node.js开发入门(1)我们用http模块实现了一个简单的HelloWorld站点,这次我们再来细致分析下代码.了解很多其它的细节. 先看看http版本号的HelloWorld代码: 代码就是这 ...
- Mysql中的排序规则utf8_unicode_ci、utf8_general_ci的区别
utf8_unicode_ci和utf8_general_ci对中.英文来说没有实质的差别.utf8_general_ci 校对速度快,但准确度稍差.utf8_unicode_ci 准确度高,但校对速 ...