Skip to content

Commit

Permalink
changes for 2i
Browse files Browse the repository at this point in the history
  • Loading branch information
evanmcc committed Jun 6, 2014
1 parent 43b772f commit f875fb4
Show file tree
Hide file tree
Showing 10 changed files with 236 additions and 44 deletions.
26 changes: 0 additions & 26 deletions bcrunner-nocuttle.sh

This file was deleted.

29 changes: 23 additions & 6 deletions bcrunner.sh
Expand Up @@ -3,24 +3,41 @@
test_name=$1
bin_size=$2
version=$3
perf_test=$4
backend=$5
cuttle=$5

if [ -z $version -o -z $test_name -o -z $bin_size ]; then
echo "out"
exit 1
fi

./riak_test -c rtperf2 -t get_put -- --restart true --prepop true \
if [ -z $perf_test ]; then
perf_test="get_put"
fi

if [ -z $backend ]; then
backend="riak_kv_bitcask_backend"
fi

if [ ! -z $cuttle ]; then
cuttle="--cuttle false"
else
cuttle=""
fi

./riak_test -c rtperf2 -t $perf_test -b $backend -- --restart true --prepop true \
--run-time 120 --target-pct 120 --ram-size 48 \
--bin-size $bin_size --name $test_name --bin-type exponential \
--version $version
--version $version $cuttle

./riak_test -c rtperf2 -t get_put -- --restart true --prepop true \
./riak_test -c rtperf2 -t $perf_test -b $backend -- --restart true --prepop true \
--run-time 120 --target-pct 70 --ram-size 48 \
--bin-size $bin_size --name $test_name --bin-type exponential \
--version $version
--version $version $cuttle

./riak_test -c rtperf2 -t get_put -- --restart true --prepop true \
./riak_test -c rtperf2 -t $perf_test -b $backend -- --restart true --prepop true \
--run-time 120 --target-pct 20 --ram-size 48 \
--bin-size $bin_size --name $test_name --bin-type exponential \
--version $version
--version $version $cuttle

47 changes: 47 additions & 0 deletions perf/2iperf.erl
@@ -0,0 +1,47 @@
-module('2iperf').
-compile(export_all).
-include_lib("eunit/include/eunit.hrl").

-define(HARNESS, (rt_config:get(rt_harness))).

confirm() ->
lager:info("entering get_put:confirm()"),
HostList = rt_config:get(rt_hostnames),
Count = length(HostList),
BinSize = rt_config:get(perf_bin_size),

Config = rtperf:standard_config(Count),

ok = rtperf:build_cluster(Config),

SetSize = rtperf:target_size(rt_config:get(perf_target_pct),
BinSize,
rt_config:get(perf_ram_size),
Count),
LoadConfig = [],
%% rt_bench:config(
%% 50,
%% rt_config:get(perf_duration),
%% HostList,
%% {int_to_bin_bigendian, {truncated_pareto_int, SetSize}},
%% rt_bench:valgen(rt_config:get(perf_bin_type), BinSize),
%% %% 4:1 get/put
%% [{get, 3}, {update, 1}]
%% ),

TwoIConfig =
rt_bench:config(
max,
rt_config:get(perf_duration),
HostList,
{truncated_pareto_int, SetSize},
rt_bench:valgen(rt_config:get(perf_bin_type), BinSize),
[{{query_pb, 100}, 5}, {{query_pb, 1000}, 1},
{{put_pb, 2}, 1}, {get_pb, 5}],
<<"testbucket">>, '2i'
),

ok = rtperf:maybe_prepop(HostList, BinSize, SetSize),

ok = rtperf:run_test(HostList, TwoIConfig, LoadConfig),
pass.
15 changes: 15 additions & 0 deletions priv/reporting/report-2i.sh
@@ -0,0 +1,15 @@
#!/usr/bin/env bash
set -e

if [ ! -d "$1/" ]; then
echo "a directory must be specified"
exit 1
fi
if [ "x$2" == "xtrue" ]; then
(cd $1; rm -f *-digest; escript ~/bin/riak-digest.escript)
fi

