Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 04 Feb 2003 22:44:47 +0100
From:      Poul-Henning Kamp <phk@freebsd.org>
To:        current@freebsd.org
Subject:   Preview:  GEOMs statistics code.
Message-ID:  <25779.1044395087@critter.freebsd.dk>

next in thread | raw e-mail | index | archive | help

I have created a patch which contains a preview of the statistics
code I intend to add to GEOM, and would invite people to play with
it and give me some feedback:

	http://phk.freebsd.dk/patch/geom_iostat.patch

Here is a small shell-script to watch the output with:

	http://phk.freebsd.dk/patch/geom_iostat.sh

Here's the story:

For each consumer and provider[0] in the GEOM mesh I collect three
metrics:

	nop	- Number of operations
	nerr	- Number of non-zero error returned.
	dt	- Accumulated request time.

These three are collected for the three I/O operations: Read, Write
and Delete[1].

(Currently the patch exports the values in ascii with a sysctl, this
will change to binary once the prototyping has finished)

If you run the shellscript above you will get auto-refreshing output
like this (Apologies for wide lines):

0xc412db00 "ad0s4c"     R     4160    0 0.002670 W   232389    0 0.006616 D     4083    0 0.001208 
0xc412dd00 ""           R     4162    0 0.002641 W   232390    0 0.005835 D     4083    0 0.000098 
0xc412c800 "ad0"        R     4188    0 0.002628 W   232390    0 0.005661 D     4083    0 0.000010 
0xc412d500 ""           R     4150    0 0.002655 W   232389    0 0.006616 D     4083    0 0.001208 
0xc414e000 "ad0s4"      R     4167    0 0.002646 W   232390    0 0.005835 D     4083    0 0.000098 
0xc414e100 ""           R     4168    0 0.002612 W   232390    0 0.005661 D     4083    0 0.000010 

The colums are:
    Identifier - can be found in the "sysctl -b kern.geom.confxml" output)

    Name - Only for providers and only while prototyping.

    "R" - indicates read metrics follows.
   
    nop - Number of read operations

    nerr - Number of errored operations

    dt - Average respons time.

    (the, "W", nop, nerr, dt, "D", nop, nerr, dt)


Now, discussion time:

Collecting number of operations and number of errors is a nobrainer.

The timestamps cost something to make, and my plan was to only collect
them while a monitoring program is running.  (Is this a good idea ?)

In difference from the devstat framework which measures how big a
percentage of the time a drive has one or more outstanding requests,
I think that measuring the responstime is a much more useful metric.
(comments, input, references welcome)

I pressume we also want to collect number of bytes transferred, and
I will add that in the next iteration.

Comments, ideas, suggestions.

Poul-Henning

[0] A consumer is the "filehandle" a geom method uses to initiate
I/O on.  The BSD geom which splits ad0s1 int ad0s1[a-h] has a single
consumer which is attached to ad0s1's provider.  Consumers are unnamed
and more than one consumer can be attached to a provider.

A provider is a service point on a method and it has a name.  In
the above example, the BSD geom would have providers named ad0s1[a-h]

[1] Delete is used to indicate sectors no longer in use in order to
implement features like secure erase, pre-erase of flash devices etc.

-- 
Poul-Henning Kamp       | UNIX since Zilog Zeus 3.20
phk@FreeBSD.ORG         | TCP/IP since RFC 956
FreeBSD committer       | BSD since 4.3-tahoe
Never attribute to malice what can adequately be explained by incompetence.

To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-current" in the body of the message




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?25779.1044395087>