On Apr 18, 2007, at 9:33 PM, Robert Milkowski wrote:> Hello Robert, > > Thursday, April 19, 2007, 1:57:38 AM, you wrote: > > RM> Hello nfs-discuss, > > RM> Does anyone have a dtrace script (or any other means) to > track which > RM> files are open/read/write (ops and bytes) by nfsd? To make > things > RM> little bit harder lets assume that local storage in on zfs, nfsd > RM> server using nfsv3 and system is S10U3. > > RM> The script would distinguish between cache read and disk read. > > RM> So something like: > > RM> ./nfsd_file.d > > RM> CLIENT_IP OPERATION BYTES TYPE FILE > RM> X.X.X.X READ3 32768 logical /nfs/d1000/fileA > > RM> ... > > > > RM> and something like: > > RM> ./nfsd_file_summ.d 100s > > RM> CLIENT_IP OPERATION OPS BYTES TYPE FILE > RM> X.X.X.X READ3 230 5MB logical /nfs/d1000/ > fileA > RM> X.X.X.X READ3 15 1MB physical /nfs/d1000/ > fileA > > RM> ... > > RM> > RM> > RM> > > > Looks like vopstat and rfileio from DTrace toolkit is what I''m looking > for (with some modifications) >very cool, would you mind posting your dscript when you get it working? eric
Hello eric, Friday, April 20, 2007, 4:01:46 PM, you wrote: ek> On Apr 18, 2007, at 9:33 PM, Robert Milkowski wrote:>> Hello Robert, >> >> Thursday, April 19, 2007, 1:57:38 AM, you wrote: >> >> RM> Hello nfs-discuss, >> >> RM> Does anyone have a dtrace script (or any other means) to >> track which >> RM> files are open/read/write (ops and bytes) by nfsd? To make >> things >> RM> little bit harder lets assume that local storage in on zfs, nfsd >> RM> server using nfsv3 and system is S10U3. >> >> RM> The script would distinguish between cache read and disk read. >> >> RM> So something like: >> >> RM> ./nfsd_file.d >> >> RM> CLIENT_IP OPERATION BYTES TYPE FILE >> RM> X.X.X.X READ3 32768 logical /nfs/d1000/fileA >> >> RM> ... >> >> >> >> RM> and something like: >> >> RM> ./nfsd_file_summ.d 100s >> >> RM> CLIENT_IP OPERATION OPS BYTES TYPE FILE >> RM> X.X.X.X READ3 230 5MB logical /nfs/d1000/ >> fileA >> RM> X.X.X.X READ3 15 1MB physical /nfs/d1000/ >> fileA >> >> RM> ... >> >> RM> >> RM> >> RM> >> >> >> Looks like vopstat and rfileio from DTrace toolkit is what I''m looking >> for (with some modifications) >>ek> very cool, would you mind posting your dscript when you get it working? ek> eric Those scripts are from DTraceToolkit! I''ve just make some simple modifications like parameterized frequency, total summary, ... As I see Brendan hooks into proper VOP operations. The question however is why if I want to use dtrace io provider with zfs + nfsd I don''t get file names from args[2].fi_pathname? Perhaps fsinfo::: could help but it''s not on current s10 - I hope it will be in U4 as it looks that it works with zfs (without manually looking into vnodes, etc.): bash-3.00# dtrace -n fsinfo::fop_read:read''{trace(args[0]->fi_pathname);trace(arg1);}''|grep -v unknown dtrace: description ''fsinfo::fop_read:read'' matched 1 probe CPU ID FUNCTION:NAME 0 65495 fop_read:read /usr/bin/cat 8 0 65495 fop_read:read /usr/bin/cat 52 0 65495 fop_read:read /usr/bin/cat 224 0 65495 fop_read:read /usr/bin/cat 17 0 65495 fop_read:read /lib/ld.so.1 52 0 65495 fop_read:read /lib/ld.so.1 160 0 65495 fop_read:read /home/milek/hs_err_pid23665.log 8192 0 65495 fop_read:read /home/milek/hs_err_pid23665.log 3777 0 65495 fop_read:read /home/milek/hs_err_pid23665.log 0 ^Cbash-3.00# /home is on zfs. Looks like fsinfo::: should work properly with nfsd + zfs! -- Best regards, Robert mailto:rmilkowski at task.gda.pl http://milek.blogspot.com
Hello Robert, Friday, April 20, 2007, 4:54:33 PM, you wrote: RM> Perhaps fsinfo::: could help but it''s not on current s10 - I hope it RM> will be in U4 as it looks that it works with zfs (without manually RM> looking into vnodes, etc.): Well, it''s already in s10! (122641) I missed that... :) -- Best regards, Robert mailto:rmilkowski at task.gda.pl http://milek.blogspot.com
On Apr 20, 2007, at 7:54 AM, Robert Milkowski wrote:> Hello eric, > > Friday, April 20, 2007, 4:01:46 PM, you wrote: > > ek> On Apr 18, 2007, at 9:33 PM, Robert Milkowski wrote: > >>> Hello Robert, >>> >>> Thursday, April 19, 2007, 1:57:38 AM, you wrote: >>> >>> RM> Hello nfs-discuss, >>> >>> RM> Does anyone have a dtrace script (or any other means) to >>> track which >>> RM> files are open/read/write (ops and bytes) by nfsd? To make >>> things >>> RM> little bit harder lets assume that local storage in on zfs, >>> nfsd >>> RM> server using nfsv3 and system is S10U3. >>> >>> RM> The script would distinguish between cache read and disk read. >>> >>> RM> So something like: >>> >>> RM> ./nfsd_file.d >>> >>> RM> CLIENT_IP OPERATION BYTES TYPE FILE >>> RM> X.X.X.X READ3 32768 logical /nfs/d1000/fileA >>> >>> RM> ... >>> >>> >>> >>> RM> and something like: >>> >>> RM> ./nfsd_file_summ.d 100s >>> >>> RM> CLIENT_IP OPERATION OPS BYTES TYPE FILE >>> RM> X.X.X.X READ3 230 5MB logical /nfs/d1000/ >>> fileA >>> RM> X.X.X.X READ3 15 1MB physical /nfs/d1000/ >>> fileA >>> >>> RM> ... >>> >>> RM> >>> RM> >>> RM> >>> >>> >>> Looks like vopstat and rfileio from DTrace toolkit is what I''m >>> looking >>> for (with some modifications) >>> > > ek> very cool, would you mind posting your dscript when you get it > working? > > ek> eric > > Those scripts are from DTraceToolkit! > I''ve just make some simple modifications like parameterized frequency, > total summary, ...Ah yes, its the little modifications i was particularly interested in. :) Have you tried mixing the fsinfo probes with the dscript i wrote awhile back to retrieve the IPv4/IPv6 address (http://blogs.sun.com/ erickustarz/entry/dscript_to_retrieve_active_nfs)? eric> > As I see Brendan hooks into proper VOP operations. > > The question however is why if I want to use dtrace io provider with > zfs + nfsd I don''t get file names from args[2].fi_pathname? > > Perhaps fsinfo::: could help but it''s not on current s10 - I hope it > will be in U4 as it looks that it works with zfs (without manually > looking into vnodes, etc.): > > bash-3.00# dtrace -n fsinfo::fop_read:read''{trace(args[0]- > >fi_pathname);trace(arg1);}''|grep -v unknown > dtrace: description ''fsinfo::fop_read:read'' matched 1 probe > CPU ID FUNCTION:NAME > 0 65495 fop_read:read /usr/bin/ > cat 8 > 0 65495 fop_read:read /usr/bin/ > cat 52 > 0 65495 fop_read:read /usr/bin/ > cat 224 > 0 65495 fop_read:read /usr/bin/ > cat 17 > 0 65495 fop_read:read /lib/ld.so. > 1 52 > 0 65495 fop_read:read /lib/ld.so. > 1 160 > 0 65495 fop_read:read /home/milek/ > hs_err_pid23665.log 8192 > 0 65495 fop_read:read /home/milek/ > hs_err_pid23665.log 3777 > 0 65495 fop_read:read /home/milek/ > hs_err_pid23665.log 0 > ^Cbash-3.00# > > > /home is on zfs. > > Looks like fsinfo::: should work properly with nfsd + zfs! > > > -- > Best regards, > Robert mailto:rmilkowski at task.gda.pl > http://milek.blogspot.com >
Hello eric, Tuesday, April 24, 2007, 1:29:32 AM, you wrote: ek> On Apr 20, 2007, at 7:54 AM, Robert Milkowski wrote:>> Hello eric, >> >> Friday, April 20, 2007, 4:01:46 PM, you wrote: >> >> ek> On Apr 18, 2007, at 9:33 PM, Robert Milkowski wrote: >> >>>> Hello Robert, >>>> >>>> Thursday, April 19, 2007, 1:57:38 AM, you wrote: >>>> >>>> RM> Hello nfs-discuss, >>>> >>>> RM> Does anyone have a dtrace script (or any other means) to >>>> track which >>>> RM> files are open/read/write (ops and bytes) by nfsd? To make >>>> things >>>> RM> little bit harder lets assume that local storage in on zfs, >>>> nfsd >>>> RM> server using nfsv3 and system is S10U3. >>>> >>>> RM> The script would distinguish between cache read and disk read. >>>> >>>> RM> So something like: >>>> >>>> RM> ./nfsd_file.d >>>> >>>> RM> CLIENT_IP OPERATION BYTES TYPE FILE >>>> RM> X.X.X.X READ3 32768 logical /nfs/d1000/fileA >>>> >>>> RM> ... >>>> >>>> >>>> >>>> RM> and something like: >>>> >>>> RM> ./nfsd_file_summ.d 100s >>>> >>>> RM> CLIENT_IP OPERATION OPS BYTES TYPE FILE >>>> RM> X.X.X.X READ3 230 5MB logical /nfs/d1000/ >>>> fileA >>>> RM> X.X.X.X READ3 15 1MB physical /nfs/d1000/ >>>> fileA >>>> >>>> RM> ... >>>> >>>> RM> >>>> RM> >>>> RM> >>>> >>>> >>>> Looks like vopstat and rfileio from DTrace toolkit is what I''m >>>> looking >>>> for (with some modifications) >>>> >> >> ek> very cool, would you mind posting your dscript when you get it >> working? >> >> ek> eric >> >> Those scripts are from DTraceToolkit! >> I''ve just make some simple modifications like parameterized frequency, >> total summary, ...ek> Ah yes, its the little modifications i was particularly interested ek> in. :) I''ll post it later - due to other problems I haven''t been on this for a moment... ek> Have you tried mixing the fsinfo probes with the dscript i wrote ek> awhile back to retrieve the IPv4/IPv6 address (http://blogs.sun.com/ ek> erickustarz/entry/dscript_to_retrieve_active_nfs)? I''ve been using your script and I was thinking about exactly the same thing. -- Best regards, Robert mailto:rmilkowski at task.gda.pl http://milek.blogspot.com