Сегодня 1 декабря, воскресенье ГлавнаяНовостиО проектеЛичный кабинетПомощьКонтакты Сделать стартовойКарта сайтаНаписать администрации
Поиск по сайту
 
Ваше мнение
Какой рейтинг вас больше интересует?
 
 
 
 
 
Проголосовало: 7276
Кнопка
BlogRider.ru - Каталог блогов Рунета
получить код
Kir Kolyshkin
Kir Kolyshkin
Голосов: 1
Адрес блога: http://k001.livejournal.com/
Добавлен: 2008-02-19 12:45:30 блограйдером Lurk
 

vzubc v.3

2011-05-21 05:40:43 (читать в оригинале)

This is a third version of vzubc script. I kinda start to like it, it is really helpful. I will probably finish the TODO, write the man page and will include the tool to vzctl.

The script parses /proc/bc/resources (or /proc/user_beancounters) and outputs it in a more human-readable format.

FEATURES:
1. Held, maxheld, barrier, limit, 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 barrier and the limit, in per cent
5. Can be used both inside CT and on HN
6. User can specify CTIDs or CT names to output info about
7. Optional top-like autoupdate mode (using "watch")
8. Optional "relative failcnt" mode (show increase in UBC fail counters since last run)
9. Optional quiet mode (only shows "worth to look at" UBCs (ie ones close to limits and/or with failcnt))

CHANGES from v.2:
* Added lots of options/features (watch mode, relative failcnt, quiet), TODO list is times

Script: vzubc

Example output:
vzubc -c 111 -q
-------------------------------------------------------------------
CT 111       | HELD  Bar%  Lim%| MAXH  Bar%  Lim%| BAR | LIM |+FAIL
-------------+-----------------+-----------------+-----+-----+-----
     kmemsize|13.6M   99%   96%|13.7M  100%   97%|13.7M|14.1M|   19 
      numproc| 170    70%   70%| 172    71%   71%| 240 | 240 |    - 
-------------------------------------------------------------------


TODO:
* colors
* recognize vSwap
* add UBC consistency check a la vzcfgvalidate (helpful for CT owner!)
* rewrite in C??

vzubc v.2

2011-05-20 14:21:39 (читать в оригинале)

This is a second version of vzubc script. The script is written in AWK, it parses /proc/user_beancounters and tries to output it in a more human-readable format.

FEATURES:
1. Held, maxheld, barrier, limit, 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 barrier and the limit, in per cent
5. Can be used both inside CT and on HN

CHANGES from v.1:
* Added barrier and limit display
* Added percentage of held/maxheld to limit (it was only for barrier)
* More proper long values display, now with decimal point if possible (similar to ls -lh)
* ASCII table like output
* Zeroes and 'unlimited' are shown as '-'

