Skip to content

Instantly share code, notes, and snippets.

@ashutosh-narkar
Last active November 8, 2019 21:28
Show Gist options
  • Save ashutosh-narkar/4f8fe0fe336e101679f2e406e4246acd to your computer and use it in GitHub Desktop.
Save ashutosh-narkar/4f8fe0fe336e101679f2e406e4246acd to your computer and use it in GitHub Desktop.
Bench test opa-istio
Minikube
========
minikube start --memory=16384 --cpus=4 --kubernetes-version=v1.14.2
1) Istio-Envoy-OPA
===================
$ GOMAXPROCS=1 go test -bench=BenchmarkHTTP -benchtime=5s
goos: darwin
goarch: amd64
pkg: github.com/open-policy-agent/opa-istio-plugin/stress-opa-istio
BenchmarkHTTPAlice200Productpage 300 29750581 ns/op
BenchmarkHTTPAlice403Products 2000 3582350 ns/op
BenchmarkHTTPBob200Productpage 200 38259359 ns/op
BenchmarkHTTPBob200Products 1000 7851462 ns/op
PASS
ok github.com/open-policy-agent/opa-istio-plugin/stress-opa-istio 38.570s
$ go test -bench=BenchmarkHTTP -benchtime=5s
goos: darwin
goarch: amd64
pkg: github.com/open-policy-agent/opa-istio-plugin/stress-opa-istio
BenchmarkHTTPAlice200Productpage-8 200 32304851 ns/op
BenchmarkHTTPAlice403Products-8 2000 3647870 ns/op
BenchmarkHTTPBob200Productpage-8 200 34267172 ns/op
BenchmarkHTTPBob200Products-8 1000 8020942 ns/op
PASS
ok github.com/open-policy-agent/opa-istio-plugin/stress-opa-istio 37.291s
2) Istio-Envoy (No OPA)
===============
$ GOMAXPROCS=1 go test -bench=BenchmarkHTTP -benchtime=5s
goos: darwin
goarch: amd64
pkg: github.com/open-policy-agent/opa-istio-plugin/stress-opa-istio
BenchmarkHTTPAlice200Productpage 100 70790817 ns/op
BenchmarkHTTPAlice200Products 1000 6186422 ns/op
BenchmarkHTTPBob200Productpage 100 77618371 ns/op
BenchmarkHTTPBob200Products 2000 5467033 ns/op
PASS
ok github.com/open-policy-agent/opa-istio-plugin/stress-opa-istio 33.393s
$ go test -bench=BenchmarkHTTP -benchtime=5s
goos: darwin
goarch: amd64
pkg: github.com/open-policy-agent/opa-istio-plugin/stress-opa-istio
BenchmarkHTTPAlice200Productpage-8 100 74774954 ns/op
BenchmarkHTTPAlice200Products-8 2000 4950356 ns/op
BenchmarkHTTPBob200Productpage-8 100 80223807 ns/op
BenchmarkHTTPBob200Products-8 2000 5143637 ns/op
PASS
ok github.com/open-policy-agent/opa-istio-plugin/stress-opa-istio 37.934s
3) Envoy-OPA
===================
$ GOMAXPROCS=1 go test -bench=BenchmarkHTTP -benchtime=5s
goos: darwin
goarch: amd64
pkg: github.com/open-policy-agent/opa-istio-plugin/stress-opa-istio
BenchmarkHTTPAlice200Productpage 300 20914328 ns/op
BenchmarkHTTPAlice403Products 3000 2262482 ns/op
BenchmarkHTTPBob200Productpage 300 20327249 ns/op
BenchmarkHTTPBob200Products 2000 4785230 ns/op
PASS
ok github.com/open-policy-agent/opa-istio-plugin/stress-opa-istio 38.279s
$ go test -bench=BenchmarkHTTP -benchtime=5s
goos: darwin
goarch: amd64
pkg: github.com/open-policy-agent/opa-istio-plugin/stress-opa-istio
BenchmarkHTTPAlice200Productpage-8 300 24531784 ns/op
BenchmarkHTTPAlice403Products-8 3000 2225177 ns/op
BenchmarkHTTPBob200Productpage-8 300 20638598 ns/op
BenchmarkHTTPBob200Products-8 2000 5093174 ns/op
PASS
ok github.com/open-policy-agent/opa-istio-plugin/stress-opa-istio 35.751s
4) Envoy (No OPA)
===============
$ GOMAXPROCS=1 go test -bench=BenchmarkHTTP -benchtime=5s
goos: darwin
goarch: amd64
pkg: github.com/open-policy-agent/opa-istio-plugin/stress-opa-istio
BenchmarkHTTPAlice200Productpage 300 30579783 ns/op
BenchmarkHTTPAlice200Products 5000 1825919 ns/op
BenchmarkHTTPBob200Productpage 200 33525588 ns/op
BenchmarkHTTPBob200Products 3000 2003540 ns/op
PASS
ok github.com/open-policy-agent/opa-istio-plugin/stress-opa-istio 41.247s
$ go test -bench=BenchmarkHTTP -benchtime=5s
goos: darwin
goarch: amd64
pkg: github.com/open-policy-agent/opa-istio-plugin/stress-opa-istio
BenchmarkHTTPAlice200Productpage-8 200 32900872 ns/op
BenchmarkHTTPAlice200Products-8 3000 1773436 ns/op
BenchmarkHTTPBob200Productpage-8 200 31273790 ns/op
BenchmarkHTTPBob200Products-8 3000 1896434 ns/op
PASS
ok github.com/open-policy-agent/opa-istio-plugin/stress-opa-istio 30.967s
5) Just the app on Kube (No OPA, No Envoy)
==========================================
$ GOMAXPROCS=1 go test -bench=BenchmarkHTTP -benchtime=5s
goos: darwin
goarch: amd64
pkg: github.com/open-policy-agent/opa-istio-plugin/stress-opa-istio
BenchmarkHTTPAlice200Productpage 500 11327637 ns/op
BenchmarkHTTPAlice200Products 5000 2277685 ns/op
BenchmarkHTTPBob200Productpage 1000 12799616 ns/op
BenchmarkHTTPBob200Products 5000 2200662 ns/op
PASS
ok github.com/open-policy-agent/opa-istio-plugin/stress-opa-istio 43.816s
$ go test -bench=BenchmarkHTTP -benchtime=5s
goos: darwin
goarch: amd64
pkg: github.com/open-policy-agent/opa-istio-plugin/stress-opa-istio
BenchmarkHTTPAlice200Productpage-8 1000 10499203 ns/op
BenchmarkHTTPAlice200Products-8 3000 2664225 ns/op
BenchmarkHTTPBob200Productpage-8 1000 11884495 ns/op
BenchmarkHTTPBob200Products-8 5000 2169404 ns/op
PASS
ok github.com/open-policy-agent/opa-istio-plugin/stress-opa-istio 43.645s
#############
New App
#############
Minikube
========
minikube start --memory=16384 --cpus=4 --kubernetes-version=v1.14.2
1) Envoy-OPA
=============
a) Allow GET, Deny POST
$ GOMAXPROCS=1 go test -bench=BenchmarkHTTP -benchtime=5s
goos: darwin
goarch: amd64
pkg: github.com/open-policy-agent/opa-istio-plugin/stress-opa-istio
BenchmarkHTTPAlice200GetPeople 2000 3037190 ns/op
BenchmarkHTTPAlice403PostPeople 3000 2828270 ns/op
PASS
ok github.com/open-policy-agent/opa-istio-plugin/stress-opa-istio 15.207s
$ go test -bench=BenchmarkHTTP -benchtime=5s
goos: darwin
goarch: amd64
pkg: github.com/open-policy-agent/opa-istio-plugin/stress-opa-istio
BenchmarkHTTPAlice200GetPeople-8 3000 3159617 ns/op
BenchmarkHTTPAlice403PostPeople-8 3000 3009164 ns/op
PASS
ok github.com/open-policy-agent/opa-istio-plugin/stress-opa-istio 19.090s
b) Deny GET, Deny POST
$ GOMAXPROCS=1 go test -bench=BenchmarkHTTP -benchtime=5s
goos: darwin
goarch: amd64
pkg: github.com/open-policy-agent/opa-istio-plugin/stress-opa-istio
BenchmarkHTTPAlice403GetPeople 3000 2247004 ns/op
BenchmarkHTTPAlice403PostPeople 2000 3002554 ns/op
PASS
ok github.com/open-policy-agent/opa-istio-plugin/stress-opa-istio 13.371s
$ go test -bench=BenchmarkHTTP -benchtime=5s
goos: darwin
goarch: amd64
pkg: github.com/open-policy-agent/opa-istio-plugin/stress-opa-istio
BenchmarkHTTPAlice403GetPeople-8 3000 2217520 ns/op
BenchmarkHTTPAlice403PostPeople-8 3000 2586875 ns/op
PASS
ok github.com/open-policy-agent/opa-istio-plugin/stress-opa-istio 14.948s
2) Envoy (No OPA)
===============
$ GOMAXPROCS=1 go test -bench=BenchmarkHTTP -benchtime=5s
goos: darwin
goarch: amd64
pkg: github.com/open-policy-agent/opa-istio-plugin/stress-opa-istio
BenchmarkHTTPAlice200GetPeople 1000 10298769 ns/op
BenchmarkHTTPAlice200PostPeople 10000 846541 ns/op
PASS
ok github.com/open-policy-agent/opa-istio-plugin/stress-opa-istio 19.988s
$ go test -bench=BenchmarkHTTP -benchtime=5s
goos: darwin
goarch: amd64
pkg: github.com/open-policy-agent/opa-istio-plugin/stress-opa-istio
BenchmarkHTTPAlice200GetPeople-8 500 13291208 ns/op
BenchmarkHTTPAlice200PostPeople-8 10000 1030762 ns/op
PASS
ok github.com/open-policy-agent/opa-istio-plugin/stress-opa-istio 23.024s
3) Just the app on Kube (No OPA, No Envoy)
==========================================
$ GOMAXPROCS=1 go test -bench=BenchmarkHTTP -benchtime=5s
goos: darwin
goarch: amd64
pkg: github.com/open-policy-agent/opa-istio-plugin/stress-opa-istio
BenchmarkHTTPAlice200GetPeople 1000 11288030 ns/op
BenchmarkHTTPAlice200PostPeople 10000 609368 ns/op
PASS
ok github.com/open-policy-agent/opa-istio-plugin/stress-opa-istio 18.552s
$ go test -bench=BenchmarkHTTP -benchtime=5s
goos: darwin
goarch: amd64
pkg: github.com/open-policy-agent/opa-istio-plugin/stress-opa-istio
BenchmarkHTTPAlice200GetPeople-8 1000 5890430 ns/op
BenchmarkHTTPAlice200PostPeople-8 10000 615723 ns/op
PASS
ok github.com/open-policy-agent/opa-istio-plugin/stress-opa-istio 12.760s
4) App running locally
=========================
$ GOMAXPROCS=1 go test -bench=BenchmarkHTTP -benchtime=5s
goos: darwin
goarch: amd64
pkg: github.com/open-policy-agent/opa-istio-plugin/stress-opa-istio
BenchmarkHTTPAlice200GetPeople 500 12408370 ns/op
BenchmarkHTTPAlice200PostPeople 10000 631767 ns/op
PASS
ok github.com/open-policy-agent/opa-istio-plugin/stress-opa-istio 16.361s
$ go test -bench=BenchmarkHTTP -benchtime=5s
goos: darwin
goarch: amd64
pkg: github.com/open-policy-agent/opa-istio-plugin/stress-opa-istio
BenchmarkHTTPAlice200GetPeople-8 2000 4780674 ns/op
BenchmarkHTTPAlice200PostPeople-8 10000 720196 ns/op
PASS
ok github.com/open-policy-agent/opa-istio-plugin/stress-opa-istio 17.427s
Minikube
========
minikube start
1) App running locally
=========================
$ GOMAXPROCS=1 go test -bench=BenchmarkHTTP -benchtime=5s
goos: darwin
goarch: amd64
pkg: github.com/open-policy-agent/opa-istio-plugin/stress-opa-istio
BenchmarkHTTPAlice200GetPeople 2000 3196214 ns/op
BenchmarkHTTPAlice200PostPeople 10000 643215 ns/op
PASS
ok github.com/open-policy-agent/opa-istio-plugin/stress-opa-istio 13.236s
$ go test -bench=BenchmarkHTTP -benchtime=5s
goos: darwin
goarch: amd64
pkg: github.com/open-policy-agent/opa-istio-plugin/stress-opa-istio
BenchmarkHTTPAlice200GetPeople-8 2000 4853904 ns/op
BenchmarkHTTPAlice200PostPeople-8 10000 726794 ns/op
PASS
ok github.com/open-policy-agent/opa-istio-plugin/stress-opa-istio 17.636s
2) Just the app on Kube (No OPA, No Envoy)
===========================================
$ GOMAXPROCS=1 go test -bench=BenchmarkHTTP -benchtime=5s
goos: darwin
goarch: amd64
pkg: github.com/open-policy-agent/opa-istio-plugin/stress-opa-istio
BenchmarkHTTPAlice200GetPeople 3000 2719077 ns/op
BenchmarkHTTPAlice200PostPeople 10000 541981 ns/op
PASS
ok github.com/open-policy-agent/opa-istio-plugin/stress-opa-istio 13.958s
$ go test -bench=BenchmarkHTTP -benchtime=5s
goos: darwin
goarch: amd64
pkg: github.com/open-policy-agent/opa-istio-plugin/stress-opa-istio
BenchmarkHTTPAlice200GetPeople-8 2000 8896956 ns/op
BenchmarkHTTPAlice200PostPeople-8 10000 791666 ns/op
PASS
ok github.com/open-policy-agent/opa-istio-plugin/stress-opa-istio 26.351s
3) Envoy (No OPA)
==================
1) Envoy-OPA
=============
a) Allow GET, Deny POST
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment