From My Brain to Your Browser
Jeff Victor's Blog
Archives
« April 2009 »
SunMonTueWedThuFriSat
   
2
3
4
5
6
7
9
10
11
12
13
14
15
16
17
18
19
20
21
22
24
25
26
27
28
29
30
  
       
Today
Click me to subscribe
Search

Links
 

Today's Page Hits: 182

« Previous month (Feb 2009) | Main | Next month (Apr 2009) »
Thursday Apr 23, 2009
What's Pluto?

Recently a young person asked me why Pluto isn't a planet. This seemed like a good educational opportunity. The explanation I used is much simpler than the official, scientific explanation - with its "planetary discrimants" and "aggregate masses" - and turned out better than I anticipated, so I thought I would share it with you. It seems appropriate for people with at least a fourth or fifth grade education.

The study of science results in "an organized body of knowledge gained through ... research." Observational science gathers data about the universe and classifies objects, life forms, etc. according to characteristics of those things.

Applying those concepts to our solar system, we can measure those objects and group those with similar characteristics together.

Let's try that.

One of the most obvious characteristics of solar system objects is their composition. All of these objects fall neatly into one of three categories as shown by the accompanying graph:

  1. major rocky objects, e.g. Earth, Mars - these all have densities greater than 3.8 g/cm^3
  2. gaseous objects, e.g. Jupiter, Saturn, some or all of which have cores of rock and/or metallic hydrogen - these all have densities between 0.69 and 1.6 g/cm^3
  3. rock-ice bodies - objects with significant amounts of rock and ice, e.g. comets, Pluto and its satellite Charon - their densities range from 1.0 to 3.0 g/cm^3, with almost all of them in the range 1.0 to 2.0 g/cm^3.
The clearest distinction is between the three densest inner objects (Mercury, Venus, Earth) and all but one of the outer, rocky/icy objects. Haumea, in case you haven't heard of it, is the newest object to be labeled a "dwarf planet" by the International Astronomical Union.

Although there is overlap in density between the gaseous objects and the rocky/icy objects, no overlap between their sizes (masses) exists, as this next graph shows (Earth is arbitrarily assigned a value of 1,000,000 and the rest are scaled to that value):

Visually, three groupings are discernible: the gaseous objects, the large rocky objects, and everything else. Mathematically, the groupings are separated by more than an order of magnitude. In other words, the smallest member of one group is at least ten times the mass of the largest member of the next group. Uranus is more than 14 times the mass of Earth, and Mercury is almost 20 times the mass of Eris, which is more massive than Pluto.

Besides physical characteristics, the most useful ones are the orbital elements.

All members of our solar system orbit the sun, or orbit another non-stellar object which in turn orbits the sun. These orbits are, almost entirely, described by Newtonian mechanics, the basic elements of which were first described by Johannes Kepler in 1609. Although an orbit has several characteristics, the simplest of them is the semi-major axis, which is often called the "average" distance between the orbiting body and the sun. Although not quite accurate, it's close enough for this purpose.

Here is a graph of 17 of the most important bodies in our solar system. It shows the semi-major axis of each, relative to the semi-major axis of Earth, which is called an Astronomical Unit. It includes the four major rocky objects, the four gaseous objects, all five of the currently recognized dwarf planets, three asteroids, and five other relevant objects. Note that the orbital distances of Eris (68 AU) and Sedna (526 AU) are off the scale of this graph.

Again, three groups appear in the graph: the inner rocky objects, the gaseous objects, and the outer bodies. Separation between objects increases from the inner bodies to the outer ones, but suddenly, starting with Orcus, the separation between orbital distances shrinks considerably.

From those three characteristics: density, mass, and orbital distance, it seems clear that there are at least three groups of major bodies in the solar system:

  1. inner, rocky bodies, each having a mean density greater than 3.8 g/cm^3, a mass larger than one-tenth Earth's mass, and an orbital distance less than than 2 AU
  2. giant gaseous objects, each with a mean density less than 1.5 gm/cm^3, a mass larger than 14 times Earth's mass, and an orbital distance between 5 and 32 AU
  3. distant icy, rocky bodies, with a mean density less than 3 gm/cm^3 (and almost all less then 2), and an orbital distance greater than 35 AU.
Object TypeDensity
g/cm^3
Mass
(Earth=1)
Semi-Major Axis
(AU, Earth=1)
Inner, rocky>3.8>0.1<2
Giant, gaseous<1.5>145-32
Distant, icy, rocky<2 (except one)<1/200th>35

All three of those groupings can be displayed in one graph, which shows the distinction between the three different groups at a glance:

