开发者社区> 问答> 正文

The timeout specified has expired (70007):报错

ab测试服务器提示..apr_poll: The timeout specified has expired (70007):报错

CHAR Buffer[512]="HTTP/1.1 200 OK\r\nDate: Sat, 08 Oct 2011 09:22:07 GMT\r\nServer: myserver\r\nLast-Modified: Tue, 27 Sep 2011 06:36:33 GMT\r\nContent-Length: 12\r\nContent-Type: text/html\r\nConnection: close\r\n\r\n<h1>ok</h1>";

 

自己写个http服务器,用curl,浏览器访问,响应正常,用ab测试就提示

Benchmarking l (be patient)...apr_poll: The timeout specified has expired (70007)

这是什么原因

展开
收起
kun坤 2020-06-09 23:09:56 2334 0
1 条回答
写回答
取消 提交回答
  • 我终于解决问题了,记得用ab发送request时,添加-k,保持连接keep-alive


    还有,response 返回时,记得在header处,设置 connection:keep-alive ,原因说是ab支持http 1.0协议,必须有keep-alive才能解析,http协议不是很清楚,出现这种问题还是得分析底层协议实现,暂且这样吧

    2020-06-09 23:10:01
    赞同 展开评论 打赏
问答分类:
问答地址:
问答排行榜
最热
最新

相关电子书

更多
低代码开发师(初级)实战教程 立即下载
冬季实战营第三期:MySQL数据库进阶实战 立即下载
阿里巴巴DevOps 最佳实践手册 立即下载