From 7b08ce01852da3e04f0c0e91353e5b8350a6dc77 Mon Sep 17 00:00:00 2001 From: Ajeet D'Souza <98ajeet@gmail.com> Date: Thu, 26 Nov 2020 14:14:41 +0530 Subject: [PATCH] Change default compression to zstd:3 --- dgraph/cmd/bulk/run.go | 2 +- worker/restore.go | 2 ++ 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/dgraph/cmd/bulk/run.go b/dgraph/cmd/bulk/run.go index bd24d569487..44276d230e5 100644 --- a/dgraph/cmd/bulk/run.go +++ b/dgraph/cmd/bulk/run.go @@ -102,7 +102,7 @@ func init() { "Ignore UIDs in load files and assign new ones.") // Options around how to set up Badger. - flag.Int("badger.compression_level", 1, + flag.Int("badger.compression_level", 3, "The compression level for Badger. A higher value uses more resources.") flag.Int64("badger.cache_mb", 0, "Total size of cache (in MB) per shard in reducer.") flag.String("badger.cache_percentage", "0,100", diff --git a/worker/restore.go b/worker/restore.go index 7b0ae1511c3..398cea12523 100644 --- a/worker/restore.go +++ b/worker/restore.go @@ -64,6 +64,8 @@ func RunRestore(pdir, location, backupId string, key x.SensitiveByteSlice) LoadR // The badger DB should be opened only after creating the backup // file reader and verifying the encryption in the backup file. db, err := badger.OpenManaged(badger.DefaultOptions(dir). + WithCompression(options.ZSTD). + WithZSTDCompressionLevel(3). WithSyncWrites(false). WithTableLoadingMode(options.MemoryMap). WithValueThreshold(1 << 10).