From e160dbd54d118fe9826fc64d71ddd4fd6a886320 Mon Sep 17 00:00:00 2001 From: Keno Fischer Date: Fri, 1 May 2020 15:22:24 -0400 Subject: [PATCH] Switch compression to zstdmt Seems to be about 6x faster than gzip, but now bottlenecked on https://github.com/JuliaIO/Tar.jl/issues/33. --- Project.toml | 1 + S3Vendor_go/main.go | 2 +- src/BugReporting.jl | 7 +++++-- 3 files changed, 7 insertions(+), 3 deletions(-) diff --git a/Project.toml b/Project.toml index f3343e9..5b47bbb 100644 --- a/Project.toml +++ b/Project.toml @@ -10,6 +10,7 @@ HTTP = "cd3eb016-35fb-5094-929b-558a96fad6f3" JSON = "682c06a0-de6a-54ab-a142-c8b1cf79cde6" Pkg = "44cfe95a-1eb2-52ea-b672-e2afdf69b78f" Tar = "a4e569a6-e804-4fa4-b0f3-eef7a1d5b13e" +Zstd_jll = "3161d3a3-bdf6-5164-811a-617609db77b4" rr_jll = "e86bdf43-55f7-5ea2-9fd0-e7daa2c0f2b4" [compat] diff --git a/S3Vendor_go/main.go b/S3Vendor_go/main.go index b30ec95..32b70f7 100644 --- a/S3Vendor_go/main.go +++ b/S3Vendor_go/main.go @@ -109,7 +109,7 @@ func vendor(req events.APIGatewayProxyRequest) (events.APIGatewayProxyResponse, os.Unsetenv("AWS_SESSION_TOKEN") currentTime := time.Now() - fname := fmt.Sprintf("reports/%s-%s.tar.gz", currentTime.Format("2006-01-02T15-04-05"), user.GetLogin()) + fname := fmt.Sprintf("reports/%s-%s.tar.zstd", currentTime.Format("2006-01-02T15-04-05"), user.GetLogin()) awsSession := session.New() svc := sts.New(awsSession) diff --git a/src/BugReporting.jl b/src/BugReporting.jl index 0270ae6..6f8ed2e 100644 --- a/src/BugReporting.jl +++ b/src/BugReporting.jl @@ -1,6 +1,7 @@ module BugReporting using rr_jll +using Zstd_jll using HTTP, JSON using AWSCore, AWSS3 using Tar @@ -28,7 +29,7 @@ end function rr_pack(trace_directory) check_rr_available() - + trace_directory = normalize_inner_trace(trace_directory) rr() do rr_path run(`$rr_path pack $(trace_directory)`) @@ -153,7 +154,9 @@ function upload_rr_trace(trace_directory) aws = AWSCore.aws_config(creds = creds, region="us-east-1") # Tar it up - proc = open(`gzip -`, "r+") + proc = zstdmt() do zstdp + open(`$zstdp -`, "r+") + end t = @async begin try upload = s3_begin_multipart_upload(aws, TRACE_BUCKET, s3creds["UPLOAD_PATH"])