Skip to content

Commit b295696

Browse files
Merge pull request ceph#57235 from connorfawcett/ec-bench-update
qa/workunits/erasure-code: add bench data tables and graph support for additional jerasure techniques
2 parents 35b6248 + 3ce3c8e commit b295696

File tree

5 files changed

+211
-20
lines changed

5 files changed

+211
-20
lines changed

qa/workunits/erasure-code/bench.html

Lines changed: 36 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99
<script language="javascript" type="text/javascript" src="jquery.flot.categories.js"></script>
1010
<script language="javascript" type="text/javascript" src="bench.js"></script>
1111
<script language="javascript" type="text/javascript" src="plot.js"></script>
12+
<script language="javascript" type="text/javascript" src="tables.js"></script>
1213
</head>
1314
<body>
1415

@@ -21,12 +22,45 @@ <h2>Erasure Code Plugins Benchmarks</h2>
2122
<div class="demo-container">
2223
<div id="encode" class="demo-placeholder"></div>
2324
</div>
24-
<p>encode: Y = GB/s, X = K/M</p>
25+
<h2>Encode:</h2>
26+
<p>Y = GB/s, X = K/M</p>
27+
<details>
28+
<summary>Bench Data</summary>
29+
<table id="encode-table">
30+
<tr>
31+
<th>Plugin</th>
32+
<th>Technique</th>
33+
<th>Time</th>
34+
<th>Total Size</th>
35+
<th>k</th>
36+
<th>m</th>
37+
<th>Iteration</th>
38+
<th>Packet Size</th>
39+
</tr>
40+
</table>
41+
</details>
2542

2643
<div class="demo-container">
2744
<div id="decode" class="demo-placeholder"></div>
2845
</div>
29-
<p>decode: Y = GB/s, X = K/M/erasures</p>
46+
<h2>Decode:</h2>
47+
<p>Y = GB/s, X = K/M/erasures</p>
48+
<details>
49+
<summary>Bench Data</summary>
50+
<table id="decode-table">
51+
<tr>
52+
<th>Plugin</th>
53+
<th>Technique</th>
54+
<th>Time</th>
55+
<th>Total Size</th>
56+
<th>k</th>
57+
<th>m</th>
58+
<th>Iteration</th>
59+
<th>Packet Size</th>
60+
<th>Erasures</th>
61+
</tr>
62+
</table>
63+
</details>
3064

3165
</div>
3266

qa/workunits/erasure-code/bench.sh

Lines changed: 64 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -50,11 +50,25 @@ export PATH=/sbin:$PATH
5050
: ${CEPH_ERASURE_CODE_BENCHMARK:=ceph_erasure_code_benchmark}
5151
: ${PLUGIN_DIRECTORY:=/usr/lib/ceph/erasure-code}
5252
: ${PLUGINS:=isa jerasure}
53-
: ${TECHNIQUES:=vandermonde cauchy}
53+
: ${TECHNIQUES:=vandermonde cauchy liberation reed_sol_r6_op blaum_roth liber8tion}
5454
: ${TOTAL_SIZE:=$((1024 * 1024))}
5555
: ${SIZE:=4096}
5656
: ${PARAMETERS:=--parameter jerasure-per-chunk-alignment=true}
5757

58+
declare -rA isa_techniques=(
59+
[vandermonde]="reed_sol_van"
60+
[cauchy]="cauchy"
61+
)
62+
63+
declare -rA jerasure_techniques=(
64+
[vandermonde]="reed_sol_van"
65+
[cauchy]="cauchy_good"
66+
[reed_sol_r6_op]="reed_sol_r6_op"
67+
[blaum_roth]="blaum_roth"
68+
[liberation]="liberation"
69+
[liber8tion]="liber8tion"
70+
)
71+
5872
function bench_header() {
5973
echo -e "seconds\tKB\tplugin\tk\tm\twork.\titer.\tsize\teras.\tcommand."
6074
}
@@ -100,6 +114,25 @@ function packetsize() {
100114
echo $p
101115
}
102116