TODO:
* colors
* recognize vSwap
* use /proc/bc/*/resources if available
* 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??

Script source:
#!/bin/sh
f=${1:-/proc/user_beancounters}
cat $f | LANG=C awk '
function hr(res, v) {
	if ((v == 9223372036854775807) || (v == 2147483647) || (v == 0))
		return "- ";
	i=1
	if ((res ~ /pages$/) && (v != 0)) {
		v = v*4; i++
	}
	while (v >= 1024) {
		v=v/1024
		i++
	}
	fmt="%d%c"
	if (v < 100)
		fmt="%.3g%c"
	return sprintf(fmt, v, substr(" KMGTPEZY", i, 1))
}

function dp(p, d) {
	if ((d == 0) || (d == 9223372036854775807) || (d == 2147483647))
		return "- "
	r = sprintf("%.2f", p / d * 100);
	fmt="%d"
	if (r < 10)
		fmt="%.2g"
	r = sprintf(fmt, r)
	if (r == 0)
		return "- "
	return r "%"
}

/^Version: / {
	if ($2 != "2.5") {
		print "Error: unknown version:",
			$2 > "/dev/stderr"
		exit 1
	}
	next
}
/^[[:space:]]*uid / {
	next
}
/^[[:space:]]*dummy/ {
	id=""
	next
}
/^[[:space:]]*[0-9]+:/ {
	bcid=strtonum($1)
	printf "-------------------------------------------------------------------\n"
	printf "CT %-10s| HELD  Bar%%  Lim%%| MAXH  Bar%%  Lim%%| BAR | LIM | FAIL\n", bcid
	printf "-------------+-----------------+-----------------+-----+-----+-----\n"
	id=$2
	held=$3
	maxheld=$4
	barrier=$5
	limit=$6
	failcnt=$7
}
/^[[:space:]]*[a-z]+/ {
	id=$1
	held=$2
	maxheld=$3
	barrier=$4
	limit=$5
	failcnt=$6
}
(id!="") {
	printf "%13s|%5s %5s %5s|%5s %5s %5s|%5s|%5s| %5s\n",
		id,
		hr(id, held), dp(held, barrier), dp(held, limit),
		hr(id, maxheld), dp(maxheld, barrier), dp(maxheld, limit),
		hr(id, barrier), hr(id, limit), hr(id, failcnt)
	id=""
}
'


Example output:
-------------------------------------------------------------------
CT 60        | HELD  Bar%  Lim%| MAXH  Bar%  Lim%| BAR | LIM | FAIL
-------------+-----------------+-----------------+-----+-----+-----
     kmemsize| 933K    5%    5%|1.92M   12%   11%|15.8M|16.8M|    - 
  lockedpages|   -     -     - |   -     -     - | 128K| 128K|    - 
  privvmpages|4.15M  1.1% 0.99%|10.4M    2%    2%| 384M| 418M|    - 
     shmpages|   -     -     - |   -     -     - |  32M|  32M|    - 
      numproc|   7     5%    5%|  17    13%   13%| 130 | 130 |    - 
    physpages|2.63M    -     - |7.86M    -     - |   - |   - |    - 
  vmguarpages|   -     -     - |   -     -     - |  24M|   - |    - 
 oomguarpages|2.63M   10%    - |7.86M   32%    - |  24M|   - |    - 
   numtcpsock|   2     2%    2%|   2     2%    2%|  80 |  80 |    - 
     numflock|   2     2%  1.8%|   3     3%    2%| 100 | 110 |    - 
       numpty|   -     -     - |   -     -     - |  16 |  16 |    - 
   numsiginfo|   -     -     - |   2  0.78% 0.78%| 256 | 256 |    - 
    tcpsndbuf|   -     -     - |   -     -     - | 312K| 512K|    - 
    tcprcvbuf|   -     -     - |   -     -     - | 312K| 512K|    - 
 othersockbuf|2.27K 0.88% 0.34%|8.12K    3%  1.2%| 258K| 658K|    - 
  dgramrcvbuf|   -     -     - |8.27K    6%    6%| 129K| 129K|    - 
 numothersock|   3     3%    3%|  10    12%   12%|  80 |  80 |    - 
   dcachesize|   -     -     - |   -     -     - |   2M|   3M|    - 
      numfile| 169     2%    2%| 290     3%    3%|   8K|   8K|    - 
    numiptent|   -     -     - |   -     -     - | 128 | 128 |    - 
-------------------------------------------------------------------
CT 0         | HELD  Bar%  Lim%| MAXH  Bar%  Lim%| BAR | LIM | FAIL
-------------+-----------------+-----------------+-----+-----+-----
     kmemsize|3.69M    -     - |4.72M    -     - |   - |   - |    - 
  lockedpages|   -     -     - |29.4M    -     - |   - |   - |    - 
  privvmpages|15.7M    -     - |61.5M    -     - |   - |   - |    - 
     shmpages|2.56M    -     - |2.62M    -     - |   - |   - |    - 
      numproc|  77     -     - |  86     -     - |   - |   - |    - 
    physpages| 8.8M    -     - |16.3M    -     - |   - |   - |    - 
  vmguarpages|   -     -     - |   -     -     - |   - |   - |    - 
 oomguarpages| 8.8M    -     - |16.3M    -     - |   - |   - |    - 
   numtcpsock|   3     -     - |   5     -     - |   - |   - |    - 
     numflock|   1     -     - |   2     -     - |   - |   - |    - 
       numpty|   1     -     - |   1     -     - |   - |   - |    - 
   numsiginfo|   -     -     - |   2     -     - |   - |   - |    - 
    tcpsndbuf|81.7K    -     - |81.7K    -     - |   - |   - |    - 
    tcprcvbuf|  48K    -     - |   -     -     - |   - |   - |    - 
 othersockbuf|31.7K    -     - |50.8K    -     - |   - |   - |    - 
  dgramrcvbuf|   -     -     - |10.8K    -     - |   - |   - |    - 
 numothersock|  30     -     - |  34     -     - |   - |   - |    - 
   dcachesize|   -     -     - |   -     -     - |   - |   - |    - 
      numfile|1.18K    -     - |1.29K    -     - |   - |   - |    - 
    numiptent|   -     -     - |   -     -     - |   - |   - |    - 


vzubc

2011-05-11 14:41:55 (читать в оригинале)

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??
#!/bin/sh
f=$1
test -z "$f" && f="/proc/user_beancounters"
cat $f | awk '
function hr(res, v) {
        i=1
        if ((res ~ /pages$/) && (v != 0)) {
                v = v*4; i++
        }
        while (v > 1024) {
                v=v/1024
                i++
        }
        o=int(v) substr(" KMGTPEZY",i,1)
        return o;
}

/^Version: / {
        if ($2 != "2.5") {
                print "Error: unknown version:",
                        $2 > "/dev/stderr"
                exit 1
        }
        next
}
/^[[:space:]]*uid / {
        next
}
/^[[:space:]]*dummy/ {
        id=""
        next
}
/^[[:space:]]*[0-9]+:/ {
        bcid=strtonum($1)
        printf "CT:%9s|    held    |   maxheld   | fails\n", bcid
        id=$2
        held=$3
        maxheld=$4
        barrier=$5
        limit=$6
        failcnt=$7
}
/^[[:space:]]*[a-z]+/ {
        id=$1
        held=$2
        maxheld=$3
        barrier=$4
        limit=$5
        failcnt=$6
}
(id!="") {
        if (barrier == 0)
                barrier=limit;
        printf "%12s %5s %5.1f%%  %5s %5.1f%% %5s\n", id,
                hr(id, held), held / barrier * 100,
                hr(id, maxheld), maxheld / barrier * 100,
                hr(id, failcnt)
        id=""
}
'

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


DDR DIMM 1Gb sale

2011-04-18 20:24:42 (читать в оригинале)

Если совсем никто не хочет подарить мне мать, то, может, кому-нибудь нужен гиг памяти DDR? Буквально вчера купил, а мать под неё сдохла после неудачной прошивки биоса.

Приму в дар

2011-04-17 12:07:01 (читать в оригинале)

Приму в дар материнскую плату с сокетом 755 и разъёмами под память DDR (не DDR2/3). Заранее благодарен.

Posted via LjBeetle


Страницы: ... 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 

 


Самый-самый блог
Блогер Рыбалка
Рыбалка
по среднему баллу (5.00) в категории «Спорт»


Загрузка...Загрузка...
BlogRider.ru не имеет отношения к публикуемым в записях блогов материалам. Все записи
взяты из открытых общедоступных источников и являются собственностью их авторов.