Centos

openvz 容器優化

  • February 25, 2018

我正在嘗試基於 Centos 5.9 Final 64 Bit Distribution 在 64 GB ram、16 核處理器上優化 14 個容器

伺服器的平均負載高達 300

這是我的記憶統計

# vzmemcheck -v
Output values in %
CTID        LowMem  LowMem     RAM MemSwap MemSwap   Alloc   Alloc   Alloc
             util  commit    util    util  commit    util  commit   limit
101           0.04   13.85    0.47    0.34    6.31    0.58    6.31    8.62
200           0.04   13.85    0.50    0.36    5.16    0.82    5.16    6.01
130           0.03   13.85    0.34    0.24    5.16    0.62    5.16    5.74
109           0.02    0.08    0.08    0.05    0.14    0.25    0.17    0.33
105           0.04   13.85    0.49    0.36    6.31    0.95    6.31    6.01
104           0.03   13.85    0.20    0.14    5.16    0.38    5.16    4.39
103           0.04    0.08    0.60    0.43    0.14    0.65    0.17    3.78
102           0.03    0.08    0.35    0.25    0.14    0.49    0.17    0.58
210           0.05   13.85    0.78    0.56   17.84    0.90   17.84   13.23
190           0.03    0.08    0.37    0.27    0.14    0.59    0.17    2.03
215           0.04   13.85    0.49    0.36    4.30    0.57    4.30    5.16
160           0.01    0.08    0.10    0.07    0.14    0.20    0.17    3.78
150           0.04    0.08    0.39    0.28    0.14    0.56    0.17    2.03
140           0.03    0.08    0.26    0.19    0.14    0.39    0.17    2.09
110           0.12   13.85    0.99    0.72    6.31    1.35    6.31   13.23
--------------------------------------------------------------------------
Summary:      0.58  111.39    6.41    4.64   57.52    9.31   57.76   76.99

vzubc 輸出

# vzubc
----------------------------------------------------------------
CT 101       | HELD Bar% Lim%| MAXH Bar% Lim%| BAR | LIM | FAIL
-------------+---------------+---------------+-----+-----+------
    kmemsize|10.7M 0.5% 0.5%|23.8M   1%   1%|   2G|   2G|    -
 lockedpages|  22M 0.6% 0.6%|  22M 0.6% 0.6%|3.81G|3.81G|    -
 privvmpages| 623M  15%  15%|2.03G  50%  50%|   4G|   4G|    -
    shmpages| 608K   -    - |1.62M 0.1% 0.1%|   2G|   2G|    -
     numproc|  98    -    - | 223    -    - | 976K| 976K|    -
   physpages| 312M   -    - | 680M   -    - |   - |   - |    -
 vmguarpages|   -    -    - |   -    -    - |   2G|   - |    -
oomguarpages| 312M  15%   - | 680M  33%   - |   2G|   - |    -
  numtcpsock|  40    -    - | 154    -    - |7.63M|7.63M|    -
    numflock|  25    -    - |  47    -    - | 976K| 976K|    -
      numpty|   -    -    - |   2    -    - | 488K| 488K|    -
  numsiginfo|   -    -    - |  24    -    - | 976K| 976K|    -
   tcpsndbuf| 888K 0.4% 0.2%|3.51M   2% 0.9%| 204M| 378M|    -
   tcprcvbuf| 640K 0.3% 0.2%|10.6M   5%   2%| 204M| 378M|    -
othersockbuf| 103K   -    - |2.42M   1% 0.6%| 204M| 378M|    -
 dgramrcvbuf|   -    -    - | 233K 0.1% 0.1%| 204M| 378M|    -
numothersock|  65    -    - | 207    -    - |7.63M|7.63M|    -
  dcachesize| 835K   -    - |5.05M 0.2% 0.2%|   2G|   2G|    -
     numfile|3.47K   -    - |9.86K   -    - |22.9M|22.9M|    -
   numiptent|  80    -    - |  80    -    - | 976K| 976K|    -
   swappages|   -    -    - |   4K   -    - |   - |   - |    -

----------------------------------------------------------------
CT 200       | HELD Bar% Lim%| MAXH Bar% Lim%| BAR | LIM | FAIL
-------------+---------------+---------------+-----+-----+------
    kmemsize|11.3M 0.6% 0.6%|28.9M   1%   1%|   2G|   2G|    -
 lockedpages|  22M 0.6% 0.6%|22.1M 0.6% 0.6%|3.81G|3.81G|    4
 privvmpages| 741M  74%  41%|1.16G 119%  66%| 997M|1.74G|   78K
    shmpages| 259M  25%  25%| 519M  50%  50%|   1G|   1G|    -
     numproc|  72    -    - | 135    -    - | 976K| 976K|    -
   physpages| 328M   -    - | 636M   -    - |   - |   - |    -
 vmguarpages|   -    -    - |   -    -    - |   1G|   - |    -
