From 048d3f19b28ee04dd6b2ca3c8f86e5fa65dc7355 Mon Sep 17 00:00:00 2001 From: Ben Johnson Date: Tue, 15 Jul 2014 07:37:46 -0600 Subject: Add DB.NoSync option for bulk loading. This commit adds the DB.NoSync flag to skip fsync() calls on each commit. This should only be used for bulk loading as it can corrupt your database in the event of a system failure. Initial tests show it can provide a 2x speed up for sequential inserts. --- cmd/bolt/main.go | 2 ++ 1 file changed, 2 insertions(+) (limited to 'cmd/bolt/main.go') diff --git a/cmd/bolt/main.go b/cmd/bolt/main.go index a79302d..95bd813 100644 --- a/cmd/bolt/main.go +++ b/cmd/bolt/main.go @@ -118,6 +118,7 @@ func NewApp() *cli.App { &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: "no-sync", Usage: "Skip fsync on every commit"}, &cli.BoolFlag{Name: "work", Usage: "Print the temp db and do not delete on exit"}, }, Action: func(c *cli.Context) { @@ -139,6 +140,7 @@ func NewApp() *cli.App { BlockProfile: c.String("blockprofile"), StatsInterval: statsInterval, FillPercent: c.Float64("fill-percent"), + NoSync: c.Bool("no-sync"), Clean: !c.Bool("work"), }) }, -- cgit v1.2.3