https://www.cnblogs.com/yoyoketang/p/10255100.html

前言

使用ab压力测试时候出现报错apr_pollset_poll: The timeout specified has expired (70007),本篇总结了几个ab常见的报错和对应解决办法
当并发数过大的时候,也会出现apr_socket_recv: Connection reset by peer (104)

apr_pollset_poll

如果出现apr_pollset_poll: The timeout specified has expired (70007),主要是timeout连接超时了,可以加个-k参数,让连接KeepAlive

ab -c 10 -n 5000 http://47.104.x.x:8082/

[root@yoyo sbin]# ab -c 10 -n 5000 http://47.104.x.x:8082/
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 47.104.190.48 (be patient)
Completed 500 requests
Completed 1000 requests
Completed 1500 requests
Completed 2000 requests
Completed 2500 requests
Completed 3000 requests
Completed 3500 requests
Completed 4000 requests
Completed 4500 requests
apr_pollset_poll: The timeout specified has expired (70007)

出现原因主要是timeout连接超时了,可以加个-k参数,让连接keep-alive,另外还有-r 和-s参数也可以加上

-r              Don't exit on socket receive errors.                 # 在遇到socket接收错误后,不退出测试
-s timeout Seconds to max. wait for each response # 最大超时时间,默认30s
Default is 30 seconds
-k Use HTTP KeepAlive feature # keep-alive保持连接

加上-k参数重新运行就不会有问题了

ab -c 10 -n 5000 -k http://47.104.x.x:81/

其它异常

当并发数设置为1000时,直接报错:apr_socket_recv: Connection reset by peer (104)

[root@yoyo sbin]# ab -c 1000 -n 10000 http://47.104.x.x:81/
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 47.104.190.48 (be patient)
apr_socket_recv: Connection reset by peer (104)
Total of 1 requests completed

当ab遇到严重的网络错误后,就会退出测试,因为这种错误说明网络存在其他问题,但是只要服务器返回数据,哪怕是数据不对,ab也会继续下去,但是会记录数据长度不对。
但事实上是:在高压力下,偶尔的一两个请求被阻止,这是一个正常的情况,特别是有防火墙或入侵检测系统的情况下,这种事情会经常发生。
那么ab有没有参数来跳过这种错误,使测试继续下去呢?

-r参数可以实现忽略这种错误,在遇到socket接收错误后,不退出测试

ab -c 10 -n 5000 -r http://47.104.x.x:81/

加上-r参数就不会遇到这种异常,中途退出了

交流QQ群:779429633

[转帖]Linux学习14-ab报错apr_pollset_poll: The timeout specified has expired (70007)的更多相关文章

  1. Linux学习14-ab报错apr_pollset_poll: The timeout specified has expired (70007)

    前言 使用ab压力测试时候出现报错apr_pollset_poll: The timeout specified has expired (70007),本篇总结了几个ab常见的报错和对应解决办法 当 ...

  2. Linux下Oracle11G RAC报错:在安装oracle软件时报file not found一例

    Linux下Oracle11G RAC报错:在安装oracle软件时报file notfound一例 1.现象 之前安装一切都比較顺利,安装oracle软件时,进度到30%时报错:file not f ...

  3. linux下面重启nfs报错:nfs-server.service:main process exited

    linux下面重启nfs报错:nfs-server.service:main process exited [root@dhcp-66-83-39 images]# service rpcbind s ...

  4. 【转载】访问IIS中网站出现 403.14 - Forbidden报错信息

    将网站发布后部署到IIS后,配置完应用程序池以及相关设置项后,在浏览器中访问设置好的网站,出现403.14 - Forbidden的错误信息,从错误信息的提示来看,应该是IIS服务器此网站目录的内容被 ...

  5. linux 下 tomcat 运行报错 Broken pipe

    linux 下 tomcat 运行报错 Broken pipe 感谢:http://hi.baidu.com/liupenglover/blog/item/4048c23ff19f1cd67d1e71 ...

  6. linux下安装php报错configure: error: Cannot find MySQL header files under /usr/include/mysql.

    linux下安装php报错configure: error: Cannot find MySQL header files under /usr/include/mysql. 2013-03-04 1 ...

  7. Linux安装ElasticSearch启动报错的解决方法

    Linux安装ElasticSearch后,ElasticSearch是不能用root用户启动的,以root用户启动会报错Refer to the log for complete error det ...

  8. jmeter Linux环境执行总报错 cannot allocate memory

    1.windows环境写好的测试用例,执行没有问题,在Linux环境跑总是报错,提示如下 cannot allocate memory 2.一开始以为是哪块设置有问题,因为脚本里边有设置邮件自动发送, ...

  9. Linux下Electron loadURL报错 ERR_FAILED(-2) Not allowed to load local resource

    Linux下Electron loadURL报错 ERR_FAILED(-2) Not allowed to load local resource 背景 使用electron-vue的时候,窗体创建 ...

  10. Linux mount挂载磁盘报错 mount: wrong fs type, bad option, bad superblock on /dev/vdb

    Linux mount挂载磁盘报错  mount: wrong fs type, bad option, bad superblock on /dev/vdb Linux挂载磁盘报如下错误: moun ...

