diff options
author | Quentin Dufour <quentin@deuxfleurs.fr> | 2022-09-19 12:37:25 +0200 |
---|---|---|
committer | Quentin Dufour <quentin@deuxfleurs.fr> | 2022-09-19 12:37:25 +0200 |
commit | 1ea2244c8c207a195d95a2c0f85b8a9a4e5ee9b1 (patch) | |
tree | 1308b1ab7d3774abf92ee44d39dcdae02446157b | |
parent | 12764a020a4171eee738b1e2a8a3d5340f4da7a1 (diff) | |
download | mknet-1ea2244c8c207a195d95a2c0f85b8a9a4e5ee9b1.tar.gz mknet-1ea2244c8c207a195d95a2c0f85b8a9a4e5ee9b1.zip |
Update s3concurrent
-rw-r--r-- | README.md | 2 | ||||
-rw-r--r-- | benchmarks/s3concurrent/main.go | 12 | ||||
-rw-r--r-- | scenarios/.garage-s3lat.swo | bin | 12288 -> 0 bytes | |||
-rw-r--r-- | topo/dc.yml | 22 |
4 files changed, 35 insertions, 1 deletions
@@ -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 Binary files differdeleted file mode 100644 index ec47fd0..0000000 --- a/scenarios/.garage-s3lat.swo +++ /dev/null diff --git a/topo/dc.yml b/topo/dc.yml new file mode 100644 index 0000000..6017e97 --- /dev/null +++ b/topo/dc.yml @@ -0,0 +1,22 @@ +links: + - &1000 + bandwidth: 1000M + latency: 1ms + +servers: + - name: node1 + <<: *1000 + - name: node2 + <<: *1000 + - name: node3 + <<: *1000 + +global: + subnet: + base: 'fc00:9a7a:9e::' + local: 64 + zone: 16 + latency-offset: 3ms + upstream: + ip: fc00:9a7a:9e:ffff:ffff:ffff:ffff:ffff + conn: *1000 |