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. iOS 支持arm_64 和 x86_64 的OpenSSL 静态库(libcrypto.a, libssl.a)

    下载链接

  2. PHP mysqli类

    <?php header("content-type:text/html;charset=utf-8"); $conn = new mysqli("localhos ...

  3. selenium 学习笔记 ---新手学习记录(7) 问题总结(java)

    1.想要获取固定ul下所有li的个数  如下图: //获取ul下li的个数 List<WebElement> elements = driver.findElement(By.id(&qu ...

  4. 转: angularjs学习总结(~~很详细的教程)

    1 前言 前端技术的发展是如此之快,各种优秀技术.优秀框架的出现简直让人目不暇接,紧跟时代潮流,学习掌握新知识自然是不敢怠慢. AngularJS是google在维护,其在国外已经十分火热,可是国内的 ...

  5. C#使用Windows API 隐藏/显示 任务栏 (FindWindowEx, ShowWindow)

    原文 C#使用Windows API 隐藏/显示 任务栏 (FindWindowEx, ShowWindow) 今天,有网友询问,如何显示和隐藏任务栏? 我这里,发布一下使用Windows API 显 ...

  6. Failure [INSTALL_FAILED_OLDER_SDK]

    在AndroidManifest.xml 中把  <uses-sdk android:minSdkVersion="21" />的版本调节的低一点

  7. 在systemd(CentOS7)自启动zookeeper

    zookeeper的自启动脚本,如果是 sysV 模式(CeontOS6或以下版本),可以直接使用下载版本中的 src 目录下对应的 sysV 自启动包,再chkconfig即可.老方法,简单,就不说 ...

  8. JS动态增加页面上的控件实例

    <input   type="button"   value="继续添加"   onclick="append();"/ > & ...

  9. C#静态方法

    C#静态方法     学习C#静态函数及变量的一个精典例子与代码 (1)用于对静态字段.只读字段等的初始化. (2)添加static关键字,不能添加访问修饰符,因为静态构造函数都是私有的. (3)类的 ...

  10. Register/unregister a dll to GAC

    gacutil /i "C:\Test.dll"gacutil /u "Test"