Hi all. Several days ago, I tried to benchmark Linkerd with test tools like wrk
or webbench
. However, the results turned out that Linkerd performed terribly when deployed with high concurrent applications(e.g. Nginx).
I’m not sure if deployed or configured Linkerd in a proper way, or if I misused the test tools. Since discourse is a better place for leading to a subject to discuss, I’d like to post my test here. Hope someone could help me out.
Topology
I setted up a three-node Kubernetes cluster, each with label: membership=master
, membership=slave1
, membership=slave2
.
Then, I deployed an nginx-server
service on master
, a wrk
service on slave1
, a wrk-l5d
(with http_proxy
configured) service on slave2
.
What I tried to compare/test is the throughput(requests per second) of two different routes, Non-Linkerd and Linkerd (i.e.wrk -> nginx
vs. wrk -> l5d -> l5d -> nginx
)
Deployment
Seems new users cannot upload files, so I have to share them by Google drive. Sorry.
- Linkerd deployment: https://drive.google.com/open?id=0B2FyytRtzjMKNEt5Ri0tWldndFU
- Wrk-l5d deployment: https://drive.google.com/open?id=0B2FyytRtzjMKcDRJODAtb2hMaEE
Test
- First, execute a shell in
wrk
pod, and start testing with a script:
#!/bin/sh
base=200
for i in `seq 10`; do
conn=`expr $base \* $i`
wrk -t8 -c$conn -d100s --latency http://nginx-server
echo ""
sleep 20
done
- Next, execute a shell in
wrk-l5d
pod, and start testing with another script:
#!/bin/sh
base=200
for i in `seq 10`; do
conn=`expr $base \* $i`
wrk -t8 -c$conn -d100s --latency -s proxy.lua http://$http_proxy
echo ""
sleep 20
done
For proxy.lua
:
local connected = false
local host = "nginx-server"
local path = "/"
local url = "http://" .. host .. path
wrk.headers["Host"] = host
request = function()
if not connected then
connected = true
return wrk.format("CONNECT", host)
end
return wrk.format("GET", url)
end
- And finally, the results turned out that,
wrk -> nginx
had a throughput of almost30000 rps
, whilewrk -> l5d -> l5d -> nginx
got only2300 rps
.
Some details
- Kubernetes version
Client Version: version.Info{Major:"1", Minor:"6", GitVersion:"v1.6.4", GitCommit:"d6f433224538d4f9ca2f7ae19b252e6fcb66a3ae", GitTreeState:"clean", BuildDate:"2017-05-19T18:44:27Z", GoVersion:"go1.7.5", Compiler:"gc", Platform:"linux/amd64"}
Server Version: version.Info{Major:"1", Minor:"6", GitVersion:"v1.6.4", GitCommit:"d6f433224538d4f9ca2f7ae19b252e6fcb66a3ae", GitTreeState:"clean", BuildDate:"2017-05-19T18:33:17Z", GoVersion:"go1.7.5", Compiler:"gc", Platform:"linux/amd64"}
If there is something confusing in my post, or if I’ve missed some key, please feel free to point it out. Thanks.