forked from Deuxfleurs/mknet
Update s3concurrent
This commit is contained in:
parent
12764a020a
commit
1ea2244c8c
4 changed files with 35 additions and 1 deletions
|
@ -30,6 +30,7 @@ source .venv/bin/activate
|
||||||
## Topologies
|
## Topologies
|
||||||
|
|
||||||
All 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/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/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
|
- `./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:
|
All scenarios:
|
||||||
- `./scenarios/garage-s3lat [garage-v0.7|garage-v0.8]` - Run s3lat on Garage
|
- `./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/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,
|
*Scenarios take optional flavors as input that modulate their behavioir. Passing them is not mandatory,
|
||||||
|
|
|
@ -3,6 +3,8 @@ package main
|
||||||
import (
|
import (
|
||||||
"context"
|
"context"
|
||||||
"crypto/tls"
|
"crypto/tls"
|
||||||
|
"fmt"
|
||||||
|
"time"
|
||||||
"io"
|
"io"
|
||||||
"log"
|
"log"
|
||||||
"math/rand"
|
"math/rand"
|
||||||
|
@ -99,24 +101,32 @@ func main() {
|
||||||
}
|
}
|
||||||
log.Printf("created bucket %s\n", buck)
|
log.Printf("created bucket %s\n", buck)
|
||||||
|
|
||||||
|
fmt.Println("sent,success,elapsed,elapsed_per_req")
|
||||||
|
|
||||||
// Send to bucket
|
// Send to bucket
|
||||||
for i := 1; i <= 16; i++ {
|
for i := 1; i <= 16; i++ {
|
||||||
log.Printf("start concurrent loop with %d coroutines\n", i)
|
log.Printf("start concurrent loop with %d coroutines\n", i)
|
||||||
syn := make(chan error)
|
syn := make(chan error)
|
||||||
|
|
||||||
|
start := time.Now()
|
||||||
for j := 1; j <= i; j++ {
|
for j := 1; j <= i; j++ {
|
||||||
go func() {
|
go func() {
|
||||||
syn <- putObj(buck, 1024*1024)
|
syn <- putObj(buck, 1024*1024)
|
||||||
}()
|
}()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
errCount := 0
|
||||||
for j := 1; j <= i; j++ {
|
for j := 1; j <= i; j++ {
|
||||||
cerr := <-syn
|
cerr := <-syn
|
||||||
if cerr != nil {
|
if cerr != nil {
|
||||||
|
errCount += 1
|
||||||
log.Printf("%d/%d failed with %s\n", j, i, cerr)
|
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.Printf("done, %d coroutines returned\n", i)
|
||||||
}
|
}
|
||||||
|
|
||||||
log.Println("done")
|
log.Println("bench done")
|
||||||
}
|
}
|
||||||
|
|
Binary file not shown.
22
topo/dc.yml
Normal file
22
topo/dc.yml
Normal file
|
@ -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
|
Loading…
Reference in a new issue