BSD上Apache性能的調整(2)_Windows教程

      編輯Tag賺U幣
      教程Tag:暫無Tag,歡迎添加,賺取U幣!
      maxusers對其他kernel參數產生影響:
      • 進程的最大數目
      • 每個用戶進程的最大數目
      • 系統打開文件數目限制
      • 每個用戶打開文件數目限制
      • mbuf clusters最大數目
      • Proc/pgrp hash表大小
        這些引申參數的定義公式在/usr/src/sys/conf/param.c中。這些計算出來的參數部分會被kernel配置文建里自己定義的值覆蓋:

      # Network options. NMBCLUSTERS defines the number of mbuf clusters and
      # defaults to 256. This machine is a server that handles lots of traffic,
      # so we crank that value.
      options NMBCLUSTERS=4096 # mbuf clusters at 4096


      #
      # Misc. options
      #
      options CHILD_MAX=512 # maximum number of child processes
      options OPEN_MAX=512 # maximum fds (breaks RPC svcs
      )

        在許多情況下,NMBCLUSTERS應該設置的比第一眼看上去需要設置的值大的多。這是因為如果瀏覽器在傳輸中中斷了連接,與特定連接相關的socket fd要在TIME_WAIT狀態等幾分鐘才釋放,在等待時mbuf并沒有釋放。另外,在服務器的timeouts中,一些連接會停留在FIN_WAIT_2狀態,這個狀態不會超時,瀏覽器又不會發出最終的FIN信號。

        關于mbuf clusters更多的信息(From sys/mubf.h)

      /*
      * Mbufs are of a single size, MSIZE (machine/machparam.h), which
      * includes overhead. An mbuf may add a single "mbuf cluster" of size
      * MCLBYTES (also in machine/machparam.h), which has no additional overhead
      * and is used instead of the internal data area; this is done when
      * at least MINCLSIZE of data must be stored.
      */

      來源:網絡搜集//所屬分類:Windows教程/更新時間:2013-04-16
      相關Windows教程