User Commands zonestat(1)
NAME
zonestat - report active zone statistics
SYNOPSIS
zonestat [-z zonelist] [-r reslist] [-n namelist] [-T u | d | i]
[-R reports] [-q] [-p [-P lines]]
[-S cols] interval [duration [report]]
DESCRIPTION
The zonestat utility reports on the cpu, memory, and
resource control utilization of the currently running zones. Each zone's utilization is reported both as a percentage of system resources and the zone's configured limits.The zonestat utility prints a series of interval reports at
the specified interval. It optionally also prints one or more summary reports at a specified interval.The default output is a summary of cpu, physical, and vir-
tual memory utilization. The -r option can be used to choose
detailed output for specific resources. SecurityWhen run from within a non-global zone (NGZ), only processor
sets visible to the NGZ are reported. The NGZ output includes all of other system resources, such as memory and limits. For all reported resources, the NGZ's usage is output. Usage of each resource by the system, global zone, and all other zones, is reported as used by [system].proc_info privilege is required to use the zonestat(1) util-
ity. This privilege is a member of the basic privilege set. OPTIONS The following options are supported:-n name[,name]
Specify a list resource names on which to report. For pset resources, this is the name of the processor set.For physical-memory, locked-memory, and virtual-memory
resources, the only names are mem_default and
vm_default.
Dedicated-cpu processor sets can be specified by their
SunOS 5.11 Last change: 20 Aug 2010 1
User Commands zonestat(1)
pset name (SUNWtmp_zonename or by just their zonename.
Processor sets created by psrset can be specified bytheir pool pset name (SUNWlegacy_pset id), or just by
their pset id.In addition to a comma-separated list, multiple -n
options can be specified to report on a set of resources.-p
Parseable output.Print output in stable, machine--parseable format. Indi-
vidual fields are delimited with a colon (:). The line format is: report type:resource:field[:field]*If -T is specified each line is prefixed with a times-
tamp:The report types are: report-total, report-average,
report-high, and interval,
The resource types are: header, footer, summary,physical-memory, virtual-memory, locked-memory,
processor-set, processes, lwps, sysv-shared-memory,
sysv-shmids, sysv-semids, sysv-msgids, lofi
The header resource is a special resource used to statethe beginning of an interval or summary report. All out-
put lines between header resources belong to the same report. Each header has a matching footer. The remaining fields are resource type specific. See thezonestat utility output for details.
All existing output fields are stable. Future versions might introduce new report and resource types. Future versions might also add additional new fields to the end of existing output n lines.-P line[,line]
For parseable output, specify lines to output in parse-
able output. One or more of the following line types can be chosen:SunOS 5.11 Last change: 20 Aug 2010 2
User Commands zonestat(1)
resource The lines describing each resource. total The total utilization of each resource system The utilization of each resource by the system. This includes the kernel, and any resource consumptionnot contributed to a specific zone. When zonestat is
run from within a non-global-zone, this value is the
aggregate resource consumed by the system and all other zones. zonesLines detailing the per-zone utilization of each
resource. header, footer For each interval, and summary report has a header, which prints details such as the interval and count information. After each report, and footer is also printed-q
Quiet mode.Only print summary reports (requires -R). All interval
reports are omitted.-r resource[,resource]
Specify resource types on which to report. The availableresources are: physical-memory, virtual-memory, locked-
memory, processor-set, processes, lwps, shm-memory,
shm-ids, sem-ids, msg-ids, lofi
summarySunOS 5.11 Last change: 20 Aug 2010 3
User Commands zonestat(1)
A summary of cpu, physical-memory, and virtual-
memory usage. memoryphysical-memory, virtual-memory, and locked-memory.
psetsprocessor-set
default-pset
The default pset only. limits processes, lwps, lofi. sysvshm-memory, shm-ids, sem-ids msg-ids.
all all resource types. By default the summary resource is printed.In addition to a comma-separated list, multiple -r
options can be specified to report on a set of resources types. The system's cpus can be partitioned into processor sets (psets). By default, all cpus are in a single pset namedpset_default.
Memory is not partition-able into sets. The zonestat
utility output for these resources shows them as namedmem_default and vm_default.
The all resource specifies that all resource types should be reported.SunOS 5.11 Last change: 20 Aug 2010 4
User Commands zonestat(1)
-R report[,report]
Print a summary report. The supported report types aredescribed below. In addition to a comma-separated list,
multiple -R options can be specified for a set of sum-
mary reports. total Prints a summary report detailing the following for each resource: psetsTotal cpu used since start of command invoca-
tion. The percent used for each zone includes time that a zone was not running. For instance,if a zone used 100% of the cpu while it was run-
ning, but the zone was halted for half of the intervals, then the summary report shows thezone used 50% of the cpu time.
memory, limits, sysv Average resource used of all intervals reported since command invocation. This average factors in intervals in which a zone was not running. For example if a zone used on average of 100M of physical memory while it was running, and was only running for half the intervals, then the summary report shows that the zone used 50M of physical memory on average. average Similar to total, but only intervals in which a zone is running are factored in. For example, if a zone was only running for a single interval, and during that interval, the zone used 200M of virtual memory,then it's average virtual-memory is 200M, regardless
of the number of intervals reported before the sum-
mary report. high Print a summary report detailing the highest usage of each resource and zone during any interval of thezonestat utility invocation.
SunOS 5.11 Last change: 20 Aug 2010 5
User Commands zonestat(1)
-S col[,col]
Sort zones utilizing each resource. The following sorting columns can be specified: nameSort alpha-numerically by zone name.
used Sort by quantity of resource used. This is the default. cap Sort by configured cap. pcap Sort by percent of cap used. shr Sort by allocated share. pshru Sort by percent of share used. cpu Sort by cpu usage in the summary, This is the default.physical-memory
Sort by physical memory usage in the summary.virtual-memory
SunOS 5.11 Last change: 20 Aug 2010 6
User Commands zonestat(1)
Sort by virtual memory usage in the summary.-T u | d | i
Include timestamp of each report. The following formats are supported: d Standard date format. See date(1). This option isnot valid with --p.
i Time formatted as the ISO 8601 compliant format: YYYYMMDDThhmmssZ uA printed representation of the internal representa-
tion of time. See time(2). This is also known as unix time.-z zonename[,zonename]
Specify a list of zones on which to report. By default all zones are reported.In addition to a comma-separated list, multiple -z
options can be specified to report on a set of zones. The output includes any resources which have usage by the specified zones. OPERANDS The following operands are supported: interval Specifies the length in seconds to pause between eachinterval report. An interval of default uses the config-
ured interval of the zones monitoring service. Seezonestatd(1M).
SunOS 5.11 Last change: 20 Aug 2010 7
User Commands zonestat(1)
Interval is required. An interval of zero is not permit-
ted. The interval can be specified as [nh][nm][ns], such as 10s or 1m. duration Specifies the number of intervals to report. Defaults to infinity if not specified. The command duration is (interval * duration). A duration of zero is invalid. A value of inf can also be specified to explicitly choose infinity. Duration can also be specified as [nh][nm][ns]. In thiscase, duration is interpreted as the duration of execu-
tion time. The actual duration is rounded up to the nearest multiple of the interval. report Specify the summary report period. For instance, a report of 4 produces reports every 4 intervals. If the command duration is not a multiple of report, then the last report is of any remaining intervals. report can also be specified as [nh][nm][ns]. In this case, reports are output at the specified time period,rounded up to the nearest interval. If the command dura-
tion is not a multiple of report, then the last report is of any remaining intervals.Requires -R. If -R is specified and report is not, the
report period is the entire command duration, producing the specified reports at the end of execution.OUTPUT
The following list defines the column heading of the command output:SYSTEM-MEMORY
The total amount of memory available on the physical host.SYSTEM-LIMIT
The maximum amount of resource available on the physical host.SunOS 5.11 Last change: 20 Aug 2010 8
User Commands zonestat(1)
CPUS The number of cpus allocated to a processor set. ONLINE Of the cpus allocated to a processor set, the number of cpus which can execute processes.MIN/MAX The minimum and maximum number of cpus which can be allocated to the processor set by the system. ZONE The zone using the resource. In addition to zone names, this column can also contain: [total]
The total quantity of resource used system-wide.
[system] The quantity of resource used by the kernel or in a manner not associated with any particular zone.When zonestat is used within a non-global zone,
[system] designates the aggregate resource used by the system and by all other zones. USED The amount of resource used. PCT The amount of resource used as a percent of the total resource.%PART
The amount of cpu used as a percentage of the total cpuSunOS 5.11 Last change: 20 Aug 2010 9
User Commands zonestat(1)
in a processor-set to which the zone is bound. A zone
can only have processes bound to multiple processor sets if it is the global zone, or if psrset(1m) psets are used. If multiple binding are found for a zone, it's%PART is the fraction used of all bound psets. For
[total] and [system], %PART is the percent used of all
cpus on the system. CAP If a zone is configured to have a cap on the given resource, the cap is displayed in this column.%CAP
The amount of resource used as a percent of zone's con-
figured cap. SHRS The number of shares allocated to the zone. For the[total] row, this is the total number of shares allo-
cated to all zones sharing the resource. If a zone is not configured to use shares, and is sharing a resource with other zones that are configured to use shares, thiscolumn contains no-fss for the zone.
%SHRS
The fraction of the total shares allocated to the zone. For instance, if 2 zones share a processor set, eachwith 10 shares, then each zone has a %SHR of 50%.
%SHRU
Of the share allocated to the zone, the fraction ofresource 100%. Because shares are only enforced when
there is resource contention, it is possible for a zoneto have a %SHRU in excess of 100%.
EXAMPLES
Example 1 Using zonestat to Display a Summary of cpu and
Memory UtilizationSunOS 5.11 Last change: 20 Aug 2010 10
User Commands zonestat(1)
The following command shows a summary of cpu and memory utilization every 5 seconds:# zonestat -z global -r physical-memory 5
# zonestat 5 1
SUMMARY-----CPU------------- ----PHYSICAL--- ----VIRTUAL----
ZONE USED %PART %CAP %SHRU USED PCT %CAP USED PCT %CAP
[total] 9.74 30% - - 7140M 21% - 10.6G 22% -
[system] 0.28 0.8% - - 6535M 19% - 10.4G 21% -
global 9.10 28% - - 272M 0.8% - 366M 0.7% -
zoneA 0.32 1.0% - - 256M 0.7% - 265M 0.5% -
zoneB 0.00 0.0% - - 77.6M 0.2% - 71.1M 0.1% -
Example 2 Using zonestat to Produce Parseable Output
The following command produces parseable output. It prints one line per zone using each pset resource for a 5 second interval.# zonestat -p -P zones -r psets 5 1
Example 3 Using zonestat to Report on the Default pset
The following command reports on the default pset once a second for one minute.# zonestat -r default-pset 1 1m
Example 4 Using zonestat to Report Total and High Utiliza-
tion The following command monitors silently at a 10 second interval for 24 hours, producing a total and high report every 1 hour.# zonestat -q -R total,high 10s 24h 1h
SunOS 5.11 Last change: 20 Aug 2010 11
User Commands zonestat(1)
EXIT STATUS The following exit values are returned: 0 Successful completion. 1 An error occurred. 2 Invalid usage. 3svc:system/zones_monitoring: default not running or not
responding.ATTRIBUTES
See attributes(5) for descriptions of the following attri-
butes:____________________________________________________________
| ATTRIBUTE TYPE | ATTRIBUTE VALUE |
|_____________________________|_____________________________|
| Availability | system/zones ||_____________________________|_____________________________|
| Interface Stability | See below. ||_____________________________|_____________________________|
Command invocation and parseable output is Committed. Human readable output (default output) is Uncommitted.SEE ALSO
date(1), prctl(1), pooladm(1M), poolcfg(1M), rcapadm(1M),zoneadm(1M), zonecfg(1M), zonestatd(1M), time(2),
timezone(4), attributes(5), privileges(5),resource_controls(5)
NOTESThe zonestat utility depends on the zones monitoring ser-
vice: svc/system/zonestat:default. If the zonestat service
SunOS 5.11 Last change: 20 Aug 2010 12
User Commands zonestat(1)
is stopped while the zonestat utility is running, the zones-
tat command invocation quits without printing additionalreports. The reports (-R) is printed if zonestat is inter-
rupted (by CTRL/c, SIGINT) before reaching the next report period.SunOS 5.11 Last change: 20 Aug 2010 13