D1=`basename "$1"`

#generate our comparison graph
gnuplot -e "dir1=\"$1\"; outfilename=\"${D1}-report.png\";" priv/reporting/summarize2i.gpl
5 changes: 5 additions & 0 deletions priv/reporting/riak-digest.escript
Expand Up @@ -131,6 +131,10 @@ avg_items(L, Names) ->
Dicts),
case Name of
%% vnode gets and puts are a per-minute rolling window
index_fsm_create ->
(lists:sum(Vals)/length(Vals)) / 60;
index_fsm_create_error ->
(lists:sum(Vals)/length(Vals)) / 60;
vnode_gets ->
(lists:sum(Vals)/length(Vals)) / 60;
vnode_puts ->
Expand All @@ -155,6 +159,7 @@ winnow(Data0) ->

strip_stats(Glob) ->
Filter = [
index_fsm_create, index_fsm_create_error,
node_gets, node_puts,
vnode_gets, vnode_puts,
node_get_fsm_time_median,
Expand Down
119 changes: 119 additions & 0 deletions priv/reporting/summarize2i.gpl
@@ -0,0 +1,119 @@
#clean up the environment for interactive use
unset multiplot
reset

set terminal png font "/usr/share/fonts/truetype/liberation/LiberationSans-Regular.ttf,9" size 850,1100
set output outfilename

#set term x11 size 850, 1100

set multiplot
set grid

#set key below
set tics out

set lmargin 12
set rmargin 10

rd = dir1."/".'rstats-digest'

## graph system stats
set size .5, .315

## graph latencies
set origin 0, .315

#set xtics 10

#set yrange [500:150000]
#set y2range [1000:1100000]
#set y2tics nomirror

set xlabel "5 second intervals"
set ylabel "usec"
unset y2label

plot rd using "node_put_fsm_time_95" with lines, \
rd using "node_put_fsm_time_99" with lines, \
rd using "node_get_fsm_time_95" with lines, \
rd using "node_get_fsm_time_99" with lines

unset y2tics
unset y2range

## graph ops performance
set origin 0, .63

#ymax = median(rd) + 1000

#set yrange [0:50000]
set ylabel "operations per node"
set y2label "errors"
set y2tics nomirror

plot rd using "index_fsm_create" with lines, \
rd using "vnode_gets" with lines axis x1y2, \
rd using "vnode_puts" with lines axis x1y2

## graph system stats
set origin .48, 0

set xlabel "5 second intervals"
set y2tics nomirror

plot rd using "memory_page_dirty" with lines, \
rd using "memory_page_writeback" with lines axis x1y2

unset y2tics
unset y2range

## graph latencies
set origin .48, .315
#set yrange [500:150000]
#set y2range [1000:1100000]
#set y2tics nomirror

#set xtics 10

set xlabel "5 second intervals"
set ylabel "usec"
unset y2label

plot rd using "node_get_fsm_time_median" with lines, \
rd using "node_put_fsm_time_median" with lines

unset y2tics
unset y2range

## graph ops performance
set origin .48, .63

#set yrange [0:50000]
set ylabel "operations per node"

#hack to set the title for the whole graph
set label dir1 at screen 0.5,0.97 center front

plot rd using "message_queue_max" with lines, \
rd using "dropped_vnode_requests_total" with lines

set origin 0, 0

#set xtics 60

set yrange [0:100]

set xlabel "5 second intervals"
set ylabel "percentage"

plot rd using "cpu_utilization" with lines, \
rd using "cpu_iowait" with lines, \
rd using "disk_utilization" with lines, \
rd using "memory_utilization" with lines

unset yrange
unset y2tics

unset multiplot
reset
1 change: 1 addition & 0 deletions report-2i.sh
6 changes: 4 additions & 2 deletions src/observer.erl
Expand Up @@ -35,7 +35,7 @@ watcher(Master, Nodes, {_Host, Port, _Dir} = Collector) ->
case gen_tcp:listen(Port, [{active, false}, binary,
{packet, 2}]) of
{ok, LSock} ->
Acceptor = spawn_link(?MODULE, lloop, [self(), LSock]),
Acceptor = spawn(?MODULE, lloop, [self(), LSock]),
monitor(process, Master),
Probes = [{Node, undefined} || Node <- Nodes],
W = #watcher{nodes=Nodes,
Expand Down Expand Up @@ -483,7 +483,9 @@ load_modules_on_nodes(Modules, Nodes) ->
[case code:get_object_code(Module) of
{Module, Bin, File} ->
%% rpc:multicall(Nodes, code, purge, [Module]),
rpc:multicall(Nodes, code, load_binary, [Module, File, Bin]);
{Ret, []} = rpc:multicall(Nodes, code,
load_binary, [Module, File, Bin]),
[{module, observer}] = lists:usort(Ret);
error ->
error({no_object_code, Module})
end || Module <- Modules].
Expand Down
15 changes: 10 additions & 5 deletions src/rt_bench.erl
Expand Up @@ -29,7 +29,7 @@ bench(Config, NodeList, TestName, Runners, Drop) ->
_ -> ok
end,

%% make a lxoocal config file, to be copied to a remote
%% make a local config file, to be copied to a remote
%% loadgen. They're named separately because for simplicity, we
%% use network operations even for local load generation

Expand Down Expand Up @@ -114,11 +114,16 @@ config(Rate, Duration, NodeList, KeyGen,
<<"testbucket">>, riakc_pb).

config(Rate, Duration, NodeList, KeyGen,
ValGen, Operations, Bucket, Driver) ->
DriverBucket = append_atoms(Driver, '_bucket'),
ValGen, Operations, Bucket, Driver0) ->
{Driver, DriverB} =
case Driver0 of
'2i' -> {pb, riakc_pb};
_ -> {Driver0, Driver0}
end,
DriverBucket = append_atoms(DriverB, '_bucket'),
DriverIps = append_atoms(Driver, '_ips'),
DriverReplies = append_atoms(Driver, '_replies'),
DriverName = append_atoms(basho_bench_driver_, Driver),
DriverReplies = append_atoms(DriverB, '_replies'),
DriverName = append_atoms(basho_bench_driver_, Driver0),
[
{mode, {rate, Rate}},
{duration, Duration},
Expand Down
17 changes: 12 additions & 5 deletions src/rtperf.erl
Expand Up @@ -81,7 +81,7 @@ run_test(HostList, TestBenchConfig, BaseBenchConfig) ->

TestName = test_name(),

Base = maybe_start_base_load(BaseBenchConfig),
Base = maybe_start_base_load(BaseBenchConfig, HostList, TestName),

rt_bench:bench(TestBenchConfig, HostList, TestName,
length(rt_config:get(perf_loadgens, [1]))),
Expand Down Expand Up @@ -322,16 +322,23 @@ start_data_collectors(Hosts) ->
PrepDir = "/tmp/perf-"++OSPid,
file:make_dir(PrepDir),
{ok, Hostname} = inet:gethostname(),
observer:watch(Nodes, {Hostname, 65001, PrepDir}).
P = observer:watch(Nodes, {Hostname, 65001, PrepDir}),
lager:info("started data collector: ~p", [P]),
P.

stop_data_collectors(Collector) ->
Collector ! stop,
ok.

maybe_start_base_load([]) ->
none.
maybe_start_base_load([], _, _) ->
none;
maybe_start_base_load(Config, HostList, TestName) ->
spawn(fun() ->
rt_bench:bench(Config, HostList, TestName++"_base",
length(rt_config:get(perf_loadgens, [1])))
end).

maybe_stop_base_load(none) ->
maybe_stop_base_load(_) -> %% should be none, but benches aren't stoppable rn.
ok.

%% need more sensible test names.
Expand Down

0 comments on commit f875fb4

Please sign in to comment.