In the graph above, the green bars show the range of values for the inner, rocky bodies, scaled so that the highest value is 100. The blue bars show the ranges of values for the gaseous bodies. The purplish bars shows the ranges of values for the outer icy, rocky bodies.

Note that only two ranges overlap: densit for the gaseous and the icy rocky bodies. For all of the other characteristics, there are clear gaps between the ranges of the groups.

Now that we have clear groupings, the question becomes "which of those groups should be planets?" I hope it's obvious that the first two categories should be included in the list of 'planets.' The third group can be included or not, depending on how you want to define the term 'planet.'

However, there are two other factors which help me to decide. Initially, 'planets' were the five wandering lights that weren't the Sun and Moon. These seven wandering lights were so important that early western cultures assigned a day of worship to each, leading eventually to the names of our days.

If 'planets' started with the five wandering stars, it makes sense to add other bodies which have similar characteristics - Uranus and Neptune - yielding a total of eight planets. But none of the others - Pluto, Haumea, Quaoar, etc. - are like the original wandering lights in the sky.

Further, if we were to include the outer, rocky, icy bodies in the list of planets, the list grows significantly. Today, the list would include 13 members, but another 40 known objects might be categorized with Eris, Pluto, et al., and another 150 or more are probably out there. If the category 'planet' can have 8 members or 200, I'll go with 8.

Finally, regarding the question "is it 'right' to 'demote' Pluto?" The list of planets has grown and shrunk several times throughout history. More than 25 bodies have been labeled 'planets' only to be 'demoted' later. Pluto is nothing special in this regard.

Posted at 03:03PM Apr 23, 2009 by Jeffrey Victor in Science  |  Comments[2]

Wednesday Apr 08, 2009
Zonestat 1.4 Now Available

I have posted Zonestat v1.4 at: the Zone Statistics project page (click on "Files" in the left navbar).

Zonestat is a 'dashboard' for Solaris Containers. It shows resource consumption of each Container (aka Zone) and a comparison of consumption against limits you have set.

Changes from v1.3:

Note that the addition of a timestamp to -P output changes the output format for "machine-readable" output.

For most people, the most important change will be the use of DTrace to collect CPU% data. This has two effects. The first effect is improved correctness. The prstat command - used in V1.3 and earlier, can horribly underestimate CPU cycles consumed because it can miss many short-lived processes. The mpstat has its own problems with mis-counting CPU usage. So I expanded on a solution Jim Fiori offered, which uses DTrace to answer the question "which zone is using a CPU right now?"

The other benefit to DTrace is the improvement in performance of Zonestat.

The less popular, but still interesting additions include:

Please send questions and requests to zones-discuss@opensolaris.org .

Posted at 09:20AM Apr 08, 2009 by Jeffrey Victor in Solaris 10 Containers  |  Comments[5]

Wednesday Apr 01, 2009
Patching Zones Goes Zoom!

Accelerated Patching of Zoned Systems

Introduction

If you have patched a system with many zones, you have learned that it takes longer than patching a system without zones. The more zones there are, the longer it takes. In some cases, this can raise application downtime to an unacceptable duration.

Fortunately, there are a few methods which can be used to reduce application downtime. This document mentions many of them, and then describes the performance enhancements of two of them. But the bulk of this rather bulky entry is the description and results of my newest computer... "experiments."

Executive Summary, for the Attention-Span Challenged

It's important to distinguish between application downtime, service downtime, zone downtime, and platform downtime. 'Service' is the service being provided by an application or set of applications. To users, that's the most important measure. As long as they can access the service, they're happy. (Doesn't take much, does it?)

If a service depends on the proper operation of each of its component applications, planned or unplanned downtime of one application will result in downtime of the service. Some software, e.g. web server software, can be deployed in multiple, load-balanced systems so that the service will not experience downtime even if one of the software instances is down.

Applying an operating system patch may require service downtime, application downtime, zone downtime or platform downtime, depending on the patch and the entity being patched. Because in many cases patch application will require application downtime, the goal of the methods mentioned below, especially parallel patching of zones, is to minimize elapsed downtime to achieve a patched, running system.

Just Enough Choices to Confuse

Methods that people use - or will soon use - to improve the patching experience of zoned systems include:

Disclaimer 1: the "Zones Parallel Patching" patch ("ZPP") is still in testing and has not yet been released. It is expected to be released mid-CY2009. That may change. Further, the specific code changes may change, which may change the results described below.

Disclaimer 2: the experiment described below, and its results, are specific to one type of system (Sun Fire T2000) and one patch (120534-14 - "the Apache patch"). Performance improvements using other hardware and other patches will produce different results.

