From f855bcc5200ff8e17a2ee6bb0eb5bc6e84d7d12e Mon Sep 17 00:00:00 2001 From: ognots Date: Wed, 10 May 2023 14:29:55 -0400 Subject: [PATCH 1/2] increase encoding level for smaller files the lotus snapshot export stream should still be slower than the increased compression time. since we encode a stream, this should have neglible effect on the overall snapshot production time, but potentially make the snapshot artifact size much smaller --- cmd/filecoin-chain-archiver/cmds/create.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cmd/filecoin-chain-archiver/cmds/create.go b/cmd/filecoin-chain-archiver/cmds/create.go index 7b5ab4d..ccf146f 100644 --- a/cmd/filecoin-chain-archiver/cmds/create.go +++ b/cmd/filecoin-chain-archiver/cmds/create.go @@ -29,7 +29,7 @@ import ( ) func Compress(in io.Reader, out io.Writer) error { - enc, err := zstd.NewWriter(out) + enc, err := zstd.NewWriter(out, zstd.WithEncoderLevel(7)) if err != nil { return err } From 4d49c1d41a9ee7eeadd16a930233fbc320bf9db5 Mon Sep 17 00:00:00 2001 From: ognots Date: Wed, 10 May 2023 21:08:04 -0400 Subject: [PATCH 2/2] reduce compression level setting it to 7 wasn't working at all --- cmd/filecoin-chain-archiver/cmds/create.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cmd/filecoin-chain-archiver/cmds/create.go b/cmd/filecoin-chain-archiver/cmds/create.go index ccf146f..f5f2188 100644 --- a/cmd/filecoin-chain-archiver/cmds/create.go +++ b/cmd/filecoin-chain-archiver/cmds/create.go @@ -29,7 +29,7 @@ import ( ) func Compress(in io.Reader, out io.Writer) error { - enc, err := zstd.NewWriter(out, zstd.WithEncoderLevel(7)) + enc, err := zstd.NewWriter(out, zstd.WithEncoderLevel(5)) if err != nil { return err }