Project

General

Profile

Actions

Feature #9705

closed

Add kernel memory usage to status.php

Added by Jim Pingle over 4 years ago. Updated over 4 years ago.

Status:
Resolved
Priority:
Low
Assignee:
Category:
Web Interface
Target version:
Start date:
08/27/2019
Due date:
% Done:

100%

Estimated time:
Plus Target Version:
Release Notes:

Description

The FreeBSD ZFS docs include some commands to calculate kernel memory (kmem) usage. Looks like it would be nice to have on status.php output.

kmemusage.sh:

#!/bin/sh -

TEXT=`kldstat | awk 'BEGIN {print "16i 0";} NR>1 {print toupper($4) "+"} END {print "p"}' | dc`
DATA=`vmstat -m | sed -Ee '1s/.*/0/;s/.* ([0-9]+)K.*/\1+/;$s/$/1024*p/' | dc`
TOTAL=$((DATA + TEXT))

echo TEXT=$TEXT, `echo $TEXT | awk '{print $1/1048576 " MB"}'`
echo DATA=$DATA, `echo $DATA | awk '{print $1/1048576 " MB"}'`
echo TOTAL=$TOTAL, `echo $TOTAL | awk '{print $1/1048576 " MB"}'`
./kmemusage.sh
TEXT=21228536, 20.2451 MB
DATA=41686016, 39.7549 MB
TOTAL=62914552, 60 MB
Actions

Also available in: Atom PDF