All of lore.kernel.org
 help / color / mirror / Atom feed
* Exposing cache statistics
@ 2009-04-15 20:30 Kevin Constantine
       [not found] ` <49E643CD.9070809-P5ys19MLBK/QT0dZR+AlfA@public.gmane.org>
  0 siblings, 1 reply; 6+ messages in thread
From: Kevin Constantine @ 2009-04-15 20:30 UTC (permalink / raw)
  To: Linux NFS Mailing list

Has there been any effort to expose caching statistics to the end user? 
  On the client-side, it would be useful to see how much data is being 
re-used from cache vs data that gets retrieved over the wire.  Similarly 
on the server side, it would be nice to see how much data is being 
served from cache vs having to pull the data from disk.

Just wondering if anyone started anything to expose this sort of 
information.

Thanks
-kevin

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: Exposing cache statistics
       [not found] ` <49E643CD.9070809-P5ys19MLBK/QT0dZR+AlfA@public.gmane.org>
@ 2009-04-15 20:41   ` Trond Myklebust
       [not found]     ` <1239828092.5177.139.camel-rJ7iovZKK19ZJLDQqaL3InhyD016LWXt@public.gmane.org>
  0 siblings, 1 reply; 6+ messages in thread
From: Trond Myklebust @ 2009-04-15 20:41 UTC (permalink / raw)
  To: Kevin Constantine; +Cc: Linux NFS Mailing list

On Wed, 2009-04-15 at 13:30 -0700, Kevin Constantine wrote:
> Has there been any effort to expose caching statistics to the end user? 
>   On the client-side, it would be useful to see how much data is being 
> re-used from cache vs data that gets retrieved over the wire.  Similarly 
> on the server side, it would be nice to see how much data is being 
> served from cache vs having to pull the data from disk.
> 
> Just wondering if anyone started anything to expose this sort of 
> information.

See the nfs-iostat tool in the nfs-utils package:

   http://git.linux-nfs.org/?p=steved/nfs-utils.git;a=tree;f=tools/nfs-iostat;h=929e303cc762a68dfd01546f5150eb294274164e;hb=refs/heads/master

Note that you need a 2.6.17 kernel or newer.

Cheers
  Trond


^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: Exposing cache statistics
       [not found]     ` <1239828092.5177.139.camel-rJ7iovZKK19ZJLDQqaL3InhyD016LWXt@public.gmane.org>
@ 2009-04-17  0:33       ` Kevin Constantine
       [not found]         ` <49E7CE3E.8020006-P5ys19MLBK/QT0dZR+AlfA@public.gmane.org>
  2009-04-17 15:58         ` Chuck Lever
  0 siblings, 2 replies; 6+ messages in thread
From: Kevin Constantine @ 2009-04-17  0:33 UTC (permalink / raw)
  To: Trond Myklebust; +Cc: Linux NFS Mailing list

Trond Myklebust wrote:
> On Wed, 2009-04-15 at 13:30 -0700, Kevin Constantine wrote:
>> Has there been any effort to expose caching statistics to the end user? 
>>   On the client-side, it would be useful to see how much data is being 
>> re-used from cache vs data that gets retrieved over the wire.  Similarly 
>> on the server side, it would be nice to see how much data is being 
>> served from cache vs having to pull the data from disk.
>>
>> Just wondering if anyone started anything to expose this sort of 
>> information.
> 
> See the nfs-iostat tool in the nfs-utils package:
> 
>    http://git.linux-nfs.org/?p=steved/nfs-utils.git;a=tree;f=tools/nfs-iostat;h=929e303cc762a68dfd01546f5150eb294274164e;hb=refs/heads/master
> 
> Note that you need a 2.6.17 kernel or newer.
> 
> Cheers
>   Trond

Thanks Trond-

It seems like nfs-iostat is displaying the number of pages that are 
being written to the read/write caches (i'm only looking at the 
client-side at the moment), and what I'm interested in is the ratio of 
pages being read from cache vs data being fetched from the server.

Is there any documentation on the layout of /proc/self/mountstats?

-kevin

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: Exposing cache statistics
       [not found]         ` <49E7CE3E.8020006-P5ys19MLBK/QT0dZR+AlfA@public.gmane.org>
@ 2009-04-17 11:05           ` Steve Dickson
       [not found]             ` <49E8626F.6000508-AfCzQyP5zfLQT0dZR+AlfA@public.gmane.org>
  0 siblings, 1 reply; 6+ messages in thread
From: Steve Dickson @ 2009-04-17 11:05 UTC (permalink / raw)
  To: Kevin Constantine; +Cc: Trond Myklebust, Linux NFS Mailing list



Kevin Constantine wrote:
> Trond Myklebust wrote:
>> On Wed, 2009-04-15 at 13:30 -0700, Kevin Constantine wrote:
>>> Has there been any effort to expose caching statistics to the end
>>> user?   On the client-side, it would be useful to see how much data
>>> is being re-used from cache vs data that gets retrieved over the
>>> wire.  Similarly on the server side, it would be nice to see how much
>>> data is being served from cache vs having to pull the data from disk.
>>>
>>> Just wondering if anyone started anything to expose this sort of
>>> information.
>>
>> See the nfs-iostat tool in the nfs-utils package:
>>
>>   
>> http://git.linux-nfs.org/?p=steved/nfs-utils.git;a=tree;f=tools/nfs-iostat;h=929e303cc762a68dfd01546f5150eb294274164e;hb=refs/heads/master
>>
>>
>> Note that you need a 2.6.17 kernel or newer.
>>
>> Cheers
>>   Trond
> 
> Thanks Trond-
> 
> It seems like nfs-iostat is displaying the number of pages that are
> being written to the read/write caches (i'm only looking at the
> client-side at the moment), and what I'm interested in is the ratio of
> pages being read from cache vs data being fetched from the server.
> 
> Is there any documentation on the layout of /proc/self/mountstats?
No, unfortunately not... 

steved.

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: Exposing cache statistics
       [not found]             ` <49E8626F.6000508-AfCzQyP5zfLQT0dZR+AlfA@public.gmane.org>
