Skip to content

Commit

Permalink
Change default compression to zstd:3 (#6995)
Browse files Browse the repository at this point in the history
  • Loading branch information
ajeetdsouza authored Nov 30, 2020
1 parent 4624bdd commit 8dbf573
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
2 changes: 1 addition & 1 deletion dgraph/cmd/bulk/run.go
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
2 changes: 2 additions & 0 deletions worker/restore.go
Original file line number Diff line number Diff line change
Expand Up @@ -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).
Expand Down

0 comments on commit 8dbf573

Please sign in to comment.