oomguarpages| 328M  32%   - | 636M  62%   - |   1G|   - |    -
  numtcpsock|  32    -    - | 276    -    - |7.63M|7.63M|    -
    numflock|  18    -    - |  36    -    - | 976K| 976K|    -
      numpty|   -    -    - |   1    -    - | 488K| 488K|    -
  numsiginfo|   -    -    - |  28    -    - | 976K| 976K|    -
   tcpsndbuf| 603K 0.3% 0.2%|8.93M   4%   2%| 204M| 378M|    -
   tcprcvbuf| 512K 0.2% 0.1%|4.31M   2%   1%| 204M| 378M|    -
othersockbuf|68.7K   -    - | 921K 0.4% 0.2%| 204M| 378M|    -
 dgramrcvbuf|   -    -    - |17.9K   -    - | 204M| 378M|    -
numothersock|  43    -    - |  95    -    - |7.63M|7.63M|    -
  dcachesize| 730K   -    - | 943K   -    - |   2G|   2G|    -
     numfile|   3K   -    - |3.49K   -    - |22.9M|22.9M|    -
   numiptent|  57    -    - |  57    -    - | 976K| 976K|    -
   swappages|   -    -    - |   -    -    - |   - |   - |    -

----------------------------------------------------------------
CT 130       | HELD Bar% Lim%| MAXH Bar% Lim%| BAR | LIM | FAIL
-------------+---------------+---------------+-----+-----+------
    kmemsize|6.94M 0.3% 0.3%|35.1M   2%   2%|   2G|   2G|    -
 lockedpages|  22M 0.6% 0.6%|22.1M 0.6% 0.6%|3.81G|3.81G|    -
 privvmpages| 531M  34%  34%|4.01G 267% 267%| 1.5G| 1.5G|  459K
    shmpages|32.6M   3%   3%|65.1M   6%   6%|   1G|   1G|    -
     numproc|  73    -    - | 384    -    - | 976K| 976K|    -
   physpages| 207M   -    - |2.62G   -    - |   - |   - |    -
 vmguarpages|   -    -    - |   -    -    - |   1G|   - |    -
oomguarpages| 207M  20%   - |2.62G 262%   - |   1G|   - |    -
  numtcpsock|  25    -    - | 166    -    - |7.63M|7.63M|    -
    numflock|  20    -    - | 121    -    - | 976K| 976K|    -
      numpty|   -    -    - |   2    -    - | 488K| 488K|    -
  numsiginfo|   -    -    - | 115    -    - | 976K| 976K|    -
   tcpsndbuf| 432K 0.2% 0.1%|8.79M   4%   2%| 204M| 378M|    -
   tcprcvbuf| 400K 0.2% 0.1%|2.59M   1% 0.7%| 204M| 378M|    -
othersockbuf|75.3K   -    - |4.26M   2%   1%| 204M| 378M|    -
 dgramrcvbuf|   -    -    - |33.3K   -    - | 204M| 378M|    -
numothersock|  46    -    - | 239    -    - |7.63M|7.63M|    -
  dcachesize| 703K   -    - |7.62M 0.4% 0.4%|   2G|   2G|    -
     numfile|1.77K   -    - |12.1K 0.1% 0.1%|22.9M|22.9M|    -
   numiptent|  55    -    - |  70    -    - | 976K| 976K|    -
   swappages|   -    -    - |   4K   -    - |   - |   - |    -

----------------------------------------------------------------
CT 109       | HELD Bar% Lim%| MAXH Bar% Lim%| BAR | LIM | FAIL
-------------+---------------+---------------+-----+-----+------
    kmemsize|3.71M  27%  26%|11.5M  83%  81%|13.7M|14.1M|    -
 lockedpages|   -    -    - |22.1M 275% 275%|   8M|   8M|    4
 privvmpages| 216M  84%  79%|   1G 400% 376%| 256M| 272M|  894
    shmpages|   4K   -    - |3.23M   3%   3%|  84M|  84M|   14
     numproc|  37   15%  15%| 107   44%  44%| 240 | 240 |    -
   physpages|44.4M   -    - | 369M   -    - |   - |   - |    -
 vmguarpages|   -    -    - |   -    -    - | 132M|   - |    -
oomguarpages|44.4M  43%   - | 369M 362%   - | 102M|   - |    -
  numtcpsock|  19    5%   5%|  61   16%  16%| 360 | 360 |    -
    numflock|  16    8%   7%|  30   16%  14%| 188 | 206 |    -
      numpty|   -    -    - |   1    1%   1%| 100 | 100 |    -
  numsiginfo|   -    -    - |  60   23%  23%| 256 | 256 |    -
   tcpsndbuf| 188K  11%   7%|1.02M  62%  39%|1.64M|2.58M|    -
   tcprcvbuf| 192K  11%   7%|1.65M 100%  64%|1.64M|2.58M| 1.24K