@ 2009-04-17 12:54               ` Trond Myklebust
  0 siblings, 0 replies; 6+ messages in thread
From: Trond Myklebust @ 2009-04-17 12:54 UTC (permalink / raw)
  To: Steve Dickson; +Cc: Kevin Constantine, Linux NFS Mailing list

On Fri, 2009-04-17 at 07:05 -0400, Steve Dickson wrote:
> 
> Kevin Constantine wrote:
> > Trond Myklebust wrote:
> >> On Wed, 2009-04-15 at 13:30 -0700, Kevin Constantine wrote:
> >>> Has there been any effort to expose caching statistics to the end
> >>> user?   On the client-side, it would be useful to see how much data
> >>> is being re-used from cache vs data that gets retrieved over the
> >>> wire.  Similarly on the server side, it would be nice to see how much
> >>> data is being served from cache vs having to pull the data from disk.
> >>>
> >>> Just wondering if anyone started anything to expose this sort of
> >>> information.
> >>
> >> See the nfs-iostat tool in the nfs-utils package:
> >>
> >>   
> >> http://git.linux-nfs.org/?p=steved/nfs-utils.git;a=tree;f=tools/nfs-iostat;h=929e303cc762a68dfd01546f5150eb294274164e;hb=refs/heads/master
> >>
> >>
> >> Note that you need a 2.6.17 kernel or newer.
> >>
> >> Cheers
> >>   Trond
> > 
> > Thanks Trond-
> > 
> > It seems like nfs-iostat is displaying the number of pages that are
> > being written to the read/write caches (i'm only looking at the
> > client-side at the moment), and what I'm interested in is the ratio of
> > pages being read from cache vs data being fetched from the server.
> > 
> > Is there any documentation on the layout of /proc/self/mountstats?
> No, unfortunately not... 

I'd suggest using the python code in nfs-iostat as a reference.

You should be able to figure out how much data is being read on the wire
by looking at nfs_stats['serverreadbytes']. Comparing that to the value
in nfs_stats['normalreadbytes'] (which tells you the total number of
bytes requested in read() calls) should give you a rough estimate for
how much data is being read from cache.

Cheers
  Trond


^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: Exposing cache statistics
  2009-04-17  0:33       ` Kevin Constantine
       [not found]         ` <49E7CE3E.8020006-P5ys19MLBK/QT0dZR+AlfA@public.gmane.org>
@ 2009-04-17 15:58         ` Chuck Lever
  1 sibling, 0 replies; 6+ messages in thread
From: Chuck Lever @ 2009-04-17 15:58 UTC (permalink / raw)
  To: Kevin Constantine; +Cc: Trond Myklebust, Linux NFS Mailing list


On Apr 16, 2009, at 8:33 PM, Kevin Constantine wrote:

> Trond Myklebust wrote:
>> On Wed, 2009-04-15 at 13:30 -0700, Kevin Constantine wrote:
>>> Has there been any effort to expose caching statistics to the end  
>>> user?   On the client-side, it would be useful to see how much  
>>> data is being re-used from cache vs data that gets retrieved over  
>>> the wire.  Similarly on the server side, it would be nice to see  
>>> how much data is being served from cache vs having to pull the  
>>> data from disk.
>>>
>>> Just wondering if anyone started anything to expose this sort of  
>>> information.
>> See the nfs-iostat tool in the nfs-utils package:
>>   http://git.linux-nfs.org/?p=steved/nfs-utils.git;a=tree;f=tools/nfs-iostat;h=929e303cc762a68dfd01546f5150eb294274164e;hb=refs/heads/master
>> Note that you need a 2.6.17 kernel or newer.
>> Cheers
>>  Trond
>
> Thanks Trond-
>
> It seems like nfs-iostat is displaying the number of pages that are  
> being written to the read/write caches (i'm only looking at the  
> client-side at the moment), and what I'm interested in is the ratio  
> of pages being read from cache vs data being fetched from the server.
>
> Is there any documentation on the layout of /proc/self/mountstats?


Take a look at the python code in nfs-iostat or mountstats.  Besides  
documenting the layout of /proc/self/mountstats, there may also be  
some code in there that shows how to compute cache hit ratios.

The __print_data_cache_stats function in nfs-iostat does just this for  
the page cache, but I don't see it called anywhere.

Note these scripts are not finished, which is why they are currently  
not installed by default.

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

^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2009-04-17 15:58 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-04-15 20:30 Exposing cache statistics Kevin Constantine
     [not found] ` <49E643CD.9070809-P5ys19MLBK/QT0dZR+AlfA@public.gmane.org>
2009-04-15 20:41   ` Trond Myklebust
     [not found]     ` <1239828092.5177.139.camel-rJ7iovZKK19ZJLDQqaL3InhyD016LWXt@public.gmane.org>
2009-04-17  0:33       ` Kevin Constantine
     [not found]         ` <49E7CE3E.8020006-P5ys19MLBK/QT0dZR+AlfA@public.gmane.org>
2009-04-17 11:05           ` Steve Dickson
     [not found]             ` <49E8626F.6000508-AfCzQyP5zfLQT0dZR+AlfA@public.gmane.org>
2009-04-17 12:54               ` Trond Myklebust
2009-04-17 15:58         ` Chuck Lever

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.