[pve-devel] [PATCH container 1/2] Add disk operations to vmstatus

Tobias Böhm tb at robhost.de
Thu Jun 29 11:23:50 CEST 2017


> On Wed, Jun 28, 2017 at 10:01:59AM +0200, Wolfgang Bumiller wrote:
> > On Mon, Jun 19, 2017 at 12:10:10PM +0200, Tobias Böhm wrote:
> > > Currently, only read/write bytes are extracted from cgroups stats.
> > 
> > s/bytes/operations/
> > 
> > > In order to provide IO operation stats these counters need to be
> > > read as well.
> > > 
> > > Signed-off-by: Tobias Böhm <tb at robhost.de>
> > > ---
> > >  src/PVE/LXC.pm | 12 ++++++++++++
> > >  1 file changed, 12 insertions(+)
> > > 
> > > diff --git a/src/PVE/LXC.pm b/src/PVE/LXC.pm
> > > index 32b0318..8e1043a 100644
> > > --- a/src/PVE/LXC.pm
> > > +++ b/src/PVE/LXC.pm
> > > @@ -183,6 +183,9 @@ sub vmstatus {
> > >  	$d->{diskread} = 0;
> > >  	$d->{diskwrite} = 0;
> > >  
> > > +	$d->{ioread} = 0;
> > > +	$d->{iowrite} = 0;
> > > +
> > >  	$d->{template} = PVE::LXC::Config->is_template($conf);
> > >      }
> > >  
> > > @@ -210,6 +213,15 @@ sub vmstatus {
> > >  	    }
> > >  	}
> > >  
> > > +	my $blkio_opers = read_cgroup_value('blkio', $vmid, 'blkio.throttle.io_serviced', 1);
> > 
> > The blkio cgroup is not really hierarchical. If a container creates a
> > subdirectory in its /sys/fs/cgroup/blkio and moves its processes into
> > it you won't see any updates here, and recursing through the entire
> > tree is a no-go. We need a better solution for this.
> 
> Note that yes, we do already use the blkio cgroup a couple lines above,
> but that, too, is basically "broken" (depending on the storage and what
> the container actually does) and adding more "wrong" data doesn't
> really make sense to me.
> 

I see. Unfortunately it seems there isn't a better way yet. Even lxc-top
seems to read just from this cgroup, thus is probably showing not the
right data then under this problematic circumstances?

So, if there is no reliable way to fetch these data for containers, what
would be the proper way to reflect that in the generic VM stats? Setting
these values to "undef" for containers and not rendering a graph seems
to be the only sensible way, I guess. Or is there a better way to handle
this?




More information about the pve-devel mailing list