All of lore.kernel.org
 help / color / mirror / Atom feed
From: Chuck Lever <chuck.lever@oracle.com>
To: Kevin Constantine
	<Kevin.Constantine-FfNkGbSheRGpB8w63BLUukEOCMrvLtNR@public.gmane.org>
Cc: linux-nfs@vger.kernel.org
Subject: Re: [PATCH 2/2] nfs-iostat.py: Added bytes written output
Date: Tue, 21 Apr 2009 15:00:41 -0400	[thread overview]
Message-ID: <981BA943-47FA-433D-A762-B83983E6532A@oracle.com> (raw)
In-Reply-To: <49EE0901.2040704-P5ys19MLBK/QT0dZR+AlfA@public.gmane.org>

On Apr 21, 2009, at 1:57 PM, Kevin Constantine wrote:
> Chuck Lever wrote:
>> On Apr 20, 2009, at 10:03 PM, Kevin Constantine wrote:
>>> Print statistics about bytes written by NFS
>>>
>>> Signed-off-by: Kevin Constantine <kevin.constantine-FfNkGbSheRGpB8w63BLUukEOCMrvLtNR@public.gmane.org 
>>> >
>>> ---
>>> tools/nfs-iostat/nfs-iostat.py |   10 ++++++++++
>>> 1 files changed, 10 insertions(+), 0 deletions(-)
>>>
>>> diff --git a/tools/nfs-iostat/nfs-iostat.py b/tools/nfs-iostat/nfs- 
>>> iostat.py
>>> index d331a72..5f2e232 100644
>>> --- a/tools/nfs-iostat/nfs-iostat.py
>>> +++ b/tools/nfs-iostat/nfs-iostat.py
>>> @@ -221,6 +221,7 @@ class DeviceData:
>>>        """
>>>        nfs_stats = self.__nfs_data
>>>        app_bytes_read = float(nfs_stats['normalreadbytes'] +  
>>> nfs_stats['directreadbytes'])
>>> +        bytes_written_by_app =  
>>> float(nfs_stats['normalwritebytes'] + nfs_stats['directwritebytes'])
>>>        if app_bytes_read != 0:
>>>            read_bytes_from_server =  
>>> float(nfs_stats['serverreadbytes'])
>>>            directio_bytes_from_server =  
>>> float(nfs_stats['directreadbytes'])
>>> @@ -234,6 +235,15 @@ class DeviceData:
>>>                        cached_read_bytes / 1024.0 / 1024.0, \
>>>                        app_bytes_read / 1024.0 / 1024.0, \
>>>                        ratio)
>>> +    if bytes_written_by_app != 0:
>>> +        bytes_written_by_nfs = float(nfs_stats['serverwritebytes'])
>>> +        cached_write_bytes = float(bytes_written_by_app -  
>>> bytes_written_by_nfs);
>> Again, I don't see why this computation is necessary:  The  
>> "normalwritebytes" statistic is what was written through the  
>> client's cache, and "directwritebytes" counts the number of bytes  
>> that were written via O_DIRECT.
>
> As I said in the email preceding these patches:
> "I'm not quire sure about this patch.  I'm seeing oddities where the  
> number of bytes in "NORMALWRITTENBYTES + DIRECTWRITTENBYTES" does  
> not equal SERVERWRITTENBYTES.  In some cases the amount of data  
> written by the app (normalwrittenbytes + directwrittenbytes) is  
> greater than the amount of data written to the server, and in other  
> cases it's less than the amount of data written to the server.  At  
> the moment, i've ascribed that difference to data being written to  
> the local cache and not flushed, but that doesn't make a whole lot  
> of sense."

Our e-mail system may have barfed on my earlier reply, but I would  
like to understand why you need this statistic.  What kind of analysis  
are you looking for on the write side?

>
>>> +        print
>>> +            print '%13s %12s %15s %15s' % ("Data Written:", "To  
>>> Server", "To Cache", "Total")
>>> +        print '%10s %13.4fMB %13.4fMB %13.4fMB' % ("", \
>>> +                            bytes_written_by_nfs / 1024.0 /  
>>> 1024.0, \
>>> +                        cached_write_bytes / 1024.0 / 1024.0, \
>>> +                        bytes_written_by_app / 1024.0 / 1024.0)
>>>
>>>    def __print_attr_cache_stats(self, sample_time):
>>>        """Print attribute cache efficiency stats

--
Chuck Lever
chuck[dot]lever[at]oracle[dot]com

  parent reply	other threads:[~2009-04-21 20:06 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-04-21  2:03 Add data cache statistics to nfs-iostat.py Kevin Constantine
     [not found] ` <1240279414-30528-1-git-send-email-kevin.constantine-FfNkGbSheRGpB8w63BLUukEOCMrvLtNR@public.gmane.org>
2009-04-21  2:03   ` [PATCH 1/2] nfs-iostat.py: Print Data Cache Statistics Kevin Constantine
     [not found]     ` <1240279414-30528-2-git-send-email-kevin.constantine-FfNkGbSheRGpB8w63BLUukEOCMrvLtNR@public.gmane.org>
2009-04-21  2:03       ` [PATCH 2/2] nfs-iostat.py: Added bytes written output Kevin Constantine
     [not found]         ` <1240279414-30528-3-git-send-email-kevin.constantine-FfNkGbSheRGpB8w63BLUukEOCMrvLtNR@public.gmane.org>
2009-04-21 14:26           ` Chuck Lever
2009-04-21 17:57             ` Kevin Constantine
     [not found]               ` <49EE0901.2040704-P5ys19MLBK/QT0dZR+AlfA@public.gmane.org>
2009-04-21 19:00                 ` Chuck Lever [this message]
2009-04-21 20:39                   ` Kevin Constantine
2009-04-21 20:46                     ` Chuck Lever
2009-04-21 14:26       ` [PATCH 1/2] nfs-iostat.py: Print Data Cache Statistics Chuck Lever
2009-04-21 17:54         ` Kevin Constantine
     [not found]           ` <49EE083C.6010105-P5ys19MLBK/QT0dZR+AlfA@public.gmane.org>
2009-04-21 18:58             ` Chuck Lever
2009-04-22  1:42               ` [PATCH] " Kevin Constantine
     [not found]                 ` <1240364531-11499-1-git-send-email-kevin.constantine-FfNkGbSheRGpB8w63BLUukEOCMrvLtNR@public.gmane.org>
2009-04-22 18:38                   ` Chuck Lever
2009-04-25  3:16                     ` Kevin Constantine
     [not found]                       ` <49F28096.9060300-P5ys19MLBK/QT0dZR+AlfA@public.gmane.org>
2009-04-27 15:33                         ` Chuck Lever
2009-04-30  1:57                           ` Kevin Constantine
2009-04-30 14:43                             ` Chuck Lever

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=981BA943-47FA-433D-A762-B83983E6532A@oracle.com \
    --to=chuck.lever@oracle.com \
    --cc=Kevin.Constantine-FfNkGbSheRGpB8w63BLUukEOCMrvLtNR@public.gmane.org \
    --cc=linux-nfs@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.