othersockbuf|64.9K   5%   3%| 177K  16%   8%|1.07M|   2M|    -
 dgramrcvbuf|   -    -    - |21.4K   8%   8%| 256K| 256K|    -
numothersock|  36   10%  10%|  61   16%  16%| 360 | 360 |    -
  dcachesize| 504K  15%  14%| 794K  23%  22%|3.25M|3.46M|    -
     numfile|1.14K  12%  12%|3.19K  35%  35%|9.09K|9.09K|    -
   numiptent|  66    6%   6%|  80    8%   8%|1000 |1000 |    -
   swappages|   -    -    - |   4K   -    - |   - |   - |    -

----------------------------------------------------------------
CT 105       | HELD Bar% Lim%| MAXH Bar% Lim%| BAR | LIM | FAIL
-------------+---------------+---------------+-----+-----+------
    kmemsize|11.3M 0.6% 0.6%|73.1M   3%   3%|   2G|   2G|    -
 lockedpages|  22M 0.6% 0.6%|22.1M 0.6% 0.6%|3.81G|3.81G|    4
 privvmpages| 888M  89%  50%|4.06G 416% 233%| 997M|1.74G| 50.3K
    shmpages| 259M  12%  12%| 519M  25%  25%|   2G|   2G|    -
     numproc|  90    -    - | 566  0.1% 0.1%| 976K| 976K|    -
   physpages| 323M   -    - |1.66G   -    - |   - |   - |    -
 vmguarpages|   -    -    - |   -    -    - |   2G|   - |    -
oomguarpages| 323M  15%   - |1.66G  82%   - |   2G|   - |    -
  numtcpsock|  42    -    - | 309    -    - |7.63M|7.63M|    -
    numflock|  20    -    - |  39    -    - | 976K| 976K|    -
      numpty|   -    -    - |   2    -    - | 488K| 488K|    -
  numsiginfo|   -    -    - | 114    -    - | 976K| 976K|    -
   tcpsndbuf| 721K 0.3% 0.2%|5.51M   2%   2%| 204M| 378M|    -
   tcprcvbuf| 672K 0.3% 0.2%|5.98M   2%   2%| 204M| 378M|    -
othersockbuf|86.6K   -    - | 4.9M   2%   1%| 204M| 378M|    -
 dgramrcvbuf|   -    -    - | 137K 0.1%   - | 204M| 378M|    -
numothersock|  63    -    - | 409    -    - |7.63M|7.63M|    -
  dcachesize| 768K   -    - |2.16M 0.1% 0.1%|   2G|   2G|    -
     numfile|2.93K   -    - |8.43K   -    - |22.9M|22.9M|    -
   numiptent|  80    -    - |  80    -    - | 976K| 976K|    -
   swappages|   -    -    - |   -    -    - |   - |   - |    -

----------------------------------------------------------------
CT 104       | HELD Bar% Lim%| MAXH Bar% Lim%| BAR | LIM | FAIL
-------------+---------------+---------------+-----+-----+------
    kmemsize|6.21M 0.3% 0.3%|22.4M   1%   1%|   2G|   2G| 7.31K
 lockedpages|  22M 0.6% 0.6%|22.1M 0.6% 0.6%|3.81G|3.81G|   16
 privvmpages| 319M  93%  93%|1.51G 452% 452%| 340M| 340M|  101K
    shmpages| 608K 0.1% 0.1%| 260M  25%  25%|   1G|   1G|    -
     numproc|  72    -    - | 259    -    - | 976K| 976K|    -
   physpages| 124M   -    - | 507M   -    - |   - |   - |    -
 vmguarpages|   -    -    - |   -    -    - |   1G|   - |    -
oomguarpages| 124M  12%   - | 507M  49%   - |   1G|   - |    -
  numtcpsock|  39    -    - | 154    -    - |7.63M|7.63M|    -
    numflock|   6    -    - |  31    -    - | 976K| 976K|    -
      numpty|   -    -    - |   2    -    - | 488K| 488K|    -
  numsiginfo|   -    -    - |  84    -    - | 976K| 976K|    -
   tcpsndbuf| 699K 0.3% 0.2%|2.28M   1% 0.6%| 204M| 378M|    -
   tcprcvbuf| 624K 0.3% 0.2%| 5.1M   2%   1%| 204M| 378M|    -
othersockbuf|68.7K   -    - |1.23M 0.6% 0.3%| 204M| 378M|  310
 dgramrcvbuf|   -    -    - | 390K 0.2% 0.1%| 204M| 378M|    -
