Grafana packages a pre-compiled dashboard for OpenFaaS to show metrics like throughput and latency.
-
Apply the Deployment for Grafana
kubectl apply -f ./grafana/deployment.yaml
-
Port-forward the dasbhoard to your local computer:
kubectl port-forward deploy/grafana -n openfaas 3000:3000
-
View the dashboard when needed with:
http://127.0.0.1:3000/dashboard/db/openfaas?refresh=5s&orgId=1
The credentials are: admin/admin.
Below is a screenshot showing auto-scaling of the "echo-fn" in response to load being generated by the hey
load-generation tool.
You can run this lab yourself, but this is optional.
Download (hey):
For MacOS:
curl -SLsf https://storage.googleapis.com/hey-release/hey_darwin_amd64 > hey
chmod +x hey
sudo mv hey /usr/local/bin
For Linux:
curl -SLsf https://storage.googleapis.com/hey-release/hey_linux_amd64 > hey
chmod +x hey
sudo mv hey /usr/local/bin
Run a load-test:
git clone https://github.com/alexellis/echo-fn
cd echo-fn
export OPENFAAS_URL=http://$PUBLIC_IP:31112
faas-cli deploy
Edit stack.yml
, replace com.openfaas.scale.max: 1
with com.openfaas.scale.max: 20
Now run hey:
hey -c 10 -z 2m $OPENFAAS_URL/go-echo
You should see very low latency as the test runs for 2 minutes with 10 concurrent connections. View the Grafana dashboard for the visualization.