From a1873dd6f65654d463455ae2d381c35c12f71f51 Mon Sep 17 00:00:00 2001 From: Ben Johnson Date: Thu, 15 May 2014 14:04:57 -0600 Subject: Add option to adjust fill percentage. This commit adds the ability to adjust the fill percentage for splitting nodes. This works by setting a threshold that is a percentage of a total page size. When that threshold is crossed during a split then a new node is created. This is primarily beneficial for append-only workloads. Fixes #163. --- cmd/bolt/main.go | 3 +++ 1 file changed, 3 insertions(+) (limited to 'cmd/bolt/main.go') diff --git a/cmd/bolt/main.go b/cmd/bolt/main.go index 66c33d2..44ba5a1 100644 --- a/cmd/bolt/main.go +++ b/cmd/bolt/main.go @@ -8,6 +8,7 @@ import ( "os" "time" + "github.com/boltdb/bolt" "github.com/codegangsta/cli" ) @@ -114,6 +115,7 @@ func NewApp() *cli.App { &cli.StringFlag{Name: "memprofile", Usage: "Memory profile output path"}, &cli.StringFlag{Name: "blockprofile", Usage: "Block profile output path"}, &cli.StringFlag{Name: "stats-interval", Value: "0s", Usage: "Continuous stats interval"}, + &cli.Float64Flag{Name: "fill-percent", Value: bolt.DefaultFillPercent, Usage: "Fill percentage"}, &cli.BoolFlag{Name: "work", Usage: "Print the temp db and do not delete on exit"}, }, Action: func(c *cli.Context) { @@ -134,6 +136,7 @@ func NewApp() *cli.App { MemProfile: c.String("memprofile"), BlockProfile: c.String("blockprofile"), StatsInterval: statsInterval, + FillPercent: c.Float64("fill-percent"), Clean: !c.Bool("work"), }) }, -- cgit v1.2.3