May 11th, 2011

nepal

vzubc

This script parses /proc/user_beancounters and tries to output it in a more human-readable format.
  1. Held, maxheld, and fail counter are shown for every beancounter.
  2. Values that are in pages are converted to bytes
  3. Long values are converted to kilo-, mega-, gigabytes etc.
  4. For held and maxheld it shows how close the value to the limit, in per cent
  5. Can be used both inside CT and on HN
TODO:
  • colors
  • recognize vSwap
  • quieter mode (only show values close to limits and/or with failcnt > 0)
  • save failcnt and show the difference from the prev. run
  • add interactive mode (top-like) using watch
  • add UBC consistency check a la vzcfgvalidate (helpful for CT owner!)
  • rewrite in C??
Collapse )

Example output:

CT:    90162|    held    |   maxheld   | fails
    kmemsize    4M   4.1%     7M   6.5%    0 
 lockedpages    0    0.0%     0    0.0%    0 
 privvmpages   38M   1.9%   461M  22.5%    0 
    shmpages    2M   0.4%     2M   0.4%    0 
     numproc   31    1.6%    43    2.2%    0 
   physpages   21M   0.0%   441M   0.0%    0 
 vmguarpages    0    0.0%     0    0.0%    0 
oomguarpages   21M   0.0%   441M   0.0%    0 
  numtcpsock    6    0.2%    15    0.5%    0 
    numflock    5    0.3%     7    0.5%    0 
      numpty    1    0.8%     1    0.8%    0 
  numsiginfo    0    0.0%     2    0.2%    0 
   tcpsndbuf  113K   0.8%     2M  17.3%    0 
   tcprcvbuf   96K   0.7%     0    0.0%    0 
othersockbuf    2K   0.0%    45K   0.5%    0 
 dgramrcvbuf    0    0.0%     8K   0.4%    0 
numothersock    8    0.3%    14    0.5%    0 
  dcachesize  455K   1.7%   625K   2.3%    0 
     numfile    2K   2.8%     3K   4.5%    0 
   numiptent   16    1.6%    16    1.6%    0