随机推荐

  1. 在线编辑Word——插入表格

    Word中可插入表格并进行相关格式化操作用于美化表格设计.本文,将通过使用Spire.Cloud Word在线编辑器展示如何来插入格式化的表格到Word.详细步骤见以下内容: 1. 进入在线编辑Wor ...

  2. 实践丨手把手教你用STM32设计WiFi语音播报日程表

    摘要:随着电子产品的发展,数字日程表这项应用在人们工作和生活中起到越来越重要的作用.本文带领大家基于STM32自己动手制作一个WiFi语音播报日程表. 本文分享自华为云社区<基于STM32设计的 ...

  3. 带你学会区分Scheduled Thread Pool Executor 与Timer

    摘要:本文简单介绍下Scheduled Thread Pool Executor类与Timer类的区别,Scheduled Thread Pool Executor类相比于Timer类来说,究竟有哪些 ...

  4. 拥抱时序数据库,构筑IoT时代下智慧康养数据存储底座

    摘要:在HDZ城市行广州站中,来自华为云华为云数据库创新Lab向宇从时序数据库的技术角度,解读一下华为云时序数据库GaussDB(for Influx)如何应用在智慧健康养老行业. 本文分享自华为云社 ...

  5. Hugging News #0925: 一览近期的新功能发布

    每一周,我们的同事都会向社区的成员们发布一些关于 Hugging Face 相关的更新,包括我们的产品和平台更新.社区活动.学习资源和内容更新.开源库和模型更新等,我们将其称之为「Hugging Ne ...

  6. 以 Golang 为例详解 AST 抽象语法树

    前言 各位同行有没有想过一件事,一个程序文件,比如 hello.go 是如何被编译器理解的,平常在编写程序时,IDE 又是如何提供代码提示的.在这奥妙无穷的背后, AST(Abstract Synta ...

  7. C#写日志工具类(新版)

    源码:https://gitee.com/s0611163/LogUtil 昨天打算把我以前写的一个C#写日志工具类放到GitHub上,却发现了一个BUG,当然,已经修复了. 然后写Demo对比了NL ...

  8. signed main 和 int main 的区别

    事实上只是因为有人直接 #define int long long 了...然后int main改成signed main就行了 #define int long long ... signed ma ...

  9. AIsing Programming Contest 2020 游记 (ABC水题,D思维)

    补题链接:Here A - Number of Multiples 水题 B - An Odd Problem 水题 C - XYZ Triplets 水题,注意数组不要开小了 D - Anythin ...

  10. Java ConcurrentHashMap 高并发安全实现原理解析

    本文首发于 vivo互联网技术 微信公众号链接:https://mp.weixin.qq.com/s/4sz6sTPvBigR_1g8piFxug作者:vivo 游戏技术团队 一.概述 Concurr ...