apache的并发数量设置
2016-02-19 09:57
671 查看
如何设置apache的并发数量
1、在httpd.conf文件中修改
#Server-pool management (MPM specific)
#Include conf/extra/httpd-mpm.conf
将上面一句的#注释去掉
2、确定当前的apache是什么MPM模式(winnt模式,perfork模式,worker模式)
进入到apache/bin目录
cmd命令:httpd.exe -1
说明:看mpm_xxx.c 如果xxx是winnt 说明是winnt,另外还可能是perfork或者worker
3、修改httpd-mpm.conf文件
# WinNT MPM
# ThreadsPerChild: constant number of worker threads in the server process
# MaxRequestsPerChild: maximum number of requests a server process serves
<IfModule mpm_winnt_module>
ThreadsPerChild 150 //修改这个值即可
MaxRequestsPerChild 0
</IfModule>
4、重启apache,测试看看
在Linux下,一般采用的MPM是perfork模式
<IfModule mpm_prefork_module>
StartServers 5 //预先起5个进程
MinSpareServers 5 //最小空闲进程
MaxSpareServers 10 //最大空闲进程
MaxClients 150 //并发连接数
MaxRequestsPerChild 0 //指一个进程里可以起多少个线程,对worker更好,0为不限制
</IfModule>
给大家一个合理的建议配置,对在部分网站,中型网站,配置:
<IfModule mpm_prefork_module>
StartServers 5 //预先起5个进程
MinSpareServers 5 //最小空闲进程
MaxSpareServers 10 //最大空闲进程
ServerLimit 1500 // 用于修改apache编程参数
MaxClients 1000 //并发连接数
MaxRequestsPerChild 0 //指一个进程里可以起多少个线程,对worker更好,0为不限制
</IfModule>
如果你的网站pv值百万,可以这样设置:
ServerLimit 2500 // 用于修改apache编程参数
MaxClients 2000 //并发连接数
1、在httpd.conf文件中修改
#Server-pool management (MPM specific)
#Include conf/extra/httpd-mpm.conf
将上面一句的#注释去掉
2、确定当前的apache是什么MPM模式(winnt模式,perfork模式,worker模式)
进入到apache/bin目录
cmd命令:httpd.exe -1
说明:看mpm_xxx.c 如果xxx是winnt 说明是winnt,另外还可能是perfork或者worker
3、修改httpd-mpm.conf文件
# WinNT MPM
# ThreadsPerChild: constant number of worker threads in the server process
# MaxRequestsPerChild: maximum number of requests a server process serves
<IfModule mpm_winnt_module>
ThreadsPerChild 150 //修改这个值即可
MaxRequestsPerChild 0
</IfModule>
4、重启apache,测试看看
在Linux下,一般采用的MPM是perfork模式
<IfModule mpm_prefork_module>
StartServers 5 //预先起5个进程
MinSpareServers 5 //最小空闲进程
MaxSpareServers 10 //最大空闲进程
MaxClients 150 //并发连接数
MaxRequestsPerChild 0 //指一个进程里可以起多少个线程,对worker更好,0为不限制
</IfModule>
给大家一个合理的建议配置,对在部分网站,中型网站,配置:
<IfModule mpm_prefork_module>
StartServers 5 //预先起5个进程
MinSpareServers 5 //最小空闲进程
MaxSpareServers 10 //最大空闲进程
ServerLimit 1500 // 用于修改apache编程参数
MaxClients 1000 //并发连接数
MaxRequestsPerChild 0 //指一个进程里可以起多少个线程,对worker更好,0为不限制
</IfModule>
如果你的网站pv值百万,可以这样设置:
ServerLimit 2500 // 用于修改apache编程参数
MaxClients 2000 //并发连接数
相关文章推荐
- Apache2.2 提示the requested operation has failed并无法启动
- PHP7与Apache2.4关联配置
- linux 下 Apache 安装
- 解决ubuntu中apache2的url大小写敏感问题。
- 基于Linux安装Apache环境搭建过程及报错解决方案
- 《PHPMySQL和Apache编程导学》
- Apache-Maven学习(转)
- Apache Rewrite的主要功能
- linux下安装apache+php详解
- Apache 2.4. 源码编译安装详解
- java.lang.ClassNotFoundException: org.apache.xmlbeans.XmlOptions
- linux上apache并发数与服务器内存关系计算!
- CentOS下Apache虚拟主机VirtualHost配置
- 使用Apache JMeter压测Thrift
- Apache的DBUtils框架学习
- apache root权限的获取
- Apache遇到的问题:APR not found
- CentOS安装apache,MysqL,PHP
- apache日志
- org.apache.jasper.jasperException