File: speed_cache.test

package info (click to toggle)
unbound 1.24.2-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 31,436 kB
  • sloc: ansic: 138,476; sh: 6,860; yacc: 4,259; python: 1,950; makefile: 1,881; awk: 162; perl: 158; xml: 36
file content (79 lines) | stat: -rw-r--r-- 1,915 bytes parent folder | download | duplicates (7)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
# #-- speed_cache.test --#
# source the master var file when it's there
[ -f ../.tpkg.var.master ] && source ../.tpkg.var.master
# use .tpkg.var.test for in test variable passing
[ -f .tpkg.var.test ] && source .tpkg.var.test

PRE="../.."
. ../common.sh

# make tool
get_make
(cd $PRE; $MAKE perf)

get_gcc
$CC -o makeqs makeqs.c
if test $? -ne 0; then
	echo "could not compile makeqs"
	exit 1
fi

./makeqs 10 > q10.txt
cat q10.txt
./makeqs 100 > q100.txt
./makeqs 1000 > q1000.txt
./makeqs 10000 > q10000.txt
#./makeqs 100000 > q100000.txt
#./makeqs 1000000 > q1000000.txt
#./makeqs 10000000 > q10000000.txt

# seconds per test
dur=1

# do the test
echo "> perf test ldns-testns"
$PRE/perf -d $dur -a "www.example.com IN A" 127.0.0.1@$FWD_PORT 2>&1 | tee outfile

echo "> perf test cache-1"
$PRE/perf -d $dur -a "www.example.com IN A" 127.0.0.1@$UNBOUND_PORT 2>&1 | tee outfile
echo -n "cache-size-1  	" >> ../.perfstats.txt
grep "average qps" outfile >> ../.perfstats.txt

# with $1=number $2=pretty-str $3=queryfile
function perfnum() {
	echo ""
	echo "> perf test $1 $2"
	$PRE/perf -d $dur -f $3 127.0.0.1@$UNBOUND_PORT 2>&1 | tee outfile
	if test -n "$2"; then
		echo -n "$2	" >> ../.perfstats.txt
		grep "average qps" outfile >> ../.perfstats.txt
	fi
}

function perftns() {
	echo ""
	echo "> perf testns $1 $2"
	$PRE/perf -d $dur -f $3 127.0.0.1@$FWD_PORT 2>&1 | tee outfile
}

#perfnum 10 "" q10.txt
perfnum 100 "cache-suffices" q100.txt
#perfnum 1000 "" q1000.txt
perfnum 10000 "cache-toosmall" q10000.txt
#perfnum 100000 "100k" q100000.txt
#perfnum 1000000 "1m" q1000000.txt
#perfnum 1000000 "10m" q10000000.txt

#perftns 10 "10" q10.txt
#perftns 100 "100" q100.txt
perftns 1000 "1k" q1000.txt
#perftns 10000 "10k" q10000.txt
#perftns 100000 "100k" q100000.txt
#perftns 1000000 "1m" q1000000.txt
#perftns 1000000 "10m" q10000000.txt

echo "> cat logfiles"
cat fwd.log 
cat unbound.log
rm -f q*.txt
exit 0