发新话题
打印

[apache] Prefork.c模式。[已解决]

Prefork.c模式。[已解决]

Server version: Apache/2.0.63
<IfModule prefork.c>
    StartServers 5
    MinSpareServers 5
    MaxSpareServers 10
    MaxClients 256
    MaxRequestsPerChild 0
</IfModule>
这是默认环境,我更改了MaxClients 2000,重启Apche 里报错:WARNING: MaxClients of 2000 exceeds ServerLimit value of 256 servers,lowering MaxClients to 256. To increase, please see the ServerLimit directive.我修改上面配置后如下所示:

<IfModule prefork.c>
    StartServers 5
    MinSpareServers 5
    MaxSpareServers 10
    MaxClients 2000
    ServerLimit  25
   ThreadsPerChild  80   
   MaxRequestsPerChild 0
</IfModule>
重启Apache时报错:
WARNING: MaxClients of 2000 exceeds ServerLimit value of 256 servers,
lowering MaxClients to 256. To increase, please see the ServerLimit
directive.Syntax error on line 69 of /usr/local/apache/conf/httpd.conf:
Invalid command 'ThreadsPerChild', perhaps mis-spelled or defined by a module not included in the server configuration.
或者我不加ThreadsPerChild里仍然报第一处的警告。帮忙分析一下原因,随便问一下是不是MaxClients设定的值一般是ThreadsPerChild 和ServerLimit相乘的积?看网上说ServerLimit 最好不要超过25。
方向比努力重要,能力比知识重要,健康比成绩重要,生活比文凭重要,情商比智商重要!

TOP

如:
ServerLimit 1024
MaxClients 1000

你应该好好理解一下ServerLimit就像一个木桶,用他来装MaxClients这个水,所以ServerLimit一定要大于MaxClients
而且ServerLimit需要放在MaxClients上面,更确切的说ServerLimit允许的最大总进程数阀值
积极!努力!低调!百折不挠!http://www.linuxtone.org
分享才能进步!帮助他人就是在帮助自己! 共同学习探讨Linux!
  Linux= howto+man ! ^_^

TOP

发新话题