銝 Apache 撖阡雿賣臭誑臬憭 process 憭 process瑁蝔撘璅∠嚗蝔梁 脰嚗蝔梁 MPM (Mutil-Processing Module)
MPM 拍車嚗prefork worker
隞交函蝟餌絞(top)嚗啁 httpd2-prefork worker 嗅祕撠望 apache 瑁蝔撘
冽祆撠 prefork performance tuning 雿閮隢
質身摰瑼其 Linux distribution 航賣銝靘憒 SUSE/openSUSE 臬 /etc/apache2/server-tuning.conf
質身摰瑼其 Linux distribution 航賣銝靘憒 SUSE/openSUSE ServerLimit 150 臬 /etc/apache2/server -tuning.conf
Apache 撖阡雿嚗嗅祕賣臭誑5
g Module)
MPM 拍車嚗prefork worker
隞交函蝟餌絞(top)嚗啁 httpd2-prefork worker 嗅祕撠望 apache 瑁蝔撘
冽祆撠 prefo10000
銝祈身摰
臭誑擃隞乩閮剖嚗
銝 MaxClients)
StartServers 5 (apache 銝瑁 process賂銋撠望臬臬 request )
MinSpareServers MaxSpareServers 1 128
nts 150 (摰寧摰蝢拙停胯憭批臬 connection 詻)
MaxRequestsPerChild 10000 (銝Apache severkage)
</IfModule>
蝪∟閮銋嚗賡嗡蜓閬航矽 ServerLimit MaxClient銝蝑閬箏敺憒荔鋆∠ Server 16
tChild嚗嗅祕賣臬銝隞嗡鈭血喉銝 Apache Process
賡塚臭誑擃隞乩閮剖嚗
<IfModule prefork.c>
# number of server processes to start
# http://httppache.org/docs/2.2/ 64
common.html#startservers
StartServers 128
# minimum number of server processes which are kept spare
# http://httpd.apache.org/docs2/mod/prefork.html 2048
ervers
MinSpareServers 16
# maximum number of server processes which are kept spare
# http://httpd.apache.orocs/2.2/mod/prefor 2048
spareservers
MaxSpareServers 64
# highest possible MaxClients setting for the lifetime of the Apache process.
# http:MaxRequestsPerChild 10000
m_common.html#serverlimit
ServerLimit 2048
# maximum number of server pro甇文嚗撠 SUSE Linux sses allowE Linux 銝臭誑雿鞎頛憭抒嚗銝閬撘 aod_module
AOD Art of Defense 憒函 web server 蝔撘冽啣神撠望瘜冽 SQL injection Cross-Stie Scripting 蝑餅閰梧瘝隞暻潭餅鈭隞嗥(銝賡瘙撣賊)臭誑桐閬 load AOD module
AOD 閮剖瑼 /etc/apache2/conf.d/aod.conf
蝪∪桐隤芣 aod.conf 批捆 mark 韏瑚撠勗末鈭銝銝 aod.conf 批捆嚗嗅祕皛踹末
蝑鈭箇鈭綽銝瑁 aod module 嚗賢嗾銋敹思
隞 ab2 -c 1000 -n 10000 http://localhost/index.html 皜祈岫箔
祉撟喳 1-3 蝘銝瑁 aod 敺嚗撟喳芾 300~400 ms 撌血喋臭誑亙 concurrent request 銋憭批(憭扯游停臭 Apache MaxClients 閮剖)
敺銋臭璅嚗 apache server 隢 stop start
蝡嚗
Apache MPM prefork (摰寞隞)
ApachePreFork MPM (2008)
賊蝡嚗
靽格迤 Apache Worker MPM APC 閮剖 (2007)