117+
function get_technique_name()
118+
{
119+
local plugin=$1
120+
local technique=$2
121+
122+
declare -n techniques="${plugin}_techniques"
123+
echo ${techniques["$technique"]}
124+
}
125+
126+
function technique_is_raid6() {
127+
local technique=$1
128+
local r6_techniques="liberation reed_sol_r6_op blaum_roth liber8tion"
129+
130+
if [[ $r6_techniques =~ $technique ]]; then
131+
return 0
132+
fi
133+
return 1
134+
}
135+
103136
function bench_run() {
104137
local plugin=jerasure
105138
local w=8
@@ -111,31 +144,31 @@ function bench_run() {
111144
k2ms[4]="2 3"
112145
k2ms[6]="2 3 4"
113146
k2ms[10]="3 4"
114-
local isa2technique_vandermonde='reed_sol_van'
115-
local isa2technique_cauchy='cauchy'
116-
local jerasure2technique_vandermonde='reed_sol_van'
117-
local jerasure2technique_cauchy='cauchy_good'
147+
118148
for technique in ${TECHNIQUES} ; do
119149
for plugin in ${PLUGINS} ; do
120-
eval technique_parameter=\$${plugin}2technique_${technique}
150+
technique_parameter=$(get_technique_name $plugin $technique)
151+
if [[ -z $technique_parameter ]]; then continue; fi
121152
echo "serie encode_${technique}_${plugin}"
122153
for k in $ks ; do
123154
for m in ${k2ms[$k]} ; do
155+
if [ $m -ne 2 ] && technique_is_raid6 $technique; then continue; fi
124156
bench $plugin $k $m encode $(($TOTAL_SIZE / $SIZE)) $SIZE 0 \
125157
--parameter packetsize=$(packetsize $k $w $VECTOR_WORDSIZE $SIZE) \
126158
${PARAMETERS} \
127159
--parameter technique=$technique_parameter
128-
129160
done
130161
done
131162
done
132163
done
133164
for technique in ${TECHNIQUES} ; do
134165
for plugin in ${PLUGINS} ; do
135-
eval technique_parameter=\$${plugin}2technique_${technique}
166+
technique_parameter=$(get_technique_name $plugin $technique)
167+
if [[ -z $technique_parameter ]]; then continue; fi
136168
echo "serie decode_${technique}_${plugin}"
137169
for k in $ks ; do
138170
for m in ${k2ms[$k]} ; do
171+
if [ $m -ne 2 ] && technique_is_raid6 $technique; then continue; fi
139172
echo
140173
for erasures in $(seq 1 $m) ; do
141174
bench $plugin $k $m decode $(($TOTAL_SIZE / $SIZE)) $SIZE $erasures \
@@ -150,27 +183,42 @@ function bench_run() {
150183
}
151184

152185
function fplot() {
153-
local serie
154-
bench_run | while read seconds total plugin k m workload iteration size erasures rest ; do
186+
local serie=""
187+
local plot=""
188+
local encode_table="var encode_table = [\n"
189+
local decode_table="var decode_table = [\n"
190+
while read seconds total plugin k m workload iteration size erasures rest ; do
155191
if [ -z $seconds ] ; then
156-
echo null,
192+
plot="$plot null,\n"
157193
elif [ $seconds = serie ] ; then
158194
if [ "$serie" ] ; then
159-
echo '];'
195+
echo -e "$plot];\n"
160196
fi
161197
local serie=`echo $total | sed 's/cauchy_\([0-9]\)/cauchy_good_\1/g'`
162-
echo "var $serie = ["
198+
plot="var $serie = [\n"
163199
else
164200
local x
201+
local row
202+
local technique=`echo $rest | grep -Po "(?<=technique=)\w*"`
203+
local packetsize=`echo $rest | grep -Po "(?<=packetsize=)\w*"`
165204
if [ $workload = encode ] ; then
166205
x=$k/$m
206+
row="[ '$plugin', '$technique', $seconds, $total, $k, $m, $iteration, $packetsize ],"
207+
encode_table="$encode_table $row\n"
208+
167209
else
168210
x=$k/$m/$erasures
211+
row="[ '$plugin', '$technique', $seconds, $total, $k, $m, $iteration, $packetsize, $erasures ],"
212+
decode_table="$decode_table $row\n"
169213
fi
170-
echo "[ '$x', " $(echo "( $total / 1024 / 1024 ) / $seconds" | bc -ql) " ], "
214+
local out_time="$(echo "( $total / 1024 / 1024 ) / $seconds" | bc -ql)"
215+
plot="$plot [ '$x', $out_time ],\n"
171216
fi
172-
done
173-
echo '];'
217+
done < <(bench_run)
218+
219+
echo -e "$plot];\n"
220+
echo -e "$encode_table];\n"
221+
echo -e "$decode_table];\n"
174222
}
175223

176224
function main() {

qa/workunits/erasure-code/examples.css

Lines changed: 19 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -94,4 +94,22 @@ input[type=checkbox] {
9494

9595
.legend table {
9696
border-spacing: 5px;
97-
}
97+
}
98+
99+
#encode-table, #decode-table {
100+
margin: 0px 0px 15px 15px;
101+
font-size: 12px;
102+
border-collapse: collapse;
103+
width: 100%;
104+
}
105+
106+
#encode-table td, #decode-table td, #encode-table th, #decode-table th {
107+
border: 1px solid #ddd;
108+
padding: 4px;
109+
}
110+
111+
#encode-table th, #decode-table th {
112+
padding-top: 4px;
113+
padding-bottom: 4px;
114+
text-align: left;
115+
}