numothersock|  43    -    - | 145    -    - |7.63M|7.63M|    -
  dcachesize| 579K   -    - | 967K   -    - |   2G|   2G|    -
     numfile|1.53K   -    - |4.49K   -    - |22.9M|22.9M|    -
   numiptent|  55    -    - |  80    -    - | 976K| 976K|    -
   swappages|   -    -    - |   4K   -    - |   - |   - |    -

----------------------------------------------------------------
CT 103       | HELD Bar% Lim%| MAXH Bar% Lim%| BAR | LIM | FAIL
-------------+---------------+---------------+-----+-----+------
    kmemsize|8.84M  64%  62%|19.3M 140% 136%|13.7M|14.1M|  462
 lockedpages|   -    -    - |22.1M 275% 275%|   8M|   8M|   24
 privvmpages| 568M  22%  17%|   2G  79%  61%| 2.5G|3.26G|  6.3K
    shmpages| 608K 0.7% 0.7%| 264M 315% 315%|  84M|  84M|    7
     numproc|  62   25%  25%| 133   55%  55%| 240 | 240 |    -
   physpages| 378M   -    - | 579M   -    - |   - |   - |    -
 vmguarpages|   -    -    - |   -    -    - | 132M|   - |    -
oomguarpages| 378M 371%   - | 579M 568%   - | 102M|   - |    -
  numtcpsock|  30    8%   8%|  91   25%  25%| 360 | 360 |    -
    numflock|  39   20%  18%|  84   44%  40%| 188 | 206 |    -
      numpty|   -    -    - |   2    2%   2%| 100 | 100 |    -
  numsiginfo|   -    -    - |  55   21%  21%| 256 | 256 |    -
   tcpsndbuf| 207K  12%   7%|5.45M 331% 211%|1.64M|2.58M|  733K
   tcprcvbuf| 209K  12%   7%|4.18M 254% 162%|1.64M|2.58M|  981
othersockbuf|74.7K   6%   3%| 479K  43%  23%|1.07M|   2M|    -
 dgramrcvbuf|   -    -    - |16.6K   6%   6%| 256K| 256K|    -
numothersock|  44   12%  12%|  72   20%  20%| 360 | 360 |    -
  dcachesize| 762K  22%  21%|3.56M 109% 103%|3.25M|3.46M|    -
     numfile| 1.7K  18%  18%|7.69K  84%  84%|9.09K|9.09K|    -
   numiptent|  80    8%   8%|  80    8%   8%|1000 |1000 |    -
   swappages|   -    -    - |   4K   -    - |   - |   - |    -

----------------------------------------------------------------
CT 102       | HELD Bar% Lim%| MAXH Bar% Lim%| BAR | LIM | FAIL
-------------+---------------+---------------+-----+-----+------
    kmemsize|6.71M  49%  47%|79.8M 582% 566%|13.7M|14.1M| 6.61K
 lockedpages|   -    -    - |22.1M 275% 275%|   8M|   8M|   48
 privvmpages| 435M  96%  88%|4.06G 921% 848%| 450M| 489M| 91.9K
    shmpages| 608K 0.7% 0.7%| 519M 618% 618%|  84M|  84M|    6
     numproc|  56   23%  23%| 570  237% 237%| 240 | 240 |    -
   physpages| 223M   -    - |1.68G   -    - |   - |   - |    -
 vmguarpages|   -    -    - |   -    -    - | 132M|   - |    -
oomguarpages| 223M 218%   - |1.68G 1688%   - | 102M|   - |    -
  numtcpsock|  40   11%  11%| 334   92%  92%| 360 | 360 |    -
    numflock|  66   35%  32%| 172   91%  83%| 188 | 206 |    -
      numpty|   -    -    - |   1    1%   1%| 100 | 100 |    -
  numsiginfo|   -    -    - | 112   43%  43%| 256 | 256 |    -
   tcpsndbuf| 202K  12%   7%|5.86M 357% 227%|1.64M|2.58M|    3
   tcprcvbuf| 230K  13%   8%|5.22M 318% 202%|1.64M|2.58M|    -
othersockbuf| 236K  21%  11%|3.73M 347% 186%|1.07M|   2M|  804
 dgramrcvbuf|   -    -    - | 356K 139% 139%| 256K| 256K|    -
numothersock|  50   13%  13%| 360  100% 100%| 360 | 360 |    -
  dcachesize| 907K  27%  25%|6.69M 205% 193%|3.25M|3.46M|    -
     numfile|1.87K  20%  20%|11.1K 121% 121%|9.09K|9.09K|    -
   numiptent|  80    8%   8%|  80    8%   8%|1000 |1000 |    -
   swappages|   -    -    - |   4K   -    - |   - |   - |    -

