Révision f9000cdc
new plugin to monitor HugePages (or Large Pages) usage under Linux
| plugins/system/hugepages | ||
|---|---|---|
| 1 |
#!/usr/bin/gawk --exec |
|
| 2 |
BEGIN {
|
|
| 3 |
if (ARGC > 1 && ARGV[1] == "config") {
|
|
| 4 |
print "graph_args --base 1024 -l 0" |
|
| 5 |
print "graph_vlabel Bytes" |
|
| 6 |
print "graph_title HugePages usage" |
|
| 7 |
print "graph_category system" |
|
| 8 |
print "graph_info This graph shows the usage of the kernel Huge Pages." |
|
| 9 |
print "graph_order Total Rsvd Free Surp Anon" |
|
| 10 |
print "Total.label used" |
|
| 11 |
print "Total.draw AREA" |
|
| 12 |
print "Total.info In-use Huge Page Memory" |
|
| 13 |
print "Free.label free" |
|
| 14 |
print "Free.draw STACK" |
|
| 15 |
print "Free.info Unused Huge Page Memory." |
|
| 16 |
print "Rsvd.label reserved" |
|
| 17 |
print "Rsvd.draw STACK" |
|
| 18 |
print "Rsvd.info Huge Pages that have been reserved but are not used." |
|
| 19 |
print "Surp.label surplus" |
|
| 20 |
print "Surp.draw STACK" |
|
| 21 |
print "Surp.info Huge Pages that are in excess of the reserved amount, usually only greater than zero when the amount of Huge Pages is reduced while they are in use." |
|
| 22 |
print "Anon.label anonymous" |
|
| 23 |
print "Anon.draw STACK" |
|
| 24 |
print "Anon.info Huge Pages that are in use by the transparent Huge Page allocator khugepaged." |
|
| 25 |
CONF=1 |
|
| 26 |
} |
|
| 27 |
ARGV[1] = "/proc/meminfo" |
|
| 28 |
ARGC = 2 |
|
| 29 |
FS = "[: ]+" |
|
| 30 |
OFS = "" |
|
| 31 |
IGNORECASE = 1 |
|
| 32 |
} |
|
| 33 |
|
|
| 34 |
CONF == 1 {
|
|
| 35 |
if (/Hugepagesize/) {
|
|
| 36 |
print "Total.cdef Total,Free,-,1024,",$2,",*,*" |
|
| 37 |
print "Free.cdef Free,1024,",$2,",*,*,Rsvd,-" |
|
| 38 |
print "Rsvd.cdef Rsvd,1024,",$2,",*,*" |
|
| 39 |
print "Surp.cdef Surp,1024,",$2,",*,*" |
|
| 40 |
print "Anon.cdef Anon,1024,*" |
|
| 41 |
} |
|
| 42 |
} |
|
| 43 |
|
|
| 44 |
(CONF != 1) {
|
|
| 45 |
if (match($0,"(anon)?hugepages(_([^:]+))?[^i]",mats)) |
|
| 46 |
print mats[1],mats[3],".value ",$2 |
|
| 47 |
} |
|
Formats disponibles : Unified diff