Go to main content

Creating and Using Oracle® Solaris Zones

Exit Print View

Updated: August 2019
 
 

Reporting Resource Usage in a Non-Global Zone

The zonestat utility reports on the CPU, memory, network, and resource control utilization of the currently running zones. For complete information about the utility, see the zonestat(1) man page.

The zonestat network component shows the usage of virtual network (VNIC) resources on PHYS, AGGR, Etherstub, and SIMNET datalinks by zones. You can obtain information about other datalinks, such as bridges and tunnels, by using the networking utilities described in the dladm(8) and dlstat(8) man pages.

All zonestat options and resource types can also be invoked within a non-global zone to display statistics for that zone.

root@zoneA:~# zonestat -z global -r physical-memory 2

Note -  Non-global zone users of zonestat are not aware of other zones using system resources. When the zonestat utility is used in a non-global zone, the combined resource usage of all other zones, including the global zone, is reported as used by the global zone.

Example 21, Displaying Exclusive-IP Zones' Network Bandwidth From the Global Zone creates a report on several zones from the global zone. For more information about resource usage reports, see the zonestat(1) man page.

Example 18  Displaying the CPU and Memory Utilization of a Non-Global Zone
my-zone$ zonestat -z global -r physical-memory 5
Collecting data for first interval...
Interval: 1, Duration: 0:00:05
PHYSICAL-MEMORY              SYSTEM MEMORY
mem_default                          2046M
                                ZONE  USED %USED   CAP  %CAP
                             [total] 1020M 49.8%     -     -
                            [system]  782M 38.2%     -     -
                              global  185M 9.06%     -     -

Interval: 2, Duration: 0:00:10
PHYSICAL-MEMORY              SYSTEM MEMORY
mem_default                          2046M
                                ZONE  USED %USED   CAP  %CAP
                             [total] 1020M 49.8%     -     -
                            [system]  782M 38.2%     -     -
                              global  185M 9.06%     -     -
…
Example 19  Reporting the Default Processor Set of a Non-Global Zone

The following command reports on the default pset resource pool element of my-zone once a second for 1 minute.

my-zone$ zonestat -r default-pset 1 1m
Collecting data for first interval...
Interval: 1, Duration: 0:00:01
PROCESSOR_SET                   TYPE  ONLINE/CPUS     MIN/MAX
pset_default            default-pset          2/2         1/-
                                ZONE  USED   PCT   CAP  %CAP   SHRS  %SHR %SHRU
                             [total]  0.02 1.10%     -     -      -     -     -
                            [system]  0.00 0.19%     -     -      -     -     -
                              global  0.01 0.77%     -     -      -     -     -
                               zone1  0.00 0.07%     -     -      -     -     -
                               zone2  0.00 0.06%     -     -      -     -     -

...
Interval: 60, Duration: 0:01:00
PROCESSOR_SET                   TYPE  ONLINE/CPUS     MIN/MAX
pset_default            default-pset          2/2         1/-
                                ZONE  USED   PCT   CAP  %CAP   SHRS  %SHR %SHRU
                             [total]  0.06 3.26%     -     -      -     -     -
                            [system]  0.00 0.18%     -     -      -     -     -
                              global  0.05 2.94%     -     -      -     -     -
                               zone1  0.00 0.06%     -     -      -     -     -
                               zone2  0.00 0.06%     -     -      -     -     -
Example 20  Reporting the Total and High Utilization of a Non-Global Zone

The following command silently monitors at10-second intervals for 3 minutes, then produces a report on the total and high utilizations of my-zone.

my-zone$ zonestat -q -R total,high 10s 3m 3m
Report: Total Usage
    Start: Fri Aug 26 07:32:22 PDT 2011
      End: Fri Aug 26 07:35:22 PDT 2011
    Intervals: 18, Duration: 0:03:00
SUMMARY                   Cpus/Online: 2/2   PhysMem: 2046M  VirtMem: 3069M
                    ---CPU----  --PhysMem-- --VirtMem-- --PhysNet--
               ZONE  USED %PART  USED %USED  USED %USED PBYTE %PUSE
            [total]  0.01 0.62% 1020M 49.8% 1305M 42.5%    14 0.00%
           [system]  0.00 0.23%  782M 38.2% 1061M 34.5%     -     -
             global  0.00 0.38%  185M 9.06%  208M 6.77%     0 0.00%
              test2  0.00 0.00% 52.4M 2.56% 36.6M 1.19%     0 0.00%

Report: High Usage
    Start: Fri Aug 26 07:32:22 PDT 2011
      End: Fri Aug 26 07:35:22 PDT 2011
    Intervals: 18, Duration: 0:03:00
SUMMARY                   Cpus/Online: 2/2   PhysMem: 2046M  VirtMem: 3069M
                    ---CPU----  --PhysMem-- --VirtMem-- --PhysNet--
               ZONE  USED %PART  USED %USED  USED %USED PBYTE %PUSE
            [total]  0.01 0.82% 1020M 49.8% 1305M 42.5%  2063 0.00%
           [system]  0.00 0.26%  782M 38.2% 1061M 34.5%     -     -
             global  0.01 0.55%  185M 9.06%  207M 6.77%     0 0.00%
              test2  0.00 0.00% 52.4M 2.56% 36.6M 1.19%     0 0.00%
Example 21  Displaying Exclusive-IP Zones' Network Bandwidth From the Global Zone

The following command shows the network bandwidth utilization for the system's exclusive-IP zones. It shows how much datalink bandwidth in the form of VNICs is in use and the per-zone utilization of each network device.

global$ zonestat -r network 1 1
Collecting data for first interval...
Interval: 1, Duration: 0:00:01

NETWORK-DEVICE                  SPEED        STATE        TYPE
aggr1                        2000mbps           up        AGGR
                    ZONE TOBYTE  MAXBW %MAXBW PRBYTE %PRBYTE POBYTE %POBYTE
                  global  1196K      -      -   710K   0.28%   438K   0.18%

net0                      1000mbps           up        PHYS
                    ZONE TOBYTE  MAXBW %MAXBW PRBYTE %PRBYTE POBYTE %POBYTE
                 [total]  7672K      -      -  6112K   4.89%  1756K   1.40%
                  global  5344K  100m*  42.6%  2414K   1.93%  1616K   1.40%
                   zoneB   992K   100m  15.8%  1336K   0.76%   140K   0.13%
                   zoneA  1336K    50m  10.6%   950K   1.07%      0   0.00%

net1                      1000mbps           up        PHYS
                    ZONE TOBYTE  MAXBW %MAXBW PRBYTE %PRBYTE POBYTE %POBYTE
                  global   126M      -      -    63M   6.30%    63M   6.30%

etherstub1                        n/a          n/a   ETHERSTUB
                    ZONE TOBYTE  MAXBW %MAXBW PRBYTE %PRBYTE POBYTE %POBYTE
                 [total]  3920K      -      -      0       -      0       -
                  global  1960K  100M*  1.96%      0       -      0       -
                   zoneA  1960K    50M  3.92%      0       -      0       -

Tip  -  Tip: To display the specific VNICs, add the –x option.