----------------------------------------------------------------
CT 210       | HELD Bar% Lim%| MAXH Bar% Lim%| BAR | LIM | FAIL
-------------+---------------+---------------+-----+-----+------
    kmemsize|9.29M 0.5% 0.5%|28.3M   1%   1%|   2G|   2G| 12.1K
 lockedpages|  22M 0.6% 0.6%|22.1M 0.6% 0.6%|3.81G|3.81G|   12
 privvmpages| 906M  11%  11%|3.82G  47%  47%|   8G|   8G|  768K
    shmpages| 612K   -    - |3.16M   -    - |  12G|  12G|    -
     numproc|  87    -    - | 276    -    - | 976K| 976K|    -
   physpages| 559M   -    - |2.96G   -    - |   - |   - |    -
 vmguarpages|   -    -    - |   -    -    - |  12G|   - |    -
oomguarpages| 559M   4%   - |2.96G  24%   - |  12G|   - |    -
  numtcpsock|  55    -    - | 226    -    - |7.63M|7.63M|    -
    numflock|  11    -    - |  25    -    - | 976K| 976K|    -
      numpty|   -    -    - |   2    -    - | 488K| 488K|    -
  numsiginfo|   -    -    - | 211    -    - | 976K| 976K|    -
   tcpsndbuf|1.42M 0.7% 0.4%|11.4M   5%   3%| 204M| 378M|    -
   tcprcvbuf| 880K 0.4% 0.2%|4.45M   2%   1%| 204M| 378M|    -
othersockbuf|91.7K   -    - |2.13M   1% 0.6%| 204M| 378M|    -
 dgramrcvbuf|   -    -    - | 855K 0.4% 0.2%| 204M| 378M|    -
numothersock|  64    -    - | 206    -    - |7.63M|7.63M|    -
  dcachesize| 789K   -    - | 2.8M 0.1% 0.1%|   2G|   2G|    -
     numfile|2.07K   -    - |8.08K   -    - |22.9M|22.9M|    -
   numiptent|  57    -    - |  71    -    - | 976K| 976K|    -
   swappages|   -    -    - |   4K   -    - |   - |   - |    -

----------------------------------------------------------------
CT 190       | HELD Bar% Lim%| MAXH Bar% Lim%| BAR | LIM | FAIL
-------------+---------------+---------------+-----+-----+------
    kmemsize|8.08M  58%  57%|20.1M 146% 142%|13.7M|14.1M|    8
 lockedpages|   -    -    - |22.1M 275% 275%|   8M|   8M|   12
 privvmpages| 533M  53%  30%|3.36G 345% 193%| 997M|1.74G|  310K
    shmpages| 632K 0.7% 0.7%|1.77G 2159% 2159%|  84M|  84M|  822
     numproc|  70   29%  29%| 173   72%  72%| 240 | 240 |    -
   physpages| 243M   -    - | 576M   -    - |   - |   - |    -
 vmguarpages|   -    -    - |   -    -    - | 132M|   - |    -
oomguarpages| 243M 238%   - | 576M 565%   - | 102M|   - |    -
  numtcpsock|  25    6%   6%|  85   23%  23%| 360 | 360 |    -
    numflock|   7    3%   3%|  40   21%  19%| 188 | 206 |    -
      numpty|   -    -    - |   2    2%   2%| 100 | 100 |    -
  numsiginfo|   -    -    - |  61   23%  23%| 256 | 256 |    -
   tcpsndbuf| 205K  12%   7%|1.97M 120%  76%|1.64M|2.58M|    -
   tcprcvbuf| 208K  12%   7%|4.87M 296% 188%|1.64M|2.58M|    4K
othersockbuf|80.8K   7%   3%|1.24M 115%  62%|1.07M|   2M|    -
 dgramrcvbuf|   -    -    - |51.2K  20%  20%| 256K| 256K|    -
numothersock|  48   13%  13%| 178   49%  49%| 360 | 360 |    -
  dcachesize| 662K  19%  18%| 824K  24%  23%|3.25M|3.46M|    -
     numfile|1.65K  18%  18%|4.35K  47%  47%|9.09K|9.09K|    -
   numiptent|  28    2%   2%| 204   20%  20%|1000 |1000 |    -
   swappages|   -    -    - |   7M   -    - |   - |   - |    -

