Zonestat v1.3

It's - already - time for a zonestat update. I was never happy with the method that zonestat used to discover the mappings of zones to resource pools, but wanted to get v1.1 "out the door" before I had a chance to improve on its use of zonecfg(1M). The obvious problem, which at least one person stumbled over, was the fact that you can re-configure a zone while it's running. After doing that, the configuration information doesn't match the current mapping of zone to pool, and zonestat became confused.

Anyway, I found the time to replace the code in zonestat which discovered zone-to-pool mappings with a more sophisticated method. The new method uses ps(1) to learn the PID that each zone's [z]sched process is. Then it uses "poolbind -q <PID>" to look up the pool for that process. The result is more accurate data, but the ps command does use more CPU cycles.

While performing surgery on zonestat, I also:

  • began using the kstat module for Perl, reducing CPU time consumed by zonestat
  • fixed some bugs in CPU reporting
  • limited zonename output to 8 characters to improve readability
  • made some small performance improvements
  • added a $DEBUG variable which can be used to watch the commands that zonestat is using
With all of that, zonestat v1.3 provides better data, is roughly 30% faster, and is even smaller than the previous version! :-) You can find it at http:://opensolaris.org/os/project/zonestat.

Comments:

Jeff,

This is awesome. I've been looking for this exact thing. However, when I run 1.3 it takes 15 seconds versus less than 4 seconds for 1.2. Also, 1.3 no longer shows the zones broken out. It only shows the totals. Did I miss a new flag?

Sam

Posted by Sam Freiberg on November 24, 2008 at 08:39 AM EST #

Great improvement on the earlier version. For pset, it would be helpful to see the load factor from poolstat.

Posted by Jeroen on November 25, 2008 at 03:39 PM EST #

Great improvements! Any chance of varying the zone name field based on the length of the actual names, or adding a "long name" flag. One of the specific reasons we like zonestat is that it supported names longer than 8 characters.

Posted by Greg Kranz on December 07, 2008 at 02:32 AM EST #

Greg - good idea, and easy to implement. I'll add it to v1.3.1.

Jeroen - please bring this up on zones-discuss at opensolaris.org - it needs some discussion.

Posted by Jeff Victor on December 07, 2008 at 02:51 AM EST #

Great tool. I'll have to second Greg's comments on the zone name length. Adding a "long name" flag or increasing the name field would be helpful.

Posted by Ed Ortiz on February 03, 2009 at 02:01 AM EST #

Post a Comment:
Comments are closed for this entry.
About

Jeff Victor writes this blog to help you understand Oracle's Solaris and virtualization technologies.

The views expressed on this blog are my own and do not necessarily reflect the views of Oracle.

Search

Archives
« April 2014
SunMonTueWedThuFriSat
  
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
   
       
Today