[Lustre-discuss] Lustre::LFS + Lustre::Info (inc. lustre-info.pl) available on the CPAN

Adrian Ulrich adrian at blinkenlights.ch
Wed Jul 28 06:38:25 PDT 2010


First: Sorry for the shameless self advertising, but...

I uploaded two lustre-related modules to the CPAN:

#1: Lustre::Info provides easy access to information located
    at /proc/fs/lustre, it also comes with a 'performance monitoring'
    script called 'lustre-info.pl'

#2 Lustre::LFS offers IO::Dir and IO::File-like filehandles but
   with additional lustre-specific features ($dir_fh->set_stripe...)


Examples and details:

Lustre::Info and lustre-info.pl
---------------------------------------

Lustre::Info provides a Perl-OO interface to lustres procfs information.

(confusing) example code to get the blockdevice of all OSTs:
 
 #########################################################
 my $l = Lustre::Info->new;
 print join("\n", map( { $l->get_ost($_)->get_name.": ".$l->get_ost($_)->get_blockdevice } \
                        @{$l->get_ost_list}), '' ) if $l->is_ost;
 #########################################################

..output:
 $ perl test.pl
 lustre1-OST001e: /dev/md17
 lustre1-OST0016: /dev/md15
 lustre1-OST000e: /dev/md13
 lustre1-OST0006: /dev/md11

The module also includes a script called 'lustre-info.pl' that can
be used to gather some live performance statistics:

Use `--ost-stats' to get a quick overview on what's going on:
$ lustre-info.pl --ost-stats
 lustre1-OST0006 (@ /dev/md11) :  write=   5.594 MB/s, read=   0.000 MB/s, create=  0.0 R/s, destroy=  0.0 R/s, setattr=  0.0 R/s, preprw=  6.0 R/s
 lustre1-OST000e (@ /dev/md13) :  write=   3.997 MB/s, read=   0.000 MB/s, create=  0.0 R/s, destroy=  0.0 R/s, setattr=  0.0 R/s, preprw=  4.0 R/s
 lustre1-OST0016 (@ /dev/md15) :  write=   5.502 MB/s, read=   0.000 MB/s, create=  0.0 R/s, destroy=  0.0 R/s, setattr=  0.0 R/s, preprw=  6.0 R/s
 lustre1-OST001e (@ /dev/md17) :  write=   5.905 MB/s, read=   0.000 MB/s, create=  0.0 R/s, destroy=  0.0 R/s, setattr=  0.0 R/s, preprw=  6.7 R/s


You can also get client<->ost details via `--monitor=MODE'

$ lustre-info.pl --monitor=ost --as-list  # this will only show clients where read+write >= 1MB/s
> client nid       | lustre1-OST0006    | lustre1-OST000e    | lustre1-OST0016    | lustre1-OST001e    | +++ TOTALS +++ (MB/s)
10.201.46.25 at o2ib  | r=   0.0, w=   0.0 | r=   0.0, w=   0.0 | r=   0.0, w=   0.0 | r=   0.0, w=   1.1 | read=   0.0, write=   1.1
10.201.47.27 at o2ib  | r=   0.0, w=   0.0 | r=   0.0, w=   1.2 | r=   0.0, w=   2.0 | r=   0.0, w=   0.0 | read=   0.0, write=   3.2


There are many more options, checkout `lustre-info.pl --help' for details!


Lustre::LFS::Dir and Lustre::LFS::File
---------------------------------------

This two packages behave like IO::File and IO::Dir but both of
them add some lustre-only features to the returned filehandle.

Quick example:
 my $fh = Lustre::LFS::File; # $fh is a normal IO::File-like FH
 $fh->open("> test") or die;
 print $fh "Foo Bar!\n";
 my $stripe_info = $fh->get_stripe or die "Not on a lustre filesystem?!\n";



Keep in mind that both Lustre modules are far from being complete:
Lustre::Info really needs some MDT support and Lustre::LFS is just a
wrapper for /usr/bin/lfs: An XS-Version would be much better.

But i'd love to hear some feedback if someone decides to play around
with this modules + lustre-info.pl :-)


Cheers,
 Adrian





More information about the lustre-discuss mailing list