Monitoring 95-percentile

Burstable Bandwidth/95th Percentile Billing

AboveNet bandwidth monitoring system measures each customer’s connectivity every 5 minutes. AboveNet bills clients for bandwidth usage with a Kbps granularity. Clients are billed on the 95th percentile in time of the higher of in/out traffic at the committed bandwidth price. The 95th percentile model removes 5% of the highest burst traffic from your bill, effectively removing 36 hours of your highest bandwidth usage per month.

The actual usage – 95th percentile

AboveNet uses the industry standard tool, the Multi-Router Traffic Grapher (MRTG) to provide customers with real-time usage statistics and to calculate customers’ invoices on a (calendar) monthly basis. Using MRTG AboveNet publishes inbound and outbound traffic every five minutes. Invoicing is based on the 95th percentile rule: in a 30-day month there are then 8640 samples for each of inbound and outbound. AboveNet discards either the inbound or outbound samples depending on which one is lower. With the remaining sample set AboveNet then removes the highest 432 samples - 5% of 8640 - and then invoices at the next highest sample which is your 95th percentile.

Example RRD-Perl code for 95th percentile

#! /bin/sh
MONTH=$1
[ "x$MONTH" = 'x' ] && MONTH=`date +%-m`
YEAR=`date +%-Y`
if [[ $MONTH -gt `date +%-m` ]]; then
YEAR=`echo "$YEAR - 1" | bc`;
fi
LASTDAY=`cal $MONTH $YEAR | grep -v "^$" | tail -1 | awk '{print $NF}'`
#MONTHNAME=`cal $MONTH $YEAR | head -n 1 | awk '{print $1}'`
#echo $MONTH
# OK, we need to fetch the start dates from MONTH...
rrdtool fetch interface.rrd AVERAGE \\
 --start "00:00 $MONTH/01/$YEAR" \\
 --end "23:55 $MONTH/$LASTDAY/$YEAR" | \\
 grep -v nan | \\
 perl -e ' \\
  my $last = 0; my $month = '$MONTH';  \\
  my @days = (0,31,28,31,30,31,30,31,31,30,31,30,31);  \\
  while (<>) {  \\
   next unless /^(\d{10}):\s+([\d\.\+e]+)\s+([\d\.\+e]+)\s+ \\
   ([\d\.\+e]+)\s+([\d\.\+e]+)\s+([\d\.\+e]+)\s+([\d\.\+e]+)/; \\
   if ($last != 0 and $1 != $last + 300) {  \\
    print STDERR "Bad jump: $last -> $1\n" }; \\
   push (@sample, (($2>$3?$2:$3) * 8 / 1000 / 1000));$last = $1;}; \\
   @sorted = sort {$b <=> $a} @sample; print "95th so far: ", \\
   @sorted[int(@sorted/20)-1], "\n", "95th of month so far: ", \\
   @sorted[$days[$month]*24*12/20],"\n";'

Other

Recent changes RSS feed Creative Commons License Donate Driven by DokuWiki