You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@couchdb.apache.org by Larry <la...@lroot.com> on 2009/10/22 23:05:58 UTC

Understanding CouchDB stats

So I'm trying to wrap my head around CouchDB stats. I'm trying to figure out
exactly what the various data values mean. For example lets say I query the
"couchdb" group for the "database_reads" metric with the range parameter of
300 (5 minutes). It returns data similar to:

'database_reads' =>
  array (
    'current' => 85168,
    'count' => 3671,
    'mean' => 23.2002179243,
    'min' => 0,
    'max' => 153,
    'stddev' => 23.8069956677,
    'description' => 'number of times a document was read from a database',
  )

As I understand it this is all the data being collected for the 5 minute
interval. So with that understanding I have the following questions:


   1. What exactly is 'current' & 'count'. What are each of them recording
   and why is 'count' less than 'current' in my system (seems counter intuitive
   to me).
   2. Can the 'mean' here be interpreted as average reads per second?
   3. Is there any indication of exactly where within the 5 minute interval
   we are?


Another metric that I'm having trouble with is the 'request_time'. Querying
it returns data similar to:

'request_time' =>
  array (
    'current' => 56,
    'count' => 265465,
    'mean' => 7.39186333415,
    'min' => 0,
    'max' => 6796,
    'stddev' => 39.6154036284,
    'description' => 'length of a request inside CouchDB without MochiWeb',
  )


   1. Again, same question about exactly what the 'count' and 'current'
   values mean for this metric.
   2. Does the 'mean' represent the average time for a request in CouchDB in
   seconds?


Thanks for the help guys, its always greatly appreciated!

larry

Re: Understanding CouchDB stats

Posted by Larry <la...@gmail.com>.
Great, Thanks!

On Thu, Oct 22, 2009 at 2:46 PM, Paul Davis <pa...@gmail.com>wrote:

> >   1. What exactly is 'current' & 'count'. What are each of them recording
> >   and why is 'count' less than 'current' in my system (seems counter
> intuitive
> >   to me).
>
> Current is a sum of the values recorded. For things like HTTP
> requests, this is the total number of requsts.
>
> Count is the number of updates for this metric in the given time span.
>
> Stats works with two parts, a collector and an aggregator. The
> collector part receives messages from through out CouchDB and holds
> that data in a table. Once a second the aggregator will sweep through
> the collector and update its stats.
>
> So, if you had 20K requests between to aggregator sweeps, Current
> would be incremented by 20K and Count is incremented by 1.
>
> >   2. Can the 'mean' here be interpreted as average reads per second?
>
> For requests, the mean is roughly the requests per second. Its not as
> theoretically correct as something like RRDtool because we don't
> interpolate, we just average the reads we take roughly once a second.
>
> >   3. Is there any indication of exactly where within the 5 minute
> interval
> >   we are?
> >
>
> No, but the current implementation (committed after 0.10.x was
> branched) does not reset statistic aggregators as the old code did.
> The new method is the more standard "these stats reflect all values
> seen in the last 5 minutes" regardless of when you query it.
>
> > Another metric that I'm having trouble with is the 'request_time'.
> Querying
> > it returns data similar to:
>
> [snip]
>
> >   1. Again, same question about exactly what the 'count' and 'current'
> >   values mean for this metric.
>
> Oh weird. So, Count has the same meaning as before, but here Current
> is the length of the last recorded request. The weirdness comes from
> the fact that this is averaging a set of distinct points, where as
> things like requests are averaging the relative change so current
> makes a bit more sense there.
>
> >   2. Does the 'mean' represent the average time for a request in CouchDB
> in
> >   seconds?
>
> milliseconds.
>
> HTH,
> Paul Davis
>

Re: Understanding CouchDB stats

Posted by Paul Davis <pa...@gmail.com>.
>   1. What exactly is 'current' & 'count'. What are each of them recording
>   and why is 'count' less than 'current' in my system (seems counter intuitive
>   to me).

Current is a sum of the values recorded. For things like HTTP
requests, this is the total number of requsts.

Count is the number of updates for this metric in the given time span.

Stats works with two parts, a collector and an aggregator. The
collector part receives messages from through out CouchDB and holds
that data in a table. Once a second the aggregator will sweep through
the collector and update its stats.

So, if you had 20K requests between to aggregator sweeps, Current
would be incremented by 20K and Count is incremented by 1.

>   2. Can the 'mean' here be interpreted as average reads per second?

For requests, the mean is roughly the requests per second. Its not as
theoretically correct as something like RRDtool because we don't
interpolate, we just average the reads we take roughly once a second.

>   3. Is there any indication of exactly where within the 5 minute interval
>   we are?
>

No, but the current implementation (committed after 0.10.x was
branched) does not reset statistic aggregators as the old code did.
The new method is the more standard "these stats reflect all values
seen in the last 5 minutes" regardless of when you query it.

> Another metric that I'm having trouble with is the 'request_time'. Querying
> it returns data similar to:

[snip]

>   1. Again, same question about exactly what the 'count' and 'current'
>   values mean for this metric.

Oh weird. So, Count has the same meaning as before, but here Current
is the length of the last recorded request. The weirdness comes from
the fact that this is averaging a set of distinct points, where as
things like requests are averaging the relative change so current
makes a bit more sense there.

>   2. Does the 'mean' represent the average time for a request in CouchDB in
>   seconds?

milliseconds.

HTH,
Paul Davis