IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Changeset 19796


Ignore:
Timestamp:
Oct 1, 2008, 10:42:31 AM (18 years ago)
Author:
jhoblitt
Message:

dump Sys::Statistics::Linux::DiskUsage for Filesys::Df in nebdiskd as it's behind the scenes usage of df instead of statfs() was causing lags on hung NFS mounts

Location:
trunk/Nebulous-Server
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/Nebulous-Server/Build.PL

    r19791 r19796  
    1919        'File::Path'            => '1.08',
    2020        'File::Spec'            => 0,
     21        'Filesys::Df'           => '0.92',
    2122        'File::Spec::Functions' => 0,
    2223        'File::Temp'            => 0,
     
    2526        'Params::Validate'      => '0.73',
    2627        'SOAP::Lite'            => '0.69',
    27         'Sys::Statistics::Linux::DiskUsage' => '0.02',
    2828        'URI'                   => '1.30',
    2929    },
  • trunk/Nebulous-Server/Changes

    r19792 r19796  
    1010    - fix getmountedvol() stored proc to not add volumes to the mountedvol
    1111      table that are not available
     12    - dump Sys::Statistics::Linux::DiskUsage for Filesys::Df in nebdiskd as
     13      it's behind the scenes usage of `df` instead of statfs() was causing lags
     14      on hung NFS mounts
    1215
    13160.15 Thu Sep 11 13:00:59 HST 2008
  • trunk/Nebulous-Server/bin/nebdiskd

    r19791 r19796  
    33# Copyright (C) 2007  Joshua Hoblitt
    44#
    5 # $Id: nebdiskd,v 1.7 2008-10-01 00:30:53 jhoblitt Exp $
     5# $Id: nebdiskd,v 1.8 2008-10-01 20:42:31 jhoblitt Exp $
    66
    77use strict;
     
    1515use File::Mountpoint qw( is_mountpoint );
    1616use File::Spec;
     17use Filesys::Df;
    1718use Nebulous::Server::SQL;
    1819use Net::Server::Daemonize qw( daemonize unlink_pid_file );
    19 use Sys::Statistics::Linux::DiskUsage;
    2020
    2121use Getopt::Long qw( GetOptions :config auto_help auto_version );
     
    9595    my $poll_interval   = $p{poll_interval} || 60;
    9696    my $debug           = $p{debug} || 0;
    97 
    98     my $lxs = Sys::Statistics::Linux::DiskUsage->new;
    9997
    10098    while (1) {
     
    137135            # this has to be done AFTER we determine what the valid mountpoints
    138136            # are incase is_mountpoint() invokes the automounter
    139             my $stats = $lxs->get;
    140             $stats = fix_disk_stats($stats);
    141 
    142137            foreach my $mnt (@valid_mounts) {
    143                 my $dev_info = $stats->{$mnt};
     138                my $dev_info = df($mnt, 1024);
    144139                unless (defined $dev_info) {
    145                     print "can't find device info for $mnt\n"
    146                         if $debug;
     140                    print "can't find device info for $mnt\n" if $debug;
    147141                    next;
    148142                }
    149                 $query->execute(@$dev_info{qw( mountpoint total usage )});
    150                 print "adding $dev_info->{mountpoint} to db\n" if $debug;
     143                $query->execute($mnt, @$dev_info{qw( blocks used )});
     144                print "adding $mnt to db\n" if $debug;
    151145            }
    152146
Note: See TracChangeset for help on using the changeset viewer.