Saturday, September 26, 2009

JProc 0.2

I've been doing a little more work on JProc - a java jni interface to the Solaris procfs filesystem - to make it a little more complete and robust.

This has reached a convenient stopping point, so I've released version 0.2.

There are a couple of features that have been lifted from JKstat, namely the idea (and parts of the implementation thereof) that it's useful to manage a Set of processes as a unit, and that it's useful to be able to filter on process characteristics.

As a start, I've added filtering by user and zone. The demo application now has dropdown lists of users and zones, so you can select processes owned by a user, or running in a specific zone (or both) interactively. (They don't currently update as the list of users and zones changes - that's work left for the future.)

I've also added lookups of username, group, and zone name. This is a simple jni interface to getpwnam and friends.

One other feature I added was to convert a project id to a name. This proved rather more entertaining, as I discovered that the lookup functions are buried off in libproject rather than libc. While that of itself isn't necessarily an issue, libproject drags in quite a lot of subsidiary libraries. While in normal use they use lazy loading so that you don't drag in the extra libraries until you need them, it looks like jni drags them all in regardless. I'm not sure how useful project name/id lookups are going to be, so I may simply remove that bit of functionality.

SolView 0.47

One of the things I've been trying to do with SolView is to provide a user with multiple views of a Solaris system from all angles. I'm not going to claim I've succeeded, but I've released another SolView update with a couple of new features.

The first is to add charts from JKstat that show behaviour over time - visible in the processor and network view. I've put quite a bit into the chart support in JKstat, and was pleased that it was so easy to use it to add charts to SolView. (It's not entirely perfect - it would be nice if the colors in the cpu chart matched the cpustate widget, for example. And it's a shame that I don't collect history so that each time you look at a chart it starts from scratch.)

The second is a Process view from JProc. Which is what I wrote JProc for in the first place.

Apart from that there's the usual raft of bugfixes, and there's a little more polish. Enjoy!

Sunday, September 13, 2009

JKstat - interactive chart builder

In the latest update to JKstat I've introduced a new piece of functionality I've been wanting to get done for a while.

JKstat is pretty good at producing charts, but - until now - you've either had to take what it gives you or delve into the code. No longer. As of version 0.30, if you

./jkstat chartbuilder
you'll get a window just like this:

A kstat can be selected from the tree; you can then choose the statistic or statistics of interest, and then get a chart of either the rates of change or the values of the chosen statistic(s).

You can also choose whether to produce a line chart of the various statistics, or a stacked chart, with statistics in solid color stacked atop each other.

You can then choose whether to just show this individual instance of a kstat, or to show all the available instances (so you can, for example, produce a chart showing all the disks or all the cpus, just by picking one).

And you can decide whether to show the individual kstats, or whether to show an aggregate over all the kstats.

So, the following chart is generated by selecting cpu:0:sys from the tree, checking all instances, and asking for an aggregated, stacked chart of the cpu_nsec_idle, cpu_nsec_user, and cpu_nsec_kernel statistics, showing the relative proportions of user, system, and idle time on my system.

(If you're interested, the spike of user activity at about 21:19 is a build running; the huge splodge of kernel time just after 21:27 is VirtualBox starting up a VM.)

Tuesday, September 08, 2009

Everything Virtual

Virtualization is one of those hot IT topics, but the reality is that - in the general sense - virtualization has been around for what seems like forever.

I define virtualization as the abstraction of logical resources away from physical resources.

For example, NFS (the Network File System) allows you to access your data from any system, not just the one that happens to be physically connected to the disks on which the data is stored.

The X Window System allows you to display applications on a different host to the one where they might be running.

VNC (Virtual Network Computing) is one of many technologies that allow you to access a complete desktop on a different system to that where it's running.

The various types of Virtual Desktops supported by X11 window managers allow you to manage and display applications independently of the physical screen that you may be sitting in front of.

Solaris Zones allow you to construct an operating system instance that, while in any particular instantiation is locked to a piece of hardware, is logically distinct. It's relatively trivial to pack up a Zone, redeploy it on new hardware, and the application layer doesn't notice. Again, a level of abstraction from the physical.

Interestingly, the current virtualization fad doesn't quite work the way you would expect based on the definition I started with. Looking at the various virtual machine technologies currently in vogue, while the virtual machines are abstract from the underlying hardware, the abstraction that's presented to the user is that of physical systems. This doesn't introduce anything new, it just gives us the same old IT infrastructure we've always had, just replicated one layer up in the stack. Useful, but not revolutionary.

And the cloud doesn't really change that, because all you're getting with a cloud is an extra layer (and a whole new charging model) underneath your virtualization layer. Everything may be virtual, but in many cases all we're doing is finding new ways to implement the physical.

Wednesday, September 02, 2009

xfce-taskmanager on Solaris

XFCE has a little task manager application. It's not top or prstat, but it's reasonably lightweight and integrated.

(It also allows you to click on a column heading to sort. That's one of the things that JProc does as well and that you take for granted in a graphical application.)

The original task manager was linux-specific, and the way it wandered through /proc was never going to work on Solaris. But it was easy enough to produce a Solaris version that seems to work well enough for me. Source here.