Add support for multi DC

This commit is contained in:
Quentin 2021-12-13 11:30:57 +01:00
parent ebce30a1f2
commit f8044789e0
Signed by: quentin
GPG key ID: A98E9B769E4FF428
2 changed files with 16 additions and 4 deletions

View file

@ -31,12 +31,17 @@ if (!file.exists("~/go/bin/s3lat")) {
system("go install git.deuxfleurs.fr/quentin/s3lat@latest") system("go install git.deuxfleurs.fr/quentin/s3lat@latest")
} }
Sys.getenv("MKNET_DC") -> mknet_dc
if (mknet_dc == "") {
"./mknet/single-dc.yml" -> mknet_dc
}
if (!file.exists("50ms.garage.csv")) { if (!file.exists("50ms.garage.csv")) {
system("rm -fr /tmp/garage-testnet") system("rm -fr /tmp/garage-testnet")
if (file.exists(".current_state.yml")) { if (file.exists(".current_state.yml")) {
system("mknet destroy") system("mknet destroy")
} }
system("mknet create ./mknet/single-dc.yml") system(paste("mknet create", mknet_dc))
system("mknet run-all ./mknet/deploy_garage.sh") system("mknet run-all ./mknet/deploy_garage.sh")
system("mknet run dc1:dc1s1 ./mknet/bench_garage.sh") system("mknet run dc1:dc1s1 ./mknet/bench_garage.sh")
system("mknet destroy") system("mknet destroy")
@ -49,7 +54,7 @@ if (!file.exists("50ms.minio.csv")) {
if (file.exists(".current_state.yml")) { if (file.exists(".current_state.yml")) {
system("mknet destroy") system("mknet destroy")
} }
system("mknet create ./mknet/single-dc.yml") system(paste("mknet create", mknet_dc))
system("mknet run-all ./mknet/deploy_minio.py") system("mknet run-all ./mknet/deploy_minio.py")
system("mknet run dc1:dc1s1 ./mknet/bench_minio.sh") system("mknet run dc1:dc1s1 ./mknet/bench_minio.sh")
system("mknet destroy") system("mknet destroy")
@ -63,6 +68,13 @@ bind_rows(a,b) %>% group_by(daemon,endpoint) %>% summarise(
time_min = min(nanoseconds) / 1000 / 1000 time_min = min(nanoseconds) / 1000 / 1000
) -> c ) -> c
st <- "100 measurements, 5 nodes, 100ms RTT + 20ms jitter between nodes\nno contention: latency is due to intra-cluster communications\ncolored bar = mean latency, error bar = min and max latency"
if (mknet_dc == "./mknet/multi-dc.yml") {
st <- "100 measurements, 6 nodes in 3 DC (2 nodes/DC), 100ms RTT + 20ms jitter between DC\nno contention: latency is due to intra-cluster communications\ncolored bar = mean latency, error bar = min and max latency"
}
ggplot(c, aes(x=endpoint,y=time_mean,fill=daemon,ymin=time_min,ymax=time_max)) + ggplot(c, aes(x=endpoint,y=time_mean,fill=daemon,ymin=time_min,ymax=time_max)) +
geom_bar(stat="identity", position=position_dodge(),color="black") + geom_bar(stat="identity", position=position_dodge(),color="black") +
geom_errorbar(position=position_dodge(.9),width=.2) + geom_errorbar(position=position_dodge(.9),width=.2) +
@ -74,7 +86,7 @@ ggplot(c, aes(x=endpoint,y=time_mean,fill=daemon,ymin=time_min,ymax=time_max)) +
fill="Daemon", fill="Daemon",
caption="Get the code to reproduce this graph at https://git.deuxfleurs.fr/quentin/benchmarks", caption="Get the code to reproduce this graph at https://git.deuxfleurs.fr/quentin/benchmarks",
title="S3 endpoint latency in a simulated geo-distributed cluster", title="S3 endpoint latency in a simulated geo-distributed cluster",
subtitle="100 measurements, 5 nodes, 100ms RTT + 20ms jitter between nodes\nno contention: latency is due to intra-cluster communications\ncolored bar = mean latency, error bar = min and max") + subtitle=st) +
theme_classic() + theme_classic() +
theme(legend.position = c(.8, .3)) theme(legend.position = c(.8, .3))

View file

@ -19,7 +19,7 @@ def leader():
sock.bind(UNIX_SOCK) sock.bind(UNIX_SOCK)
sock.listen() sock.listen()
n_serv = int(os.environ['SIZE']) n_serv = int(os.environ['SERVER_COUNT'])
fl = [ co for co, addr in [ sock.accept() for i in range(n_serv - 1) ]] fl = [ co for co, addr in [ sock.accept() for i in range(n_serv - 1) ]]
identities = [ json.loads(co.makefile().readline()) for co in fl ] + [ { "ip": os.environ['IP'], "path": make_data() } ] identities = [ json.loads(co.makefile().readline()) for co in fl ] + [ { "ip": os.environ['IP'], "path": make_data() } ]