qa/workunits/erasure-code/plot.js

Lines changed: 64 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,38 @@ $(function() {
3232
lines: { show: true },
3333
});
3434
}
35+
if (typeof encode_reed_sol_r6_op_jerasure != 'undefined') {
36+
encode.push({
37+
data: encode_reed_sol_r6_op_jerasure,
38+
label: "Jerasure, Reed Solomon RAID6",
39+
points: { show: true },
40+
lines: { show: true },
41+
});
42+
}
43+
if (typeof encode_liberation_jerasure != 'undefined') {
44+
encode.push({
45+
data: encode_liberation_jerasure,
46+
label: "Jerasure, Liberation",
47+
points: { show: true },
48+
lines: { show: true },
49+
});
50+
}
51+
if (typeof encode_liber8tion_jerasure != 'undefined') {
52+
encode.push({
53+
data: encode_liber8tion_jerasure,
54+
label: "Jerasure, Liber8tion",
55+
points: { show: true },
56+
lines: { show: true },
57+
});
58+
}
59+
if (typeof encode_blaum_roth_jerasure != 'undefined') {
60+
encode.push({
61+
data: encode_blaum_roth_jerasure,
62+
label: "Jerasure, Blaum Roth",
63+
points: { show: true },
64+
lines: { show: true },
65+
});
66+
}
3567
$.plot("#encode", encode, {
3668
xaxis: {
3769
mode: "categories",
@@ -72,11 +104,42 @@ $(function() {
72104
lines: { show: true },
73105
});
74106
}
107+
if (typeof decode_reed_sol_r6_op_jerasure != 'undefined') {
108+
decode.push({
109+
data: decode_reed_sol_r6_op_jerasure,
110+
label: "Jerasure, Reed Solomon RAID6",
111+
points: { show: true },
112+
lines: { show: true },
113+
});
114+
}
115+
if (typeof decode_liberation_jerasure != 'undefined') {
116+
decode.push({
117+
data: decode_liberation_jerasure,
118+
label: "Jerasure, Liberation",
119+
points: { show: true },
120+
lines: { show: true },
121+
});
122+
}
123+
if (typeof decode_liber8tion_jerasure != 'undefined') {
124+
decode.push({
125+
data: decode_liber8tion_jerasure,
126+
label: "Jerasure, Liber8tion",
127+
points: { show: true },
128+
lines: { show: true },
129+
});
130+
}
131+
if (typeof decode_blaum_roth_jerasure != 'undefined') {
132+
decode.push({
133+
data: decode_blaum_roth_jerasure,
134+
label: "Jerasure, Blaum Roth",
135+
points: { show: true },
136+
lines: { show: true },
137+
});
138+
}
75139
$.plot("#decode", decode, {
76140
xaxis: {
77141
mode: "categories",
78142
tickLength: 0
79143
},
80144
});
81-
82145
});
Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
$(function() {
2+
if (typeof encode_table != 'undefined') {
3+
let table_rows = '';
4+
for (let row of encode_table) {
5+
table_rows += `<tr>`
6+
for (let cell of row)
7+
{
8+
table_rows += `<td>${cell}</td>`
9+
}
10+
table_rows += `</tr>`;
11+
console.log(table_rows);
12+
}
13+
$('#encode-table').append(table_rows);
14+
}
15+
16+
if (typeof decode_table != 'undefined') {
17+
let table_rows = '';
18+
for (let row of decode_table) {
19+
table_rows += `<tr>`
20+
for (let cell of row)
21+
{
22+
table_rows += `<td>${cell}</td>`
23+
}
24+
table_rows += `</tr>`;
25+
}
26+
$('#decode-table').append(table_rows);
27+
}
28+
});

0 commit comments

Comments
 (0)