From 1ea2244c8c207a195d95a2c0f85b8a9a4e5ee9b1 Mon Sep 17 00:00:00 2001 From: Quentin Dufour Date: Mon, 19 Sep 2022 12:37:25 +0200 Subject: [PATCH] Update s3concurrent --- README.md | 2 ++ benchmarks/s3concurrent/main.go | 12 +++++++++++- scenarios/.garage-s3lat.swo | Bin 12288 -> 0 bytes topo/dc.yml | 22 ++++++++++++++++++++++ 4 files changed, 35 insertions(+), 1 deletion(-) delete mode 100644 scenarios/.garage-s3lat.swo create mode 100644 topo/dc.yml diff --git a/README.md b/README.md index f49f574..b9dddff 100644 --- a/README.md +++ b/README.md @@ -30,6 +30,7 @@ source .venv/bin/activate ## Topologies All topologies: + - `./topo/dc.yml` - A 3 node topology connected with a 1Gbit/s link and a 1ms latency - `./topo/with-vdsl.yml` - A topology mixing datacenters with fast internal connectivity and an isolated VDSL node - `./topo/50ms.yml` - An artifical topology simulating nodes with high bandwidth but with a fixed 50ms latency, useful to quantify the impact of latency on a distributed software - `./topo/multi-dc.yml` - Simulate 3 DC interconnected with 50ms latency WAN network and close to zero latency inside the DC @@ -41,6 +42,7 @@ Feel free to write new topologies! All scenarios: - `./scenarios/garage-s3lat [garage-v0.7|garage-v0.8]` - Run s3lat on Garage + - `./scenarios/garage-concurrent [garage-v0.7|garage-v0.8]` - Run s3concurrent on Garage - `./scenarios/garage-warp [garage-v0.7|garage-v0.8] [default|fast]` - Run warp on Garage. 2 flavors are available: fast and default. *Scenarios take optional flavors as input that modulate their behavioir. Passing them is not mandatory, diff --git a/benchmarks/s3concurrent/main.go b/benchmarks/s3concurrent/main.go index 9f7f3af..55d7b3d 100644 --- a/benchmarks/s3concurrent/main.go +++ b/benchmarks/s3concurrent/main.go @@ -3,6 +3,8 @@ package main import ( "context" "crypto/tls" + "fmt" + "time" "io" "log" "math/rand" @@ -99,24 +101,32 @@ func main() { } log.Printf("created bucket %s\n", buck) + fmt.Println("sent,success,elapsed,elapsed_per_req") + // Send to bucket for i := 1; i <= 16; i++ { log.Printf("start concurrent loop with %d coroutines\n", i) syn := make(chan error) + + start := time.Now() for j := 1; j <= i; j++ { go func() { syn <- putObj(buck, 1024*1024) }() } + errCount := 0 for j := 1; j <= i; j++ { cerr := <-syn if cerr != nil { + errCount += 1 log.Printf("%d/%d failed with %s\n", j, i, cerr) } } + elapsed := time.Since(start) + fmt.Printf("%d,%d,%v,%v\n", i, i - errCount, elapsed.Nanoseconds(), elapsed.Nanoseconds() / int64(i)) log.Printf("done, %d coroutines returned\n", i) } - log.Println("done") + log.Println("bench done") } diff --git a/scenarios/.garage-s3lat.swo b/scenarios/.garage-s3lat.swo deleted file mode 100644 index ec47fd0a4ecd164aee5fbcf1c11d0c19db31e448..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 12288 zcmeI&zfRjw6bA4UR>U9CsZ(#l0ur$USr8H%3l$w0+SPLGBC zLEnZ2iJ75OPl7W9RqmYVv-Ii8KK8NCZ;NsVy>FLa)M;=+a_kaa{b?t`rx*Ho-J z>-swOjjd6H00f!@N}qL4x2S(|+?(CD-)XB4dtaNLKn(&AfB*y_009U<00IzLGXXzo z(SyviQO~tiudR1$eToGF5P$##AOHafKmY;|fB*y_0D%=0h*P4U+eA;2+5i8G-~Z1$ zM874El3$V^lBpz;e3o2D4keqC*TwTII6poa0uX=z1Rwwb2tWV=5P$##)<(d&Q7qfj z18s)~ok7K&LsD|Q?JW;dcD}IH!O}%nnIy6%y5TBH?bIw+Q=VvBMVZywPNl@!@!5ZS zrmWfXtYzJ8zN