1、socket: Too many open files (24)

解决方法:

[root@zabbix ~]# ulimit -a
core file size (blocks, -c) 0
data seg size (kbytes, -d) unlimited
scheduling priority (-e) 0
file size (blocks, -f) unlimited
pending signals (-i) 14802
max locked memory (kbytes, -l) 64
max memory size (kbytes, -m) unlimited
open files (-n) 1024
pipe size (512 bytes, -p) 8
POSIX message queues (bytes, -q) 819200
real-time priority (-r) 0
stack size (kbytes, -s) 10240
cpu time (seconds, -t) unlimited
max user processes (-u) 14802
virtual memory (kbytes, -v) unlimited
file locks (-x) unlimited
调整可以打开的文件数
[root@zabbix ~]# ulimit -n 65535

2、http错误日志报错

server reached MaxClients setting,consider raising the Max Clients setting”

设置如下:

/etc/httpd/conf/httpd.conf

## Server-Pool Size Regulation (MPM specific)

## 

# prefork MPM

# StartServers: number of server processes to start

# MinSpareServers: minimum number of server processes which are kept spare

# MaxSpareServers: maximum number of server processes which are kept spare

# ServerLimit: maximum value for MaxClients for the lifetime of the server

# MaxClients: maximum number of server processes allowed to start

# MaxRequestsPerChild: maximum number of requests a server process serves

<IfModule prefork.c>

StartServers       10

MinSpareServers    10

MaxSpareServers   75

ServerLimit      2000

MaxClients       2000

MaxRequestsPerChild  4000

</IfModule>

# worker MPM

# StartServers: initial number of server processes to start

# MaxClients: maximum number of simultaneous client connections

# MinSpareThreads: minimum number of worker threads which are kept spare

# MaxSpareThreads: maximum number of worker threads which are kept spare

# ThreadsPerChild: constant number of worker threads in each server process

# MaxRequestsPerChild: maximum number of requests a server process serves

<IfModule worker.c>

StartServers         4

MaxClients         2000

MinSpareThreads     25

MaxSpareThreads     75 

ThreadsPerChild     25

MaxRequestsPerChild  0

</IfModule>

3、: apr_socket_recv: Connection reset by peer (104)

改服务端apache的maxclients参数,调大最大打开文件数,都不解决问题,最后才发现是因为ab的源码对ab的并发有限制,修改源码重新编译apache:

Apache源码下载地址:http://httpd.apache.org/download

我下的是 2.2

修改源码support目录下的ab.c文件,大概在1369行,修改为:

 /* catch legitimate fatal apr_socket_recv errors */
else if (status != APR_SUCCESS) {
err_recv++;
if (recverrok) {
bad++;
close_connection(c);
if (verbosity >= 1) {
char buf[120];
fprintf(stderr,"%s: %s (%d)\n", "apr_socket_recv", apr_strerror(status, buf, sizeof buf), status);
}
return;
} else {
// apr_err("apr_socket_recv", status);
bad++;
close_connection(c);
return; // 到这里
}
}

修改后编译,注意添加 config 执行权限。

我是把编译后的ab可执行文件拷贝过来,避免重装apache。建一个目录执行即可。

4、其他参考

l apache的源码安装详细过程全纪录http://www.jb51.net/article/59474.htm

l apr_socket_recv: Connection reset by peer 错误(安装参考,并没有解决问题)http://blog.csdn.net/kimsung/article/details/9422991

l Ab测试说明博文 http://blog.csdn.net/gzh0222/article/details/7172341

l 网站服务器压力Web性能测试:Apache Bench,Webbench,http_load安装使用 http://www.freehao123.com/apache-bench-webbench/

l Apache下载地址: http://apache.fayea.com/

卸载centos默认的apache:  http://blog.sina.com.cn/s/blog_701300bc0100nzea.html