Yet More Background

I wanted to better understand two methods of accelerating the patching of zoned systems, especially when used in combination. Currently, a patch applied to the global zone will normally be applied to all non-global zones, one zone at a time. This is a conservative approach to the task of patching multiple zones, but doesn't take full advantage of the multi-tasking abilities of Solaris.

I learned that a proposed patch was created that enables the system administrator to apply a patch in the global zone which patches the global and then patches multiple zones at the same time. The parallelism (i.e. "the number of zones that are patched at one time") can be chosen before the patch is applied. If there are multiple "Solaris CPUs" in the system, multiple CPUs can be performing computational steps at the same time. Even if there aren't many CPUs, one zone's patching process can be using a CPU while another's is writing to a disk drive.

<tangent topic="Solaris vCPU"> I use the phrase "Solaris CPUs" to refer to the view that Solaris has of CPUs. In the old days, a CPU was a CPU - one chip, one computational entity, one ALU, one FPU, etc. Now there are many factors to consider - CPU sockets, CPU cores per socket, hardware threads per core, etc. Solaris now considers "vCPUs" - virtual processors - as entities on which to schedule processors. Solaris considers each of these a vCPU:

</tangent>

Separately, I realized that one part of patching is disk-intensive. Many disk-intensive workloads benefit from writing to a solid-state disk (SSD) because of the performance benefit of those devices over spinning-rust disk drives (HDD).

So finally (hurrah!) the goal of this adventure: how much performance advantage would I achieve with the combination of parallel patching and an SSD, compared to sequential patching of zones on an HDD?

He Finally Begins to Get to the Point

I took advantage of an opportunity to test both of these methods to accelerate patching. The system was a Sun Fire T2000 with two HDDs and one SSD. The system had 32 vCPUs, was not using Logical Domains, and was running Solaris 10 10/08. Solaris was installed on the first HDD. Both HDDs were 72GB drives. The SSD was a 32GB device. (Thank you, Pat!)

For some of the tests I also applied the ZPP. (Thank you, Enda!) For some of the tests I used zones that had zonepaths on the SSD; the rest 'lived' on the second HDD.

As with all good journeys, this one had some surprises. And, as with all good research reports, this one has a table with real data. And graphs later on.

To get a general feel for the different performance of an HDD vs. an SSD, I created a zone on each - using the secondary HDD - and made clones of it. Some times I made just one clone at a time, other times I made ten clones simultaneously. The iostat(1) tool showed me the following performance numbers:

 r/sw/skr/skw/swaitactvsvc_t%w%b
clone x1 on HDD56227833332306.423172
clone x1 on SSD35379115616500016
clone x10 on HDD35470182327431952462599
clone x10 on SSD354295824133026241541034

At light load - just one clone at a time - the SSD performs better than the HDD, but at heavy load the SSD performs much much better, e.g. nine times the write throughput and 13x the write IOPS of the HDD, and the device driver and SSD still have room for more (34% busy vs. 99% busy).

Cloning a zone consists almost entirely of copying files. Patching has a higher proportion of computation, but those results gave me high hopes for patching. I wasn't disappointed. (Evidently, every good research report also includes foreshadowing.)

In addition to measuring the performance boost of the ZPP I wanted to know if that patch would help - or hurt - a system without using its parallelization feature. (I didn't have a particular reason to expect non-parallelized improvement, but occasionally I'm an optimist. Besides, if the performance with the ZPP was different without actually using parallelization, it would skew the parallelized numbers.) So before installing the patch, I measured the length of time to apply a patch. For all of my measurements, I used patch 120543-14 - the Apache patch. At 15MB, it's not a small patch, nor is it very large patch. (The "Baby Bear" patch, perhaps? --Ed.) It's big enough to tax the system and allow reasonable measurements, but small enough that I could expect to gather enough data to draw useful conclusions, without investing a year of time...

#define TEST while(1) {patchadd; patchrm;}

So, before applying the ZPP, and without any zones on the system, I applied the Apache patch. I measured the elapsed time because our goal is to minimize elapsed time of patch application. Then I removed the Apache patch.

Then I added a zone to the system, on the secondary HDD, and, I re-applied the Apache patch to the system, which automatically applied it to the zone as well. I removed the patch, created two more zones, and applied the same patch yet again. Finally, I compared the elapsed time of all three measurements. Patching the global zone alone took about 120 seconds. Patching with one non-global zone took about 175 seconds: 120 for the global zone and 55 for the zone. Patching three zones took about 285 seconds: 120 seconds for the global zone and 55 seconds for each of the three zones.

