-
Notifications
You must be signed in to change notification settings - Fork 114
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
The `zip` command benchmarks the MinIO [s3zip](https://blog.min.io/small-file-archives/) extension that allows This will upload a single zip file with 10000 individual files (change with `--files`) of 10KiB each (changed with `--obj.size`). The benchmark will then download individual files concurrently and present the result as a GET benchmark. Example: ``` λ warp zip --obj.size=1MiB -duration=1m warp: Benchmark data written to "warp-zip-2022-12-02[150109]-xmXj.csv.zst" ---------------------------------------- Operation: GET * Average: 728.78 MiB/s, 728.78 obj/s Throughput, split into 59 x 1s: * Fastest: 757.0MiB/s, 756.96 obj/s * 50% Median: 732.7MiB/s, 732.67 obj/s * Slowest: 662.7MiB/s, 662.65 obj/s ``` This will only work on recent MinIO versions, from 2022 and going forward.
- Loading branch information
Showing
9 changed files
with
409 additions
and
53 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -99,6 +99,7 @@ func init() { | |
versionedCmd, | ||
retentionCmd, | ||
multipartCmd, | ||
zipCmd, | ||
} | ||
b := []cli.Command{ | ||
analyzeCmd, | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,97 @@ | ||
/* | ||
* Warp (C) 2019-2022 MinIO, Inc. | ||
* | ||
* This program is free software: you can redistribute it and/or modify | ||
* it under the terms of the GNU Affero General Public License as published by | ||
* the Free Software Foundation, either version 3 of the License, or | ||
* (at your option) any later version. | ||
* | ||
* This program is distributed in the hope that it will be useful, | ||
* but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
* GNU Affero General Public License for more details. | ||
* | ||
* You should have received a copy of the GNU Affero General Public License | ||
* along with this program. If not, see <http://www.gnu.org/licenses/>. | ||
*/ | ||
|
||
package cli | ||
|
||
import ( | ||
"fmt" | ||
"time" | ||
|
||
"github.com/minio/cli" | ||
"github.com/minio/pkg/console" | ||
"github.com/minio/warp/pkg/bench" | ||
) | ||
|
||
var zipFlags = []cli.Flag{ | ||
cli.IntFlag{ | ||
Name: "files", | ||
Value: 10000, | ||
Usage: "Number of files to upload in the zip file.", | ||
}, | ||
cli.StringFlag{ | ||
Name: "obj.size", | ||
Value: "10KiB", | ||
Usage: "Size of each generated object. Can be a number or 10KiB/MiB/GiB. All sizes are base 2 binary.", | ||
}, | ||
cli.StringFlag{ | ||
Name: "part.size", | ||
Value: "", | ||
Usage: "Multipart part size. Can be a number or 10KiB/MiB/GiB. All sizes are base 2 binary.", | ||
Hidden: true, | ||
}, | ||
} | ||
|
||
var zipCmd = cli.Command{ | ||
Name: "zip", | ||
Usage: "benchmark minio s3zip", | ||
Action: mainZip, | ||
Before: setGlobalsFromContext, | ||
Flags: combineFlags(globalFlags, ioFlags, zipFlags, genFlags, benchFlags, analyzeFlags), | ||
CustomHelpTemplate: `NAME: | ||
{{.HelpName}} - {{.Usage}} | ||
USAGE: | ||
{{.HelpName}} [FLAGS] | ||
-> see https://github.com/minio/warp#zip | ||
FLAGS: | ||
{{range .VisibleFlags}}{{.}} | ||
{{end}}`, | ||
} | ||
|
||
// mainGet is the entry point for get command. | ||
func mainZip(ctx *cli.Context) error { | ||
checkZipSyntax(ctx) | ||
ctx.Set("noprefix", "true") | ||
src := newGenSource(ctx, "obj.size") | ||
b := bench.S3Zip{ | ||
Common: bench.Common{ | ||
Client: newClient(ctx), | ||
Concurrency: ctx.Int("concurrent"), | ||
Source: src, | ||
Bucket: ctx.String("bucket"), | ||
Location: "", | ||
PutOpts: putOpts(ctx), | ||
Locking: true, | ||
}, | ||
CreateFiles: ctx.Int("files"), | ||
ZipObjName: fmt.Sprintf("%d.zip", time.Now().UnixNano()), | ||
} | ||
return runBench(ctx, &b) | ||
} | ||
|
||
func checkZipSyntax(ctx *cli.Context) { | ||
if ctx.NArg() > 0 { | ||
console.Fatal("Command takes no arguments") | ||
} | ||
if ctx.Int("files") <= 0 { | ||
console.Fatal("There must be more than 0 objects.") | ||
} | ||
|
||
checkAnalyze(ctx) | ||
checkBenchmark(ctx) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.