From ffb24a98f43ea4c1c0fbee71c43e0850ddb857ef Mon Sep 17 00:00:00 2001 From: Fabian Reinartz Date: Thu, 2 Mar 2017 21:53:11 +0100 Subject: [PATCH] Add missing unlock, run debug endpoint in benchmark --- cmd/tsdb/main.go | 5 +++++ db.go | 1 + wal.go | 2 +- 3 files changed, 7 insertions(+), 1 deletion(-) diff --git a/cmd/tsdb/main.go b/cmd/tsdb/main.go index 16b73744f..437f4ce8f 100644 --- a/cmd/tsdb/main.go +++ b/cmd/tsdb/main.go @@ -5,6 +5,8 @@ import ( "fmt" "io" "io/ioutil" + "net/http" + _ "net/http/pprof" "os" "path/filepath" "runtime" @@ -21,6 +23,9 @@ import ( ) func main() { + // Start HTTP server for pprof endpoint. + go http.ListenAndServe(":9999", nil) + root := &cobra.Command{ Use: "tsdb", Short: "CLI tool for tsdb", diff --git a/db.go b/db.go index 78d226833..064dd2e2a 100644 --- a/db.go +++ b/db.go @@ -229,6 +229,7 @@ func (db *DB) compact() error { select { case <-db.stopc: + db.mtx.RUnlock() return nil default: } diff --git a/wal.go b/wal.go index a923f5b3d..5962711f9 100644 --- a/wal.go +++ b/wal.go @@ -58,7 +58,7 @@ type WAL struct { const ( walDirName = "wal" - walSegmentSizeBytes = 64 * 1000 * 1000 // 64 MB + walSegmentSizeBytes = 256 * 1024 * 1024 // 256 MB ) // OpenWAL opens or creates a write ahead log in the given directory.