Theoretically, the length of time to patch each zone should be consistent. Testing that theory, I created a total of 16 zones and then applied the Apache patch. No surprises: 55 seconds per zone.

To test non-parallel performance of the ZPP, I applied it, kept the default setting of "no parallelization," and then re-did those tests. Application of the Apache patch did not change in behavior nor in elapsed time per zone, from zero to 16 zones. (However, I had a faint feeling that Solaris was beginning to question my sanity. "Get inline," I told it...)

How about the SSD - would it improve patch performance with zero or more zones? I removed the HDD zones and installed a succession of zones - zero to 16 - on the SSD and applied the Apache patch each time. The SSD did not help at all - the patch still took 55 seconds per zone. Evidently this particular patch is not I/O bound, it is CPU bound.

But applying the ZPP does not, by default, parallelize anything. To tell the patch tools that you would like some level of parallelization, e.g. "patch four zones at the same time," you must edit a specific file in the /etc/patch directory and supply a number, e.g. '4'. After you have done that, if parallel patching is possible, it will happen automatically. Multiple zones (e.g. four) will be patched at the same time by a patchadd process running in each zone. Because that patchadd is running in a zone, it will use the CPUs that the zone is assigned to use - default or otherwise. This also means that the zone's patchadd process is subject to all of the other resource controls assigned to the zone, if any.

Changing the parallelization level to 8, I re-did all of those measurements, on the HDD zones and then the SSD zones. The performance impact was obvious right away. As the graph to the right shows, the elapsed time to patch the system with a specific number of zones was less with the ZPP. ('P' indicates the level of parallelization: 1, 8 or 16 zones patched simultaneously. The blue line shows no parallelization, the red line shows the patching of eight zones simultaneously.) Turning the numbers around, the patching "speed" improved by a factor of three.

How much more could I squeeze out of that configuration? I increased the level of parallelization to 16 and re-did everything. No additional performance, as the graph shows. Maybe it's a coincidence, but a T2000 has eight CPU cores - maybe that's a limiting factor.

At this point the SSD was feeling neglected, so I re-did all of the above with zones on the SSD. This graph shows the results: little benefit at low zone count, but significant improvement at higher zone counts - when the HDD was the bottleneck. Combining ZPP and SSD resulted in patching throughput improvement of 5x with 16 zones.

That seems like magic! What's the trick? A few paragraphs back, I mentioned the 'trick': using all of the scalability of Solaris and, in this case, CMT systems. Patching a system without ZPP - especially one without a running application - leaves plenty of throughput performance "on the table." Patching muliple zones simultaneously uses CPU cycles - presumably cycles that would have been idle. And it uses I/O channel and disk bandwidth - also, hopefully, available bandwidth. Essentially, ZPP is shortening the elapsed time by using more CPU cycles and I/O bandwidth now instead of using them later.

So the main caution is "make sure there is sufficient compute and I/O capacity to patch multiple zones at the same time."

But whenever multiple apps are running on the same system at the same time, the operating system must perform extra tasks to enable them to run safely. It doesn't matter if the "app" is a database server or 'patchadd.' So is ZPP using any "extra" CPU, i.e. is there any CPU overhead?

Along the way, I collected basic CPU statistics, including system and user time. The next graph shows that the amount of total CPU time (user+sys) increased slightly. The overhead was less than 10% for up to 8 zones. Another coincidence? I don't know, but at that point the overhead was roughly 1% per zone. The overhead increased faster beyond P=8, indicating that, perhaps, a good rule of thumb is P="number of unused cores." Of course, if the system is using Dynamic Resource Pools or dedicated-cpus, the rule might need to be changed accordingly. TANSTAAFL.

Conclusion

All good tales need a conclusion. The final graph shows the speedup - the increase in patching throughput - based on the number of zones, level of parallelization, and device type. Specific conclusions are:
  1. Parallel patching zones significantly reduces elapsed time if there are sufficient compute and I/O resources available.
  2. Solid-state disks significantly improve patching throughput for high-zone counts and similar levels of parallelization.
  3. The amount of work accomplished does not decrease - it's merely compressed into a shorter period of elapsed time.
  4. If patching while applications are running:
    • plan carefully in order to avoid impacting the responsiveness of your applications. Choose a level of parallelization commensurate with the amount of available compute capacity
    • use appropriate resource controls to maintain desired response times for your applications.

Getting the ZPP requires waiting until mid-year. Getting SSDs is easy - they're available for the Sun 7210 and 7410 Unified Storage Systems and for Sun systems.

Posted at 01:48PM Apr 01, 2009 by Jeffrey Victor in Solaris 10 Containers  |  Comments[6]