restconf performance test
This commit is contained in:
parent
f65187df7f
commit
ffe77c9127
2 changed files with 79 additions and 43 deletions
|
|
@ -1,12 +1,12 @@
|
||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
# Transactions per second for large lists read/write plotter using gnuplot
|
# Transactions per second for large lists read/write plotter using gnuplot
|
||||||
#
|
# WORK IN PROGRESS
|
||||||
. ./lib.sh
|
. ./lib.sh
|
||||||
max=200 # Nr of db entries
|
max=2000 # Nr of db entries
|
||||||
step=100
|
step=200
|
||||||
reqs=1000
|
reqs=500
|
||||||
cfg=$dir/scaling-conf.xml
|
cfg=$dir/plot-conf.xml
|
||||||
fyang=$dir/scaling.yang
|
fyang=$dir/plot.yang
|
||||||
fconfig=$dir/config
|
fconfig=$dir/config
|
||||||
|
|
||||||
# For memcheck
|
# For memcheck
|
||||||
|
|
@ -40,6 +40,7 @@ cat <<EOF > $cfg
|
||||||
<CLICON_YANG_MODULE_MAIN>ietf-ip</CLICON_YANG_MODULE_MAIN>
|
<CLICON_YANG_MODULE_MAIN>ietf-ip</CLICON_YANG_MODULE_MAIN>
|
||||||
<CLICON_SOCK>/usr/local/var/routing/routing.sock</CLICON_SOCK>
|
<CLICON_SOCK>/usr/local/var/routing/routing.sock</CLICON_SOCK>
|
||||||
<CLICON_BACKEND_PIDFILE>/usr/local/var/routing/routing.pidfile</CLICON_BACKEND_PIDFILE>
|
<CLICON_BACKEND_PIDFILE>/usr/local/var/routing/routing.pidfile</CLICON_BACKEND_PIDFILE>
|
||||||
|
<CLICON_RESTCONF_PRETTY>false</CLICON_RESTCONF_PRETTY>
|
||||||
<CLICON_XMLDB_DIR>/usr/local/var/routing</CLICON_XMLDB_DIR>
|
<CLICON_XMLDB_DIR>/usr/local/var/routing</CLICON_XMLDB_DIR>
|
||||||
<CLICON_XMLDB_PLUGIN>/usr/local/lib/xmldb/text.so</CLICON_XMLDB_PLUGIN>
|
<CLICON_XMLDB_PLUGIN>/usr/local/lib/xmldb/text.so</CLICON_XMLDB_PLUGIN>
|
||||||
</config>
|
</config>
|
||||||
|
|
@ -52,9 +53,16 @@ run(){
|
||||||
|
|
||||||
echo -n "<rpc><edit-config><target><candidate/></target><default-operation>replace</default-operation><config><x>" > $fconfig
|
echo -n "<rpc><edit-config><target><candidate/></target><default-operation>replace</default-operation><config><x>" > $fconfig
|
||||||
for (( i=0; i<$nr; i++ )); do
|
for (( i=0; i<$nr; i++ )); do
|
||||||
echo -n "<c>$i</c>" >> $fconfig
|
case $mode in
|
||||||
|
readlist|writelist|restreadlist|restwritelist)
|
||||||
echo -n "<y><a>$i</a><b>$i</b></y>" >> $fconfig
|
echo -n "<y><a>$i</a><b>$i</b></y>" >> $fconfig
|
||||||
|
;;
|
||||||
|
writeleaflist)
|
||||||
|
echo -n "<c>$i</c>" >> $fconfig
|
||||||
|
;;
|
||||||
|
esac
|
||||||
done
|
done
|
||||||
|
|
||||||
echo "</x></config></edit-config></rpc>]]>]]>" >> $fconfig
|
echo "</x></config></edit-config></rpc>]]>]]>" >> $fconfig
|
||||||
|
|
||||||
expecteof_file "$clixon_netconf -qf $cfg -y $fyang" "$fconfig" "^<rpc-reply><ok/></rpc-reply>]]>]]>$"
|
expecteof_file "$clixon_netconf -qf $cfg -y $fyang" "$fconfig" "^<rpc-reply><ok/></rpc-reply>]]>]]>$"
|
||||||
|
|
@ -72,11 +80,11 @@ done | $clixon_netconf -qf $cfg -y $fyang > /dev/null
|
||||||
echo "<rpc><edit-config><target><candidate/></target><config><x><y><a>$rnd</a><b>$rnd</b></y></x></config></edit-config></rpc>]]>]]>"
|
echo "<rpc><edit-config><target><candidate/></target><config><x><y><a>$rnd</a><b>$rnd</b></y></x></config></edit-config></rpc>]]>]]>"
|
||||||
done | $clixon_netconf -qf $cfg -y $fyang > /dev/null
|
done | $clixon_netconf -qf $cfg -y $fyang > /dev/null
|
||||||
;;
|
;;
|
||||||
readleaflist)
|
restreadlist)
|
||||||
time -p for (( i=0; i<$reqs; i++ )); do
|
time -p for (( i=0; i<$reqs; i++ )); do
|
||||||
rnd=$(( ( RANDOM % $nr ) ))
|
rnd=$(( ( RANDOM % $nr ) ))
|
||||||
echo "<rpc><get-config><source><candidate/></source><filter type=\"xpath\" select=\"/x[c=$rnd]\" /></get-config></rpc>]]>]]>"
|
curl -sSG http://localhost/restconf/data/x/y=$rnd,$rnd > /dev/null
|
||||||
done | $clixon_netconf -qf $cfg -y $fyang > /dev/null
|
done
|
||||||
;;
|
;;
|
||||||
writeleaflist)
|
writeleaflist)
|
||||||
time -p for (( i=0; i<$reqs; i++ )); do
|
time -p for (( i=0; i<$reqs; i++ )); do
|
||||||
|
|
@ -85,21 +93,24 @@ done | $clixon_netconf -qf $cfg -y $fyang > /dev/null
|
||||||
done | $clixon_netconf -qf $cfg -y $fyang > /dev/null
|
done | $clixon_netconf -qf $cfg -y $fyang > /dev/null
|
||||||
;;
|
;;
|
||||||
esac
|
esac
|
||||||
expecteof "$clixon_netconf -qf $cfg" "<rpc><discard-changes/></rpc>]]>]]>" "^<rpc-reply><ok/></rpc-reply>]]>]]>$"
|
expecteof "$clixon_netconf -qf $cfg -y $fyang" "<rpc><discard-changes/></rpc>]]>]]>" "^<rpc-reply><ok/></rpc-reply>]]>]]>$"
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
step(){
|
step(){
|
||||||
i=$1
|
i=$1
|
||||||
mode=$2
|
mode=$2
|
||||||
echo -n "" > $fconfig
|
echo -n "" > $fconfig
|
||||||
t=$(TEST=%e run $i $reqs $mode $ 2>&1 | awk '/real/ {print $2}')
|
t=$(TEST=%e run $i $reqs $mode 2>&1 | awk '/real/ {print $2}')
|
||||||
|
#TEST=%e run $i $reqs $mode 2>&1
|
||||||
# t is time in secs of $reqs -> transactions per second. $reqs
|
# t is time in secs of $reqs -> transactions per second. $reqs
|
||||||
p=$(echo "$reqs/$t" | bc -lq)
|
p=$(echo "$reqs/$t" | bc -lq)
|
||||||
# p is transactions per second.
|
# p is transactions per second.
|
||||||
echo "$i $p" >> $dir/$mode
|
echo "$i $p" >> $dir/$mode
|
||||||
|
# echo "m:$mode i:$i t=$t p=$p"
|
||||||
}
|
}
|
||||||
|
|
||||||
once()(
|
once(){
|
||||||
# kill old backend (if any)
|
# kill old backend (if any)
|
||||||
sudo clixon_backend -zf $cfg -y $fyang
|
sudo clixon_backend -zf $cfg -y $fyang
|
||||||
if [ $? -ne 0 ]; then
|
if [ $? -ne 0 ]; then
|
||||||
|
|
@ -116,14 +127,14 @@ once()(
|
||||||
for (( i=10; i<=$step; i=i+10 )); do
|
for (( i=10; i<=$step; i=i+10 )); do
|
||||||
step $i readlist
|
step $i readlist
|
||||||
step $i writelist
|
step $i writelist
|
||||||
step $i readleaflist
|
step $i restreadlist
|
||||||
step $i writeleaflist
|
step $i writeleaflist
|
||||||
done
|
done
|
||||||
# Actual steps
|
# Actual steps
|
||||||
for (( i=$step; i<=$max; i=i+$step )); do
|
for (( i=$step; i<=$max; i=i+$step )); do
|
||||||
step $i readlist
|
step $i readlist
|
||||||
step $i readleaflist
|
|
||||||
step $i writelist
|
step $i writelist
|
||||||
|
step $i restreadlist
|
||||||
step $i writeleaflist
|
step $i writeleaflist
|
||||||
done
|
done
|
||||||
|
|
||||||
|
|
@ -137,8 +148,7 @@ once()(
|
||||||
if [ $? -ne 0 ]; then
|
if [ $? -ne 0 ]; then
|
||||||
err "kill backend"
|
err "kill backend"
|
||||||
fi
|
fi
|
||||||
|
}
|
||||||
)
|
|
||||||
|
|
||||||
once
|
once
|
||||||
|
|
||||||
|
|
@ -146,10 +156,9 @@ gnuplot -persist <<EOF
|
||||||
set title "Clixon transactions per second r/w large lists" font ",14" textcolor rgbcolor "royalblue"
|
set title "Clixon transactions per second r/w large lists" font ",14" textcolor rgbcolor "royalblue"
|
||||||
set xlabel "entries"
|
set xlabel "entries"
|
||||||
set ylabel "transactions per second"
|
set ylabel "transactions per second"
|
||||||
set terminal wxt enhanced title "CLixon transactions " persist raise
|
set terminal wxt enhanced title "Clixon transactions " persist raise
|
||||||
plot "$dir/readlist" with linespoints title "read list", "$dir/writelist" with linespoints title "write list", "$dir/readleaflist" with linespoints title "read leaf-list", "$dir/writeleaflist" with linespoints title "write leaf-list"
|
plot "$dir/readlist" with linespoints title "read list", "$dir/writelist" with linespoints title "write list", "$dir/writeleaflist" with linespoints title "write leaf-list" , "$dir/restreadlist" with linespoints title "rest get list"
|
||||||
EOF
|
EOF
|
||||||
|
|
||||||
rm -rf $dir
|
rm -rf $dir
|
||||||
|
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -54,6 +54,7 @@ cat <<EOF > $cfg
|
||||||
<CLICON_YANG_MODULE_MAIN>ietf-ip</CLICON_YANG_MODULE_MAIN>
|
<CLICON_YANG_MODULE_MAIN>ietf-ip</CLICON_YANG_MODULE_MAIN>
|
||||||
<CLICON_SOCK>/usr/local/var/routing/routing.sock</CLICON_SOCK>
|
<CLICON_SOCK>/usr/local/var/routing/routing.sock</CLICON_SOCK>
|
||||||
<CLICON_BACKEND_PIDFILE>/usr/local/var/routing/routing.pidfile</CLICON_BACKEND_PIDFILE>
|
<CLICON_BACKEND_PIDFILE>/usr/local/var/routing/routing.pidfile</CLICON_BACKEND_PIDFILE>
|
||||||
|
<CLICON_RESTCONF_PRETTY>false</CLICON_RESTCONF_PRETTY>
|
||||||
<CLICON_XMLDB_DIR>/usr/local/var/routing</CLICON_XMLDB_DIR>
|
<CLICON_XMLDB_DIR>/usr/local/var/routing</CLICON_XMLDB_DIR>
|
||||||
<CLICON_XMLDB_PLUGIN>/usr/local/lib/xmldb/text.so</CLICON_XMLDB_PLUGIN>
|
<CLICON_XMLDB_PLUGIN>/usr/local/lib/xmldb/text.so</CLICON_XMLDB_PLUGIN>
|
||||||
</config>
|
</config>
|
||||||
|
|
@ -73,6 +74,14 @@ if [ $? -ne 0 ]; then
|
||||||
err
|
err
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
new "kill old restconf daemon"
|
||||||
|
sudo pkill -u www-data clixon_restconf
|
||||||
|
|
||||||
|
new "start restconf daemon"
|
||||||
|
sudo start-stop-daemon -S -q -o -b -x /www-data/clixon_restconf -d /www-data -c www-data -- -Df $cfg -y $fyang
|
||||||
|
|
||||||
|
sleep 1
|
||||||
|
|
||||||
new "generate 'large' config with $number list entries"
|
new "generate 'large' config with $number list entries"
|
||||||
echo -n "<rpc><edit-config><target><candidate/></target><config><x>" > $fconfig
|
echo -n "<rpc><edit-config><target><candidate/></target><config><x>" > $fconfig
|
||||||
for (( i=0; i<$number; i++ )); do
|
for (( i=0; i<$number; i++ )); do
|
||||||
|
|
@ -84,25 +93,37 @@ echo "</x></config></edit-config></rpc>]]>]]>" >> $fconfig
|
||||||
echo "$clixon_netconf -qf $cfg -y $fyang"
|
echo "$clixon_netconf -qf $cfg -y $fyang"
|
||||||
|
|
||||||
new "netconf write large config"
|
new "netconf write large config"
|
||||||
expecteof_file "time -p $clixon_netconf -qf $cfg -y $fyang" "$fconfig" "^<rpc-reply><ok/></rpc-reply>]]>]]>$"
|
expecteof_file "time -f %e $clixon_netconf -qf $cfg -y $fyang" "$fconfig" "^<rpc-reply><ok/></rpc-reply>]]>]]>$"
|
||||||
|
|
||||||
#echo '<rpc><get-config><source><candidate/></source></get-config></rpc>]]>]]>' | $clixon_netconf -qf $cfg -y $fyang
|
#echo '<rpc><get-config><source><candidate/></source></get-config></rpc>]]>]]>' | $clixon_netconf -qf $cfg -y $fyang
|
||||||
|
|
||||||
new "netconf write large config again"
|
new "netconf write large config again"
|
||||||
expecteof_file "time -p $clixon_netconf -qf $cfg -y $fyang" "$fconfig" "^<rpc-reply><ok/></rpc-reply>]]>]]>$"
|
expecteof_file "time -f %e $clixon_netconf -qf $cfg -y $fyang" "$fconfig" "^<rpc-reply><ok/></rpc-reply>]]>]]>$"
|
||||||
|
|
||||||
#echo '<rpc><get-config><source><candidate/></source></get-config></rpc>]]>]]>' | $clixon_netconf -qf $cfg -y $fyang
|
#echo '<rpc><get-config><source><candidate/></source></get-config></rpc>]]>]]>' | $clixon_netconf -qf $cfg -y $fyang
|
||||||
|
|
||||||
rm $fconfig
|
rm $fconfig
|
||||||
|
|
||||||
new "netconf commit large config"
|
new "netconf commit large config"
|
||||||
expecteof "time -p $clixon_netconf -qf $cfg -y $fyang" "<rpc><commit><source><candidate/></source></commit></rpc>]]>]]>" "^<rpc-reply><ok/></rpc-reply>]]>]]>$"
|
expecteof "time -f %e $clixon_netconf -qf $cfg -y $fyang" "<rpc><commit><source><candidate/></source></commit></rpc>]]>]]>" "^<rpc-reply><ok/></rpc-reply>]]>]]>$"
|
||||||
|
|
||||||
new "netconf commit large config again"
|
new "netconf commit large config again"
|
||||||
expecteof "time -p $clixon_netconf -qf $cfg -y $fyang" "<rpc><commit><source><candidate/></source></commit></rpc>]]>]]>" "^<rpc-reply><ok/></rpc-reply>]]>]]>$"
|
expecteof "time -f %e $clixon_netconf -qf $cfg -y $fyang" "<rpc><commit><source><candidate/></source></commit></rpc>]]>]]>" "^<rpc-reply><ok/></rpc-reply>]]>]]>$"
|
||||||
|
|
||||||
new "netconf add small (1 entry) config"
|
new "netconf add small (1 entry) config"
|
||||||
expecteof "time -p $clixon_netconf -qf $cfg -y $fyang" "<rpc><edit-config><target><candidate/></target><config><x><y><a>x</a><b>y</b></y></x></config></edit-config></rpc>]]>]]>" "^<rpc-reply><ok/></rpc-reply>]]>]]>$"
|
expecteof "time -f %e $clixon_netconf -qf $cfg -y $fyang" "<rpc><edit-config><target><candidate/></target><config><x><y><a>x</a><b>y</b></y></x></config></edit-config></rpc>]]>]]>" "^<rpc-reply><ok/></rpc-reply>]]>]]>$"
|
||||||
|
|
||||||
|
new "netconf get $req small config"
|
||||||
|
time -p for (( i=0; i<$req; i++ )); do
|
||||||
|
rnd=$(( ( RANDOM % $number ) ))
|
||||||
|
echo "<rpc><get-config><source><candidate/></source><filter type=\"xpath\" select=\"/x/y[a=$rnd][b=$rnd]\" /></get-config></rpc>]]>]]>"
|
||||||
|
done | $clixon_netconf -qf $cfg -y $fyang > /dev/null
|
||||||
|
|
||||||
|
new "netconf get $req restconf small config"
|
||||||
|
time -p for (( i=0; i<$req; i++ )); do
|
||||||
|
rnd=$(( ( RANDOM % $number ) ))
|
||||||
|
#XXX curl -sX PUT -d {"y":{"a":"$rnd","b":"$rnd"}} http://localhost/restconf/data/x/y=$rnd,$rnd
|
||||||
|
done
|
||||||
|
|
||||||
new "netconf add $req small config"
|
new "netconf add $req small config"
|
||||||
time -p for (( i=0; i<$req; i++ )); do
|
time -p for (( i=0; i<$req; i++ )); do
|
||||||
|
|
@ -110,14 +131,14 @@ time -p for (( i=0; i<$req; i++ )); do
|
||||||
echo "<rpc><edit-config><target><candidate/></target><config><x><y><a>$rnd</a><b>$rnd</b></y></x></config></edit-config></rpc>]]>]]>"
|
echo "<rpc><edit-config><target><candidate/></target><config><x><y><a>$rnd</a><b>$rnd</b></y></x></config></edit-config></rpc>]]>]]>"
|
||||||
done | $clixon_netconf -qf $cfg -y $fyang > /dev/null
|
done | $clixon_netconf -qf $cfg -y $fyang > /dev/null
|
||||||
|
|
||||||
new "netconf get large config"
|
new "netconf add $req restconf small config"
|
||||||
expecteof "time -p $clixon_netconf -qf $cfg -y $fyang" "<rpc><get-config><source><candidate/></source></get-config></rpc>]]>]]>" "^<rpc-reply><data><x><y><a>0</a><b>0</b></y><y><a>1</a><b>1</b>"
|
|
||||||
|
|
||||||
new "netconf get $req small config"
|
|
||||||
time -p for (( i=0; i<$req; i++ )); do
|
time -p for (( i=0; i<$req; i++ )); do
|
||||||
rnd=$(( ( RANDOM % $number ) ))
|
rnd=$(( ( RANDOM % $number ) ))
|
||||||
echo "<rpc><get-config><source><candidate/></source><filter type=\"xpath\" select=\"/x/y[a=$rnd][b=$rnd]\" /></get-config></rpc>]]>]]>"
|
curl -sG http://localhost/restconf/data/x/y=$rnd,$rnd > /dev/null
|
||||||
done | $clixon_netconf -qf $cfg -y $fyang > /dev/null
|
done
|
||||||
|
|
||||||
|
new "netconf get large config"
|
||||||
|
expecteof "time -f %e $clixon_netconf -qf $cfg -y $fyang" "<rpc><get-config><source><candidate/></source></get-config></rpc>]]>]]>" "^<rpc-reply><data><x><y><a>0</a><b>0</b></y><y><a>1</a><b>1</b>"
|
||||||
|
|
||||||
new "generate large leaf-list config"
|
new "generate large leaf-list config"
|
||||||
echo -n "<rpc><edit-config><target><candidate/></target><default-operation>replace</default-operation><config><x>" > $fconfig
|
echo -n "<rpc><edit-config><target><candidate/></target><default-operation>replace</default-operation><config><x>" > $fconfig
|
||||||
|
|
@ -127,21 +148,27 @@ done
|
||||||
echo "</x></config></edit-config></rpc>]]>]]>" >> $fconfig
|
echo "</x></config></edit-config></rpc>]]>]]>" >> $fconfig
|
||||||
|
|
||||||
new "netconf replace large list-leaf config"
|
new "netconf replace large list-leaf config"
|
||||||
expecteof_file "time -p $clixon_netconf -qf $cfg -y $fyang" "$fconfig" "^<rpc-reply><ok/></rpc-reply>]]>]]>$"
|
expecteof_file "time -f %e $clixon_netconf -qf $cfg -y $fyang" "$fconfig" "^<rpc-reply><ok/></rpc-reply>]]>]]>$"
|
||||||
|
|
||||||
rm $fconfig
|
rm $fconfig
|
||||||
|
|
||||||
new "netconf commit large leaf-list config"
|
new "netconf commit large leaf-list config"
|
||||||
expecteof "time -p $clixon_netconf -qf $cfg -y $fyang" "<rpc><commit><source><candidate/></source></commit></rpc>]]>]]>" "^<rpc-reply><ok/></rpc-reply>]]>]]>$"
|
expecteof "time -f %e $clixon_netconf -qf $cfg -y $fyang" "<rpc><commit><source><candidate/></source></commit></rpc>]]>]]>" "^<rpc-reply><ok/></rpc-reply>]]>]]>$"
|
||||||
|
|
||||||
|
new "netconf add $req small leaf-list config"
|
||||||
|
time -p for (( i=0; i<$req; i++ )); do
|
||||||
|
rnd=$(( ( RANDOM % $number ) ))
|
||||||
|
echo "<rpc><edit-config><target><candidate/></target><config><x><c>$rnd</c></x></config></edit-config></rpc>]]>]]>"
|
||||||
|
done | $clixon_netconf -qf $cfg -y $fyang > /dev/null
|
||||||
|
|
||||||
new "netconf add small leaf-list config"
|
new "netconf add small leaf-list config"
|
||||||
expecteof "time -p $clixon_netconf -qf $cfg -y $fyang" "<rpc><edit-config><target><candidate/></target><config><x><c>x</c></x></config></edit-config></rpc>]]>]]>" "^<rpc-reply><ok/></rpc-reply>]]>]]>$"
|
expecteof "time -f %e $clixon_netconf -qf $cfg -y $fyang" "<rpc><edit-config><target><candidate/></target><config><x><c>x</c></x></config></edit-config></rpc>]]>]]>" "^<rpc-reply><ok/></rpc-reply>]]>]]>$"
|
||||||
|
|
||||||
new "netconf commit small leaf-list config"
|
new "netconf commit small leaf-list config"
|
||||||
expecteof "time -p $clixon_netconf -qf $cfg -y $fyang" "<rpc><commit><source><candidate/></source></commit></rpc>]]>]]>" "^<rpc-reply><ok/></rpc-reply>]]>]]>$"
|
expecteof "time -f %e $clixon_netconf -qf $cfg -y $fyang" "<rpc><commit><source><candidate/></source></commit></rpc>]]>]]>" "^<rpc-reply><ok/></rpc-reply>]]>]]>$"
|
||||||
|
|
||||||
new "netconf get large leaf-list config"
|
new "netconf get large leaf-list config"
|
||||||
expecteof "time -p $clixon_netconf -qf $cfg -y $fyang" "<rpc><get-config><source><candidate/></source></get-config></rpc>]]>]]>" "^<rpc-reply><data><x><c>0</c><c>1</c>"
|
expecteof "time -f %e $clixon_netconf -qf $cfg -y $fyang" "<rpc><get-config><source><candidate/></source></get-config></rpc>]]>]]>" "^<rpc-reply><data><x><c>0</c><c>1</c>"
|
||||||
|
|
||||||
new "Kill backend"
|
new "Kill backend"
|
||||||
# Check if still alive
|
# Check if still alive
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue