Use ddsperf in perf scripts and update README
* the scripted throughput test originally used for the throughput graph in the README now uses ddsperf; * a scripted latency test has been added; * updated the README with the results of these tests (and so now gives easy access not only to throughput, but also to latency and memory usage, as well as to latency over GbE. Signed-off-by: Erik Boasson <eb@ilities.com>
This commit is contained in:
parent
952029dba0
commit
af19c5681c
7 changed files with 554 additions and 189 deletions
|
@ -1,59 +1,76 @@
|
|||
#!/usr/bin/perl -w
|
||||
|
||||
# Note: this is specialized for async delivery, listener mode because of the way it deals with
|
||||
# thread names
|
||||
|
||||
use strict;
|
||||
|
||||
my @dirs = ("async0-mode-1", "async0-mode0", "async0-mode1",
|
||||
"async1-mode-1", "async1-mode0", "async1-mode1");
|
||||
|
||||
my $dataset = 0;
|
||||
my $basedir = "throughput-result";
|
||||
$basedir = $ARGV[0] if @ARGV== 1;
|
||||
my $load_threshold = 20;
|
||||
for my $dir (@dirs) {
|
||||
my @loads = ();
|
||||
|
||||
{
|
||||
open LH, "< $basedir/data-$dir/sub-ethload.log" or next; # die "can't open $basedir/data-$dir/sub-ethload.log";
|
||||
my @curload = ();
|
||||
while (<LH>) {
|
||||
next unless /^r +([0-9.]+).*\( *(\d+)/;
|
||||
push @curload, $2 if $1 > $load_threshold;
|
||||
if (@curload && $1 < $load_threshold) {
|
||||
push @loads, median (@curload);
|
||||
@curload = ();
|
||||
}
|
||||
}
|
||||
push @loads, median (@curload) if @curload;
|
||||
close LH;
|
||||
my %res = ();
|
||||
my %meas;
|
||||
while (<>) {
|
||||
next unless s/^\[\d+\] \d+\.\d+\s+//;
|
||||
if (/^size (\d+) .* rate (\d+\.\d+)\s*kS\/s\s+(\d+\.\d+)\s*Mb\/s/) {
|
||||
# size is always the first line of an output block
|
||||
# ddsperf doesn't print CPU loads, RSS, bandwidth if it is zero
|
||||
my %tmp = %meas;
|
||||
push @{$res{$meas{size}}}, \%tmp if %meas;
|
||||
%meas = (size => $1, rate => $2, cookedbw => $3,
|
||||
rawxmitbw => 0, rawrecvbw => 0,
|
||||
subrss => 0, pubrss => 0,
|
||||
subcpu => 0, subrecv => 0,
|
||||
pubcpu => 0, pubrecv => 0);
|
||||
} elsif (s/^(\@[^:]+:\d+\s+)?rss:(\d+\.\d+)([kM])B//) {
|
||||
my $side = defined $1 ? "pub" : "sub";
|
||||
$meas{"${side}rss"} = $2 / ($3 eq "k" ? 1024.0 : 1);
|
||||
$meas{"${side}cpu"} = cpuload (($side eq "pub") ? "pub" : "dq.user", $_);
|
||||
$meas{"${side}recv"} = cpuload ("recvUC", $_);
|
||||
} elsif (/xmit\s+(\d+)%\s+recv\s+(\d+)%/) {
|
||||
$meas{rawxmitbw} = $1;
|
||||
$meas{rawrecvbw} = $2;
|
||||
}
|
||||
}
|
||||
push @{$res{$meas{size}}}, \%meas if %meas;
|
||||
die "no data found" unless keys %res > 0;
|
||||
|
||||
open FH, "< $basedir/data-$dir/sub.log" or next; # die "can't open $basedir/data-$dir/sub.log";
|
||||
print "\n\n" if $dataset++;
|
||||
print "# mode $dir\n";
|
||||
print "# payloadsize rate[samples/s] appl.bandwidth[Mb/s] raw.bandwidth[Mb/s]\n";
|
||||
my $psz;
|
||||
my @rate = ();
|
||||
while (<FH>) {
|
||||
next unless /Payload size: ([0-9]+).*Transfer rate: ([0-9.]+)/;
|
||||
my $psz_cur = $1; my $rate_cur = $2;
|
||||
$psz = $psz_cur unless defined $psz;
|
||||
if ($psz != $psz_cur) {
|
||||
my $load = shift @loads;
|
||||
my $rate = median (@rate);
|
||||
printf "%d %f %f %f\n", $psz, $rate, $rate * (8 + $psz) / 125e3, $load / 125e3;
|
||||
@rate = ();
|
||||
}
|
||||
$psz = $psz_cur;
|
||||
push @rate, ($rate_cur + 0.0);
|
||||
print "#size rate cookedbw rawxmitbw rawrecvbw pubrss subrss pubcpu pubrecv subcpu subrecv\n";
|
||||
my @sizes = sort { $a <=> $b } keys %res;
|
||||
for my $sz (@sizes) {
|
||||
my $ms = $res{$sz};
|
||||
my $rate = median ("rate", $ms);
|
||||
my $cookedbw = median ("cookedbw", $ms);
|
||||
my $rawxmitbw = median ("rawxmitbw", $ms);
|
||||
my $rawrecvbw = median ("rawrecvbw", $ms);
|
||||
my $pubrss = max ("pubrss", $ms);
|
||||
my $subrss = max ("subrss", $ms);
|
||||
my $pubcpu = median ("pubcpu", $ms);
|
||||
my $pubrecv = median ("pubrecv", $ms);
|
||||
my $subcpu = median ("subcpu", $ms);
|
||||
my $subrecv = median ("subrecv", $ms);
|
||||
print "$sz $rate $cookedbw $rawxmitbw $rawrecvbw $pubrss $subrss $pubcpu $pubrecv $subcpu $subrecv\n";
|
||||
}
|
||||
|
||||
sub cpuload {
|
||||
my ($thread, $line) = @_;
|
||||
$thread =~ s/\./\\./g;
|
||||
if ($line =~ /$thread:(\d+)%\+(\d+)%/) {
|
||||
return $1+$2;
|
||||
} else {
|
||||
return 0;
|
||||
}
|
||||
my $load = shift @loads;
|
||||
my $rate = median (@rate);
|
||||
printf "%d %f %f %f\n", $psz, $rate, $rate * (8 + $psz) / 125e3, $load / 125e3;
|
||||
close FH;
|
||||
}
|
||||
|
||||
sub max {
|
||||
my $v;
|
||||
for (extract (@_)) { $v = $_ unless defined $v; $v = $_ if $_ > $v; }
|
||||
return $v;
|
||||
}
|
||||
|
||||
sub median {
|
||||
my @xs = sort { $a <=> $b } @_;
|
||||
my @xs = sort { $a <=> $b } (extract (@_));
|
||||
return (@xs % 2) ? $xs[(@xs - 1) / 2] : ($xs[@xs/2 - 1] + $xs[@xs/2]) / 2;
|
||||
}
|
||||
|
||||
sub extract {
|
||||
my ($key, $msref) = @_;
|
||||
return map { $_->{$key} } @$msref;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue