免费注册 查看新帖 |

Chinaunix

  平台 论坛 博客 文库
最近访问板块 发新帖
查看: 1961 | 回复: 0
打印 上一主题 下一主题

[Web] centos6.4 apache并发上不去 出现Connection timed out [复制链接]

论坛徽章:
0
跳转到指定楼层
1 [收藏(0)] [报告]
发表于 2013-11-02 22:44 |只看该作者 |倒序浏览

系统 Centos6.4 64bit 2个双核16线程  16G内存
apache2.2 php5.3  

apache 并发修改
StartServers       20
MinSpareServers    20
MaxSpareServers   50
ServerLimit      10000
MaxClients       10000
内核优化
fs.file-max = 1048576
net.ipv4.ip_forward = 0
net.ipv4.tcp_syncookies = 1
net.ipv4.tcp_tw_reuse = 1
net.ipv4.tcp_tw_recycle = 1
net.ipv4.ip_local_port_range = 1024 65000
net.ipv4.tcp_max_syn_backlog = 8192
net.ipv4.tcp_max_tw_buckets = 12000
net.ipv4.tcp_max_syn_backlog = 65536
net.core.netdev_max_backlog =  32768
net.core.somaxconn = 32768
net.core.wmem_default = 8388608
net.core.rmem_default = 8388608
net.core.rmem_max = 16777216
net.core.wmem_max = 16777216
net.ipv4.tcp_timestamps = 0
net.ipv4.tcp_synack_retries = 2
net.ipv4.tcp_syn_retries = 2
net.ipv4.tcp_tw_recycle = 1
net.ipv4.tcp_tw_reuse = 1
net.ipv4.tcp_mem = 94500000 915000000 927000000
net.ipv4.tcp_max_orphans = 3276800
文件 进程数
# End of file
*                     soft     nofile             60000
*                     hard     nofile             65535
*                     soft     nproc              65535
*                     hard     nproc              65535

pr_socket_recv: Connection timed out (110)
apr_socket_recv: Connection timed out (110)
apr_socket_recv: Connection timed out (110)
apr_socket_recv: Connection timed out (110)
apr_socket_recv: Connection timed out (110)
apr_socket_recv: Connection timed out (110)
Completed 5000 requests
Finished 5000 requests

修改过源码的ab 在局域网的另一台机器上测试 (测试机同样优化了)
../ab/ab-standalone/ab -c 1500 -n 5000 http://www.cnintest.com/
Server Software:        Apache/2.2.15
Server Hostname:        www.cnintest.com
Server Port:            80

Document Path:          /
Document Length:        16169 bytes

Concurrency Level:      1500
Time taken for tests:   14.532 seconds
Complete requests:      5000
Failed requests:        2739
   (Connect: 0, Receive: 913, Length: 913, Exceptions: 913)
Write errors:           0
Total transferred:      67521955 bytes
HTML transferred:       66147379 bytes
Requests per second:    344.07 [#/sec] (mean)
Time per request:       4359.523 [ms] (mean)
Time per request:       2.906 [ms] (mean, across all concurrent requests)
Transfer rate:          4537.61 [Kbytes/sec] received


并发数上不去  出现 Connection timed out  
改nginx + php-fpm 情况也一样  (可能我配置不熟)
请教各位大神。。

您需要登录后才可以回帖 登录 | 注册

本版积分规则 发表回复

  

北京盛拓优讯信息技术有限公司. 版权所有 京ICP备16024965号-6 北京市公安局海淀分局网监中心备案编号:11010802020122 niuxiaotong@pcpop.com 17352615567
未成年举报专区
中国互联网协会会员  联系我们:huangweiwei@itpub.net
感谢所有关心和支持过ChinaUnix的朋友们 转载本站内容请注明原作者名及出处

清除 Cookies - ChinaUnix - Archiver - WAP - TOP