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、其他参考

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

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

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

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

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. Nmon的安装及使用

    1.安装软件 1) 用root用户登录系统,建立目录:#mkdir  /nmon 2) 通过FTP将下载的nmon工具上传至服务器 192.168.40.212目录/nmon下. 3) 修改tar包权 ...

  2. ural1057 Amount of degrees 位数统计

    #include <iostream> #include <string> using namespace std; ][]; void init(){ f[][] =; ;i ...

  3. GoWithTheFlow

    GoWithTheFlow http://notes.jetienne.com/2011/07/17/gowiththeflow.js-async-flow-control-with-a-zen-to ...

  4. 帝国cms7.0 内容页控制简介字数!

    帝国cms7.0 内容页有简介部分,使用以下代码可以有效控制字数限制! 下载类简介:<?=esub($navinfor[softsay],160)?> 文章类简介:<?=esub($ ...

  5. 转: css3: display:box详解

    示例见:  css3: flexbox (BTW: blog不能包含iframe script真不方便啊~~) display:box;box-flex是css3新添加的盒子模型属性,它的出现可以解决 ...

  6. 使用libcurl POST数据和上传文件

    为了具有通用性,将文件的内容读到了fc变量中,fclen是fc的长度.fc也可以是任何其它内容.curl 是 libcurl句柄.演示省略了很多显而易见的步骤.   1. 普通的post请求,这里用c ...

  7. HDU 3398 String

    题目大意:一个长为n的01字符串,使前缀任意0的数量不大于1的数量,求方案数…… 题解:高一模拟赛时做过,是卡特兰数的几何意义,将字符串变为矩阵寻路,不可越过对角线,那么就是卡特兰数了,C(n+m, ...

  8. In Action(最短路+01背包)

    In Action Time Limit: 2000/1000 MS (Java/Others)    Memory Limit: 32768/32768 K (Java/Others)Total S ...

  9. CCPC A(模拟)

    Secrete Master Plan Time Limit: 3000/1000MS (Java/Others)     Memory Limit: 65535/65535KB (Java/Othe ...

  10. 【剑指offer】调整数组顺序

    转载请注明出处:http://blog.csdn.net/ns_code/article/details/25829395 剑指offer上的第14题,九度OJ为了确保输出的结果的唯一性,在输出上做了 ...