[文章作者:张宴 本文版本:v1.1 最后修改:2007.07.27 转载请注明出处:http://blog.zyan.cc]

  这两天搭建了一组Apache服务器,每台服务器4G内存,采用的是prefork模式,一开始设置的连接数太少了,需要较长的时间去响应用户的请求,后来修改了一下Apache 2.0.59的配置文件httpd.conf:
引用
# prefork MPM
# StartServers: number of server processes to start
# MinSpareServers: minimum number of server processes which are kept spare
# MaxSpareServers: maximum number of server processes which are kept spare
# MaxClients: maximum number of server processes allowed to start
# MaxRequestsPerChild: maximum number of requests a server process serves

StartServers         10
MinSpareServers      10
MaxSpareServers      15
ServerLimit          2000
MaxClients           2000
MaxRequestsPerChild  10000



  查看httpd进程数(即prefork模式下Apache能够处理的并发请求数):
  Linux命令:
引用
ps -ef | grep httpd | wc -l

  返回结果示例:
  1388
  表示Apache能够处理1388个并发请求,这个值Apache可根据负载情况自动调整,我这组服务器中每台的峰值曾达到过2002。


  查看Apache的并发请求数及其TCP连接状态:
  Linux命令:
引用
netstat -n | awk '/^tcp/ {++S[$NF]} END {for(a in S) print a, S[a]}'

  (这条语句是从技术总监王老大那儿获得的,非常不错)
  返回结果示例:
  LAST_ACK 5
  SYN_RECV 30
  ESTABLISHED 1597
  FIN_WAIT1 51
  FIN_WAIT2 504
  TIME_WAIT 1057
  其中的SYN_RECV表示正在等待处理的请求数;ESTABLISHED表示正常数据传输状态;TIME_WAIT表示处理完毕,等待超时结束的请求数。


  关于TCP状态的变迁,可以从下图形象地看出:
  点击在新窗口中浏览此图片  
  状态:描述
  CLOSED:无连接是活动的或正在进行
  LISTEN:服务器在等待进入呼叫
  SYN_RECV:一个连接请求已经到达,等待确认
  SYN_SENT:应用已经开始,打开一个连接
  ESTABLISHED:正常数据传输状态
  FIN_WAIT1:应用说它已经完成
  FIN_WAIT2:另一边已同意释放
  ITMED_WAIT:等待所有分组死掉
  CLOSING:两边同时尝试关闭
  TIME_WAIT:另一边已初始化一个释放
  LAST_ACK:等待所有分组死掉


Tags: , ,



技术大类 » Web服务器 | 评论(67) | 引用(0) | 阅读(138257)
coach88888888 Email
2012-8-13 17:33
If you desire to go to Coach Factory Outlet, but have no idea in which to go, you can research online. It is no doubt that there is drastically information and details about it for the reference.Coach Factory Online are loved by many people, when you walk in the street, you could see many people take coach styles.hat experts claim Coach Outlet Online shopping is in the changes they are available in.Coach Outlet will send you a coupon in the post to use in their upon only after you type a achieve. The Coach bags are customarily somewhat many than the ones in the stores.
baozang
2012-9-22 11:57
Lamo - Like Sebago, Louis Vuitton Canada  there are only about 40 styles of Lamo Footwear.  Most of their footwear uses a suede leather traditional in True Religion Jeans  moccasins, though only about 1/3 of the footwear collection is a traditional moccasin look. True Religion Brand Jeans The rest of the collection is slippers and UGG styled boots.Louis Vuitton Artsy The traditional moccasins do have a soft rubber sole making them great deck True Religion Sale shoes as well, however. Expect to pay between $50 and $60 for Lamo moccasins.
GASDFWE
2013-3-5 13:46
买轴承就到:www.jkzhoucheng.cn
beiji
2013-3-7 00:07
ps -ef | grep httpd | wc -l

这个值我服务 返回 只有 5 ,是不是说明我服务器能处理的并发只有 5个,如果是就太少了吧 ?是不是设置哪里有问题?
django Email Homepage
2013-11-30 19:45
Uggs Sale the ideal idea Coach Outlet Online  enough time to search for many of reduction Ugg boot. Like big portions? If you began ready your apartment, Coach Outlet  it's always best to consider the most effective way direct to the stage it could be to utilise your inventory throughout Coach Factory Outlet  concern, or maybe you basically won't destination stuff not enough.we're anti- whitening tray because Coach Outlet Online  i will be enjoy just get germ dog breeders
cctoh
2015-11-3 15:17
シャネルかばんがその誕生から刻まれるのが行った派手で、クラシック、魅力のシンボル、シャネル偽物そのため国内で多くのレディースもあるのがこのブランドの忠実なファンで、シャネルはそれがレディースの派手なだけではないのにあげるため、シャネル偽物気高くて、更にいくらでもある金銭の代名詞。シャネルの女性はこんなに人気がありを包んでただブランドの上からみんなに崇拝するなぜことができるのかだけではなくてシャネル眼鏡コピー、なぜかというと巧みで完璧な制作技術で、完璧な設計は評判の飾りをさらに加えて、だからやっとずっと大衆のシャネル偽物消費者に好きになられた。
abrahamlincoln Email Homepage
2019-1-11 10:21
[url=Hotmail]https://hotmailwiki.com/hotmail-login[/url] is the second most used emailing service behind Google’s Gmail, with more than half a billion users worldwide. If you just get started to Hotmail, click [url=https://hotmailwiki.com/hotmail-login]Hotmail login[/url] to create new account.
abrahamlincoln Email Homepage
2019-1-11 10:23
https://hotmailwiki.com/hotmail-login is the second most used emailing service behind Google’s Gmail, with more than half a billion users worldwide. Click https://hotmailwiki.com/hotmail-login to create new account free.
Steve
2021-6-9 13:16
Pediatrics is the branch of medicine that involves the medical care of infants, children, and adolescents. MaxRemind top rank medical billing company USA offers <a href="https://mremind.com/specialities/pediatric-billing">Pediatric Medical Billing Services company usa</a> and medical credentialing services to Pediatrics physicians in all states of USA at lowest rates.
shz Email
2022-6-28 21:15
Very interesting blog. Alot of blogs I see these days don't really provide anything that I'm interested in, but I'm most definately interested in this one. Just thought that I would post and let you know.  online dealings
shz Email
2022-6-28 21:20
Your blog provided us with valuable information to work with. Each & every tips of your post are awesome. Thanks a lot for sharing. Keep blogging,  online dealings
shz Email
2022-6-28 21:24
Mmm.. good to be here in your article or post, whatever, I think I should also work hard for my own website like I see some good and updated working in your site.  online dealings
shz Email
2022-6-28 21:28
Cool stuff you have and you keep overhaul every one of us  online dealings
shz Email
2022-6-28 21:33
Gangaur Realtech is a professionally managed organisation specializing in real estate services where integrated services are provided by professionals to its clients seeking increased value by owning, occupying or investing in real estate.  online dealings
nanalyly072 Email
2022-7-29 10:26
octordle is an open source web server designed to handle heavy loads by utilizing multiple CPUs and/or cores.
shz Email
2022-8-27 22:10
It has fully emerged to crown Singapore's southern shores and undoubtedly placed her on the global map of residential landmarks. I still scored the more points than I ever have in a season for GS. I think you would be hard pressed to find somebody with the same consistency I have had over the years so I am happy with that.  How To Make 10k A Month
shz Email
2022-8-27 22:14
You actually make it look so easy with your performance but I find this matter to be actually something which I think I would never comprehend. It seems too complicated and extremely broad for me. I'm looking forward for your next post, I’ll try to get the hang of it!  How To Make $500 A Day (Complete Guide)
shzz Email
2022-8-27 22:15
Superbly written article, if only all bloggers offered the same content as you, the internet would be a far better place..  Vodyssey
shz Email
2022-8-27 22:19
Truly, this article is really one of the very best in the history of articles. I am a antique ’Article’ collector and I sometimes read some new articles if I find them interesting. And I found this one pretty fascinating and it should go into my collection. Very good work!  How To Make $500 A Day (Complete Guide)
分页: 3/4 第一页 上页 1 2 3 4 下页 最后页
发表评论
表情
emotemotemotemotemot
emotemotemotemotemot
emotemotemotemotemot
emotemotemotemotemot
emotemotemotemotemot
打开HTML
打开UBB
打开表情
隐藏
记住我
昵称   密码   游客无需密码
网址   电邮   [注册]