----------------------------------------------------------------
CT 215       | HELD Bar% Lim%| MAXH Bar% Lim%| BAR | LIM | FAIL
-------------+---------------+---------------+-----+-----+------
    kmemsize|8.56M 0.4% 0.4%|30.5M   2%   2%|   2G|   2G|    -
 lockedpages|  22M 0.6% 0.6%|22.1M 0.6% 0.6%|3.81G|3.81G|   12
 privvmpages| 483M  47%  47%|2.06G 205% 205%|   1G|   1G|  153K
    shmpages| 608K 0.2% 0.2%| 519M 202% 202%| 256M| 256M|   20
     numproc|  62    -    - | 175    -    - | 976K| 976K|    -
   physpages| 295M   -    - | 761M   -    - |   - |   - |    -
 vmguarpages|   -    -    - |   -    -    - | 256M|   - |    -
oomguarpages| 295M 115%   - | 761M 297%   - | 256M|   - |    -
  numtcpsock|  26    -    - | 157    -    - |7.63M|7.63M|    -
    numflock|  21    -    - |  31    -    - | 976K| 976K|    -
      numpty|   -    -    - |   2    -    - | 488K| 488K|    -
  numsiginfo|   -    -    - |  48    -    - | 976K| 976K|    -
   tcpsndbuf| 445K 0.2% 0.1%|4.04M   2%   1%| 204M| 378M|    -
   tcprcvbuf| 454K 0.2% 0.1%|5.08M   2%   1%| 204M| 378M|    -
othersockbuf|79.3K   -    - | 575K 0.3% 0.1%| 204M| 378M|    -
 dgramrcvbuf|   -    -    - | 224K 0.1% 0.1%| 204M| 378M|    -
numothersock|  48    -    - | 254    -    - |7.63M|7.63M|    -
  dcachesize| 734K   -    - | 927K   -    - |   2G|   2G|    -
     numfile|2.24K   -    - |4.23K   -    - |22.9M|22.9M|    -
   numiptent|  55    -    - |  80    -    - | 976K| 976K|    -
   swappages|   -    -    - |12.1M   -    - |   - |   - |    -

----------------------------------------------------------------
CT 180       | HELD Bar% Lim%| MAXH Bar% Lim%| BAR | LIM | FAIL
-------------+---------------+---------------+-----+-----+------
    kmemsize|   -    -    - |79.5M   3%   3%|   2G|   2G|    -
 lockedpages|   -    -    - |22.1M 0.6% 0.6%|3.81G|3.81G|    8
 privvmpages|   -    -    - |2.49G  62%  62%|   4G|   4G|    -
    shmpages|   -    -    - | 264M  12%  12%|   2G|   2G|   77
     numproc|   -    -    - | 432    -    - | 976K| 976K|    -
   physpages|   -    -    - | 1.8G   -    - |   - |   - |    -
 vmguarpages|   -    -    - |   -    -    - |   2G|   - |    -
oomguarpages|   -    -    - | 1.8G  89%   - |   2G|   - |    -
  numtcpsock|   -    -    - | 434    -    - |7.63M|7.63M|    -
    numflock|   -    -    - |  46    -    - | 976K| 976K|    -
      numpty|   -    -    - |   2    -    - | 488K| 488K|    -
  numsiginfo|   -    -    - |  48    -    - | 976K| 976K|    -
   tcpsndbuf|67.4K   -    - |11.9M   5%   3%| 204M| 378M|    -
   tcprcvbuf|   -    -    - |6.94M   3%   2%| 204M| 378M|    -
othersockbuf|   -    -    - |6.73M   3%   2%| 204M| 378M|    -
 dgramrcvbuf|   -    -    - | 452K 0.2% 0.1%| 204M| 378M|    -
numothersock|   -    -    - | 384    -    - |7.63M|7.63M|    -
  dcachesize|   -    -    - |   2M 0.1% 0.1%|   2G|   2G|    -
     numfile|   -    -    - |10.3K   -    - |22.9M|22.9M|    -
   numiptent|   -    -    - |  57    -    - | 976K| 976K|    -
   swappages|   -    -    - |26.2M   -    - |   - |   - |    -

----------------------------------------------------------------
CT 160       | HELD Bar% Lim%| MAXH Bar% Lim%| BAR | LIM | FAIL
-------------+---------------+---------------+-----+-----+------
    kmemsize|2.92M  21%  20%|8.61M  62%  61%|13.7M|14.1M|    -
 lockedpages|   -    -    - |  20K 0.2% 0.2%|   8M|   8M|    -
 privvmpages| 178M   7%   5%|1.89G  75%  57%| 2.5G|3.26G|   57
    shmpages| 124K 0.1% 0.1%|2.75M   3%   3%|  84M|  84M|    -
     numproc|  26   10%  10%|  93   38%  38%| 240 | 240 |    -
   physpages|61.7M   -    - |1.43G   -    - |   - |   - |    -
 vmguarpages|   -    -    - |   -    -    - | 132M|   - |    -
