iocage memory usage

Hi,

I have been looking at the iocage() but I cannot figure out if there is a way to show the current memory usage of a jail..

Could anyone please tell me if such feature exist in sysutils/iocage?

Thank you
 
Last edited by a moderator:
show the curent memory usage of a jail..
Simple question, but a jail doesn't have its own memory like a VM. Jail is actually a set of processes with a specific jail id.
You can do ps -eo pid,rss,args -J jailid which will show you a list of the processes in your jail and their memory usage. Or put it in a oneliner to get the percentage of of system memory in use for jailid:
Code:
ps -eo %mem -J jailid | tail +2 | awk 'BEGIN{i=0}\
 {i=i+$1}\
 END{printf"%f%%\n",i}'
 
That's a very cool command you just gave me :)
I'll try to make a script out of it to calculate what I want and display for all jail..

Thank you
 
iocage is only a wrapper for managing jails, not for observing them.
Some of the common system tools have become jail-aware, so e.g. top can show processes from a specific jail by using the -J <jailid | jailname> option.

If more specific stats are needed or you have to drill (really) deep into a specific problem, DTrace is a great tool and even with only some basic knowledge of it you can get pretty far when chasing down a problem.
 
Hi,

I have been looking at the man iocage() but I cannot figure out if there is a way to show the curent memory usage of a jail..

Could anyone please tell me if such feature exist in sysutils/iocage?

Thank you

that's a very later answer but i just found this tool from this week's vermaden blog newsletter, works fine on my system:

 
Back
Top