echo ""; echo ""; echo ""; echo ""; if(!is_admin){echo "";} » Apache配置最大并发用户数 仲子说

2008-04-25

Apache配置最大并发用户数

Posted in Apache at 19:57 Author:仲远

标签:

Apache?????? 8.15 

Apache??????????????????MPM?????./configure –with-mpm=MPM?????????prefork?worker???MPM???

Prefork
????“–with-mpm”??????MPM?prefork??Unix??????MPM?????????????????????????????????????????make???make install??????httpd -l????????
MPM?prefork.c???httpd-mpm.conf??????????????????
<IfModule prefork.c>
StartServers 5
MinSpareServers 5
MaxSpareServers 10
MaxClients 150
MaxRequestsPerChild 0
</IfModule>
prefork?????????“StartServers”??????????MinSpareServers??????????????????????????????????????……?????????????????????32??????MinSpareServers????????????????????????????????????????????MaxSpareServers?????????????????????????Apache???kill?????????????????????????MinSpareServers??Apache????????MinSpareServers+1?????????????????MinSpareServers?MaxSpareServers?MaxRequestsPerChild??????????????????????????“MaxRequestsPerChild”??????????0?????????????????????0??????????????????????????????????1????????????2?????????????????????????????????????????MaxClients??????????????????Apache????????????Apache??????????????150???????????????????????ps -ef|grep http|wc -l??????????????????????????????????????????HTTP??????????????????????????????????Apache?????????256?ServerLimit???????Apache?????MaxClients?ServerLimt??????????????????????(?????)?
<IfModule prefork.c>
ServerLimit  10000
StartServers 5
MinSpareServers 5
MaxSpareServers 10
MaxClients 10000
MaxRequestsPerChild 0
</IfModule>

Worker
???prefork?worker?????????????????MPM????????????????????????????????????????????????worker????????????????????????????????????configure –with-mpm=worker????make???make install?????????httpd-mpm.conf??????????
<IfModule worker.c>
StartServers 2
MaxClients 150
MinSpareThreads 25
MaxSpareThreads 75
ThreadsPerChild 25
MaxRequestsPerChild 0
</IfModule>
Worker????????“StartServers”????????????????ThreadsPerChild??????????????????????????????????MinSpareThreads?MaxSpareThreads????????????????MaxClients????????clients??????????????????????????????????????MinSpareThreads?MaxSpareThreads?????????75?250???????Apache??????????????????????ThreadsPerChild?worker MPM?????????????ThreadsPerChild???????64????????64?????????????ThreadLimit???????????20000?Worker???????????????????????ThreadsPerChild???????????MaxClients?????????????????????????????????????????????16???????????ServerLimit?????20000????????????????ServerLimit??????ThreadsPerChild????????MaxClients???MaxClients???ThreadsPerChild???????Apache?????????????
<IfModule worker.c>
ServerLimit 25
ThreadLimit 200
StartServers 3
MaxClients 2000
MinSpareThreads 50
MaxSpareThreads 200
ThreadsPerChild 100
MaxRequestsPerChild 0
</IfModule>

?????Apache???????ab?Server???????(?????index???6bytes,Apache Server??2cpu 2G memory),cpu%?cpu????mem??????(M???)?RequestsPerSecond??????????
1?Prefor??
  (ServerLimit,StartServer,MinSpareServers,MaxSpareServers,MaxClients,MaxRequestPerChild)            

-n/-c(ab??) Cpu% Mem Requestspersecond
(?,5,5,10,150,0)
100000/100 28.8 285 8434
100000/200 29.2 304 8032
100000/500 25.3 323 7348
100000/1000 24.4 330 5886
(10000,5,5,10,500,0)
100000/100 28.7 371 8345
100000/200 27.4 389 7929
100000/500 24.9 417 7229
100000/1000 23.4 437 6676
(10000,5,5,10,1000,0)
100000/100 28.8 408 8517
100000/200 27.0 422 8045
100000/500 24.2 455 7236
100000/1000 22.5 470 6570
(10000,5,5,10,1500,0)
100000/100 29.6 330 8407
100000/200 28.1 349 8014
100000/500 26.4 380 7290
100000/1000 24.0 400 6686

2?Worker??
(ServerLimt,Threadlimt,Startservers,MaxClients,MinspareThread,MaxspareThread,ThreadperChild,MaxRequestPerChild)
                   

-n/-c(ab??) cpu% mem RequestsperSecond
(50,500,5,10000,50,200,200,0)
100000/100  18.6 188 6020
100000/200 20.1 195 5892
100000/500 19.8 209 5708
100000/1000 22.2 218 6081
(100,500,5,10000,50,200,100,0)
100000/100  24.5 240 6919
100000/200 23.6 247 6798
100000/500 24.6 254 6827
100000/1000 22.3 271 6114
(200,500,5,10000,50,200,50,0)
100000/100  27.3 301 7781
100000/200 27.4 307 7789
100000/500 26.0 320 7141
100000/1000 21.8 344 6110

?????prefork????????worker???????cpu?memory??????woker?

Trackback: http://tb.donews.net/TrackBack.aspx?PostId=1001408

本文可以自由转载,转载时请保留全文并注明出处:
转载自仲子说 [ http://www.wangzhongyuan.com/ ]
原文链接:

1 Comment »

  1. kalpa somatropin said,

    2016年July22日 at 13:54

    […] Pingback Pingback Pingback Pingback Pingback Pingback Pingback Pingback Pingback Pingback Pingback Pingback Search for Steroids Search […]

Leave a Comment

*
To prove you're a person (not a spam script), type the security text shown in the picture. Click here to regenerate some new text.
Click to hear an audio file of the anti-spam word