pcp
[Top] [All Lists]

Re: Easy test to distinguish host metrics from container metrics?

To: Richard Wong <richard.wong.com@xxxxxxxxx>
Subject: Re: Easy test to distinguish host metrics from container metrics?
From: fche@xxxxxxxxxx (Frank Ch. Eigler)
Date: Fri, 02 Oct 2015 14:58:14 -0400
Cc: pcp@xxxxxxxxxxx
Delivered-to: pcp@xxxxxxxxxxx
In-reply-to: <CAP2pTW4Dqv2rdJ1ipKp8UOnCePC3yvfHxjPuG3ABm1=CMWBF-w@xxxxxxxxxxxxxx> (Richard Wong's message of "Fri, 2 Oct 2015 11:08:46 -0700")
References: <CAP2pTW4Dqv2rdJ1ipKp8UOnCePC3yvfHxjPuG3ABm1=CMWBF-w@xxxxxxxxxxxxxx>
User-agent: Gnus/5.1008 (Gnus v5.10.8) Emacs/21.4 (gnu/linux)
richard.wong.com wrote:


> [...]  Are there any simple or straightforward tests I could try to
> verify that the metrics I get from subsequent fetches are indeed
> container metrics and not host metrics?

One heuristic is to check pmcd.hostname.  That will generally vary
between the host and each container.  Another one could be to check a
cgroup.* metric.  When polled from a containery context, the
instance-domain is implicitly restricted to the container's own
cgroups; when polled from host context, it's the full indom.


> So far using pmchart, I notice that the values of some metrics will
> be the same given a plain hostspec, a hostspec with a valid
> container,

Yes, this could be for a variety of reasons.  One is that not all
pmdas have been converted to container-aware operation; another is
that the kernel does not virtualize all of its state to be
container-specific.  (I don't know of a recorded pcp bug to track 
progress on the former; there should be.)

> and a hostspec with a container which does not exist.

That is a bug: http://oss.sgi.com/bugzilla/show_bug.cgi?id=1111


- FChE

<Prev in Thread] Current Thread [Next in Thread>