使用apache benchmark(ab) 测试报错汇总的更多相关文章

  1. 使用apache benchmark(ab) 测试报错: apr_socket_recv: Connection timed out (110)

    使用ab( apache benchmark )测试的时候,使用如下命令: ab -n 15000 -c 200   http://localhost/abc/abc.php 执行操作一定条数,或连续 ...

  2. apache ab压力测试报错(apr_socket_recv: Connection reset by peer (104))

    apache ab压力测试报错(apr_socket_recv: Connection reset by peer (104))   今天用apache 自带的ab工具测试,当并发量达到1000多的时 ...

  3. apache ab压力测试报错apr_socket_recv

    apache ab压力测试报错(apr_socket_recv: Connection reset by peer (104)) apache 自带的ab工具测试,当并发量达到1000多的时候报错如下 ...

  4. Ambari集成Kerberos报错汇总

    Ambari集成Kerberos报错汇总 作者:尹正杰 版权声明:原创作品,谢绝转载!否则将追究法律责任. 一.查看报错的配置信息步骤 1>.点击Test Kerberos Client,查看相 ...

  5. Apache 的ab测试

    <!-- 博主所有文章仅是作为自己的笔记 如有不足 请见谅--> Apache的ab测试  和  ab测试 不是一个东西(百度 ab测试可以了解) 网站性能压力测试是服务器网站性能调优过程 ...

  6. Python_环境部署及报错汇总(0)

    一.安装Anaconda Anaconda是一个开源的包.环境管理器,可以用于在同一个机器上安装不同版本的软件包及其依赖,并能够在不同的环境之间切换. Anaconda包括Conda.Python以及 ...

  7. 【GitLab】gitlab上配置webhook后,点击测试报错:Requests to the local network are not allowed

    gitlab上配置webhook后,点击测试报错: Requests to the local network are not allowed 操作如下: 报错: 错误原因: gitlab 10.6 ...

  8. 启动Tomcat服务时,出现org.apache.catalina.startup.VersionLoggerListener报错

    启动Tomcat服务时,出现org.apache.catalina.startup.VersionLoggerListener报错解决办法:打开Tomcat安装后目录,进入conf文件夹,找到配置文件 ...

  9. Xamarin.iOS真机测试报错

    Xamarin.iOS真机测试报错   错误信息:The MinimumOSVersion inside Info.plist does not include the device version( ...

随机推荐

  1. Java 多线程 socket 取款例子 runnable callable

    socket部分参考 http://blog.csdn.net/kongxx/article/details/7259465 取款部分参考 http://blog.csdn.net/dayday198 ...

  2. 在GridView中实现全选反选的例子

    <%@ Page Language="C#" AutoEventWireup="true" CodeBehind="GridView控件.asp ...

  3. HDU 4931 Happy Three Friends

    #include <cstdio> #include <algorithm> using namespace std; int p1,p2,a[6],T; int main() ...

  4. Android Animations动画使用详解

    一.动画类型 Android的animation由四种类型组成:alpha.scale.translate.rotate XML配置文件中 alpha 渐变透明度动画效果 scale 渐变尺寸伸缩动画 ...

  5. selenium - Headless Browser and scraping - solutions - Stack Overflow

    yum install pygtk2-devel   selenium - Headless Browser and scraping - solutions - Stack Overflow Hea ...

  6. asp.net Page_Load事件加载两次

    Page_Load 即使加上 if(!IsPostBack){ ……} 还时走了2次 这时候 或者看看你的程序和脚本,是不是刷新页面了 或者页面的样式有错误的地方  例如: background:ur ...

  7. DontDestroyOnLoad(Unity3D开发之五)

    Unity中我们从A场景切换到B场景的时候,A场景全部对象都会销毁,但有时候我不须要销毁某些东西. 比方一个简单的游戏的背景音乐,我不须要多次反复创建,多个场景播放这一个即可了.这个时候就须要用到Do ...

  8. HDU4451Dressing(计数)

    HDU4451Dressing(计数) 题目链接 题目大意:给你N件衣服, M条裤子, K双鞋子,如今有P个不合理的的搭配(衣服和裤子或者裤子和鞋子),要求不用P中不理的搭配方式来将衣服裤子鞋子三件搭 ...

  9. 关于移动端 rem 布局的一些总结

    [资源一]基础知识恕不回顾 基础知识参考以下两篇博客: http://isux.tencent.com/web-app-rem.html http://www.w3cplus.com/css3/def ...

  10. eclipse打war包

    链接地址:http://jingyan.baidu.com/article/c910274be14164cd361d2ddc.html 一个程序要想放到服务器容器中很多人想到了打一个war包放到tom ...