oomguarpages|61.7M  60%   - |1.43G 1435%   - | 102M|   - |    -
  numtcpsock|   4    1%   1%|  45   12%  12%| 360 | 360 |    -
    numflock|   8    4%   3%|  17    9%   8%| 188 | 206 |    -
      numpty|   -    -    - |   1    1%   1%| 100 | 100 |    -
  numsiginfo|   -    -    - |  67   26%  26%| 256 | 256 |    -
   tcpsndbuf|68.5K   4%   2%|1.31M  80%  50%|1.64M|2.58M|    -
   tcprcvbuf|  64K   3%   2%|2.72M 165% 105%|1.64M|2.58M|    -
othersockbuf|9.12K 0.8% 0.4%|41.1K   3%   2%|1.07M|   2M|    -
 dgramrcvbuf|   -    -    - |16.6K   6%   6%| 256K| 256K|    -
numothersock|  10    2%   2%|  28    7%   7%| 360 | 360 |    -
  dcachesize| 349K  10%   9%| 560K  16%  15%|3.25M|3.46M|    -
     numfile| 660    7%   7%|3.37K  37%  37%|9.09K|9.09K|    -
   numiptent|  24    2%   2%|  24    2%   2%|1000 |1000 |    -
   swappages|   -    -    - |   4K   -    - |   - |   - |    -

----------------------------------------------------------------
CT 150       | HELD Bar% Lim%| MAXH Bar% Lim%| BAR | LIM | FAIL
-------------+---------------+---------------+-----+-----+------
    kmemsize|9.84M  71%  69%|39.2M 285% 277%|13.7M|14.1M| 46.2K
 lockedpages|   -    -    - |22.1M 275% 275%|   8M|   8M|    8
 privvmpages| 514M  51%  28%|1.05G 108%  60%| 997M|1.74G| 47.6K
    shmpages| 600K 0.7% 0.7%|1.09M   1%   1%|  84M|  84M|    -
     numproc|  69   28%  28%| 208   86%  86%| 240 | 240 |    -
   physpages| 260M   -    - | 769M   -    - |   - |   - |    -
 vmguarpages|   -    -    - |   -    -    - | 132M|   - |    -
oomguarpages| 260M 255%   - | 769M 754%   - | 102M|   - |    -
  numtcpsock|  32    8%   8%| 222   61%  61%| 360 | 360 |    -
    numflock|   7    3%   3%|  33   17%  16%| 188 | 206 |    -
      numpty|   -    -    - |   2    2%   2%| 100 | 100 |    -
  numsiginfo|   -    -    - |  47   18%  18%| 256 | 256 |    -
   tcpsndbuf| 205K  12%   7%|4.31M 262% 167%|1.64M|2.58M|    -
   tcprcvbuf| 200K  11%   7%|4.48M 273% 173%|1.64M|2.58M|  488
othersockbuf| 249K  22%  12%|2.16M 200% 107%|1.07M|   2M|   71
 dgramrcvbuf|   -    -    - | 254K  99%  99%| 256K| 256K|   37
numothersock|  57   15%  15%| 199   55%  55%| 360 | 360 |    -
  dcachesize| 705K  21%  19%| 926K  27%  26%|3.25M|3.46M|    -
     numfile| 1.7K  18%  18%|4.18K  46%  46%|9.09K|9.09K|    -
   numiptent|  57    5%   5%|  57    5%   5%|1000 |1000 |    -
   swappages|   -    -    - |   4K   -    - |   - |   - |    -

----------------------------------------------------------------
CT 140       | HELD Bar% Lim%| MAXH Bar% Lim%| BAR | LIM | FAIL
-------------+---------------+---------------+-----+-----+------
    kmemsize|6.41M  46%  45%|17.1M 124% 121%|13.7M|14.1M|    -
 lockedpages|   -    -    - |22.1M 275% 275%|   8M|   8M|   12
 privvmpages| 340M  32%  18%|   1G  98%  55%|1.01G|1.79G| 33.4K
    shmpages| 600K 0.7% 0.7%|1.09M   1%   1%|  84M|  84M|    -
     numproc|  54   22%  22%| 170   70%  70%| 240 | 240 |    -
   physpages| 160M   -    - | 360M   -    - |   - |   - |    -
 vmguarpages|   -    -    - |   -    -    - | 132M|   - |    -
oomguarpages| 160M 156%   - | 360M 353%   - | 102M|   - |    -
  numtcpsock|  26    7%   7%| 104   28%  28%| 360 | 360 |    -
    numflock|  15    8%   7%|  26   13%  12%| 188 | 206 |    -
      numpty|   -    -    - |   2    2%   2%| 100 | 100 |    -
  numsiginfo|   -    -    - |  53   20%  20%| 256 | 256 |    -
   tcpsndbuf| 205K  12%   7%|1.74M 106%  67%|1.64M|2.58M|    -
   tcprcvbuf| 208K  12%   7%|3.14M 191% 121%|1.64M|2.58M|    -
