Skip to content

Commit 34a9cd3

Browse files
committed
bogn module playing with dgm.
1 parent cd3f39d commit 34a9cd3

File tree

4 files changed

+33
-20
lines changed

4 files changed

+33
-20
lines changed

main.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ func optparse(args []string) {
4848
f.StringVar(&options.bogn, "bogn", "memonly", "memonly|durable|dgm|workset")
4949
f.StringVar(&options.memstore, "memstore", "mvcc", "llrb|mvcc for bogn")
5050
f.IntVar(&options.period, "period", 10, "bogn flush period, in seconds")
51-
f.IntVar(&options.load, "load", 1000000, "items to initially load")
51+
f.IntVar(&options.load, "load", 0, "items to initially load")
5252
f.IntVar(&options.inserts, "inserts", 0, "new items to create")
5353
f.IntVar(&options.upserts, "upserts", 0, "items to update")
5454
f.IntVar(&options.deletes, "deletes", 0, "items to delete")

mod_bogn.go

Lines changed: 17 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -69,10 +69,9 @@ func perfbogn() error {
6969
//fmsg := "BOGN total indexed %v items, footprint %v\n"
7070
//fmt.Printf(fmsg, index.Count(), humanize.Bytes(uint64(index.Footprint())))
7171

72-
bogn.CompactIndex(name, diskstore, diskpaths, true /*merge*/)
73-
7472
index.Close()
75-
index.Destroy()
73+
74+
bogn.CompactIndex(name, diskstore, diskpaths, true /*merge*/)
7675
return nil
7776
}
7877

@@ -546,24 +545,27 @@ func bognRange4(index *bogn.Bogn, key, value []byte) (n int64) {
546545
}
547546

548547
func bognsettings(seed int) s.Settings {
549-
sz := int64(options.keylen)
550-
msizes := []int64{
551-
multof4096(4096 + sz), multof4096(8192 + sz), multof4096(12288 + sz),
552-
}
553-
sz = int64(options.keylen + options.vallen)
554-
zsizes := []int64{
555-
multof4096(4096 + sz), multof4096(8192 + sz), multof4096(12288 + sz),
556-
}
557-
flushratios := []float64{.5, .33, .25, .20, .16, .125, .1}
548+
//sz := int64(options.keylen)
549+
//msizes := []int64{
550+
// multof4096(4096 + sz), multof4096(8192 + sz), multof4096(12288 + sz),
551+
//}
552+
//sz = int64(options.keylen + options.vallen)
553+
//zsizes := []int64{
554+
// multof4096(4096 + sz), multof4096(8192 + sz), multof4096(12288 + sz),
555+
//}
556+
//flushratios := []float64{.5, .33, .25, .20, .16, .125, .1}
558557

559558
rnd := rand.New(rand.NewSource(int64(seed)))
560559
setts := bogn.Defaultsettings()
561560
setts["memstore"] = options.memstore
562-
setts["flushratio"] = flushratios[rnd.Intn(10000)%len(flushratios)]
561+
//setts["flushratio"] = flushratios[rnd.Intn(10000)%len(flushratios)]
562+
setts["flushratio"] = 0.25
563563
setts["flushperiod"] = int64(options.period)
564564
setts["bubt.mmap"] = []bool{true, false}[rnd.Intn(10000)%2]
565-
setts["bubt.msize"] = msizes[rnd.Intn(10000)%len(msizes)]
566-
setts["bubt.zsize"] = zsizes[rnd.Intn(10000)%len(msizes)]
565+
//setts["bubt.msize"] = msizes[rnd.Intn(10000)%len(msizes)]
566+
//setts["bubt.zsize"] = zsizes[rnd.Intn(10000)%len(msizes)]
567+
setts["bubt.msize"] = 4096
568+
setts["bubt.zsize"] = 4096
567569
if options.memcapacity > 0 {
568570
setts["llrb.memcapacity"] = options.memcapacity * 1024 * 1024
569571
}

mod_bogn_dgm.sh

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
#! /usr/bin/env bash
22

3-
ARGS="-db bogn -bogn dgm -klen 32 -vlen 1000 -memcap 4096 -log bogn"
3+
ARGS="-db bogn -bogn dgm -klen 32 -vlen 300 -memcap 4096 -log bogn"
44
LOAD="-load 1000000 -lsm"
5-
UPSERTS="-inserts 30000000 -upserts 30000000 -setas set"
6-
DELETES="-deletes 30000000 -delas del"
7-
READS="-gets 20000000 -getas get -ranges 1000000 -rngas vgn"
5+
UPSERTS="-inserts 90000000 -upserts 90000000 -setas set"
6+
DELETES="-deletes 90000000 -delas del"
7+
READS="-gets 100000000 -getas get -ranges 1000000 -rngas vgn"
88

99
rm -rf *.svg dbperf; go build
1010

mod_bogn_dgm_initial.sh

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
#! /usr/bin/env bash
2+
3+
ARGS="-db bogn -bogn dgm -klen 32 -vlen 200 -memcap 4096 -log bogn"
4+
UPSERTS="-inserts 30000000 -setas set"
5+
6+
rm -rf *.svg dbperf; go build
7+
8+
echo "./dbperf $ARGS $LOAD $UPSERTS $DELETES $READS"
9+
./dbperf $ARGS $LOAD $UPSERTS $DELETES $READS
10+
go tool pprof -svg dbperf dbperf.pprof > pprof.svg
11+
go tool pprof -alloc_space -svg dbperf dbperf.mprof > alloc_space.svg

0 commit comments

Comments
 (0)