othersockbuf|  77K   7%   3%|1.14M 106%  57%|1.07M|   2M|    -
 dgramrcvbuf|   -    -    - |10.8K   4%   4%| 256K| 256K|    -
numothersock|  45   12%  12%| 229   63%  63%| 360 | 360 |    -
  dcachesize| 697K  21%  19%| 917K  27%  25%|3.25M|3.46M|    -
     numfile| 1.5K  16%  16%|3.97K  43%  43%|9.09K|9.09K|    -
   numiptent| 204   20%  20%| 204   20%  20%|1000 |1000 |    -
   swappages|   -    -    - |   4K   -    - |   - |   - |    -

----------------------------------------------------------------
CT 110       | HELD Bar% Lim%| MAXH Bar% Lim%| BAR | LIM | FAIL
-------------+---------------+---------------+-----+-----+------
    kmemsize|29.8M   2%   2%|67.2M   3%   3%|   2G|   2G|  859
 lockedpages|  22M 0.6% 0.6%|22.1M 0.6% 0.6%|3.81G|3.81G|   32
 privvmpages| 1.2G  15%  15%|4.01G  50%  50%|   8G|   8G| 96.7K
    shmpages| 259M  12%  12%| 778M  38%  38%|   2G|   2G|    6
     numproc| 224    -    - | 699  0.1% 0.1%| 976K| 976K|    1
   physpages| 639M   -    - |1.25G   -    - |   - |   - |    -
 vmguarpages|   -    -    - |   -    -    - |   2G|   - |    -
oomguarpages| 639M  31%   - |1.25G  62%   - |   2G|   - |    -
  numtcpsock| 177    -    - | 350    -    - |7.63M|7.63M|    5
    numflock|   6    -    - |  45    -    - | 976K| 976K|    -
      numpty|   -    -    - |   2    -    - | 488K| 488K|    -
  numsiginfo|   -    -    - | 309    -    - | 976K| 976K|    -
   tcpsndbuf|3.03M   2% 0.8%| 6.8M   3%   2%| 204M| 378M| 4.21M
   tcprcvbuf|2.77M   1% 0.7%|5.47M   2%   1%| 204M| 378M|  301
othersockbuf| 486K 0.2% 0.1%|3.25M   2% 0.9%| 204M| 378M|   27
 dgramrcvbuf|   -    -    - | 388K 0.2% 0.1%| 204M| 378M|    -
numothersock| 231    -    - | 573    -    - |7.63M|7.63M|    -
  dcachesize|1.03M 0.1% 0.1%|1.83M 0.1% 0.1%|   2G|   2G|    -
     numfile|3.39K   -    - |11.2K   -    - |22.9M|22.9M|    7
   numiptent|  82    -    - | 323    -    - | 976K| 976K|    1
   swappages|   -    -    - |  24K   -    - |   - |   - |    -

我的問題是如何優化容器,以便平均負載恢復正常,而不是我現在面臨的高負載

首先,記憶體與平均負載無關。 花幾分鐘時間閱讀其中的差異

閱讀所有連結的參考資料。這一點很重要。

當你完成後,這個答案仍然會在這裡。


你回來了?好的好的。

現在,您需要知道的是:高負載不是問題。

性能差是個問題。

崩潰和凍結是一個問題。

磁碟空間不足是一個問題。

如果您沒有實際問題,請不要擔心負載數量。

從業務的角度來看,負載數越高越好——如果系統執行良好(即沒有人抱怨),平均負載為 1000,那麼您就可以有效地利用系統。

請注意,從業務的角度來看,我在計算高效和高效之間進行了區分。


如果您遇到實際問題,例如 VM 性能不佳,負載平均是一種診斷工具,可幫助您解決問題(指示有多少程序正在等待 CPU)。

您可能無法通過調整 VM 來優化擺脫這種情況的方法——您的系統要求 CPU 做的工作比它所能做的要多。平均負載 300 意味著您有 300 個程序想要使用 CPU(相對於您的系統有多少核心),這很可能意味著等待時間很明顯。

要糾正這種情況,您需要從伺服器上移除負載(通過將工作 - 虛擬機 - 遷移到另一個盒子)。首先遷移“最重”的虛擬機(需要最多 CPU 時間的虛擬機),然後繼續移除負載,直到系統性能滿足您的需求(不管平均負載如何)。請記住給自己留一點空間,以防 VM 工作負載發生變化。

(就此而言,如果您沒有遇到問題,但無法克服高負載數字,這仍然是解決方案 - 移除負載,直到數字讓您感覺更好。)

引用自:https://serverfault.com/questions/513925