Fortio is a load testing tool that consists of:
- A server
- A client
- A GUI
- A load testing library
Fortio runs a specified number of queries per second (qps), records a histogram of execution time and calculates percentiles. It can run for a set duration, for a fixed number of calls, or until interrupted.
Istio Pilot provides pprof http endpoints for profiling the application. The --profile
flag is used to enable Pilot's pprof http endpoints. This flag is enabled by default.
-
You must have a functioning Istio mesh running on a Kubernetes cluster.
-
Go tools must be installed on your client.
Create an Ingress for the Istio Pilot service. Note: Ingress resources require an Ingress Controller.
Run the fortio container, specifying a host:port pair for -http-port
:
$ sudo docker run -d --net host danehans/fortio:listen_addr server -http-port 10.138.0.2:8080
d490e515f3bd34b52b1a67b8870f6d99637573a6b30eee9fc10c32a61c9b2d3a
$ sudo docker ps
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
d490e515f3bd danehans/fortio:listen_addr "/usr/local/bin/fort…" 8 seconds ago Up 6 seconds musing_almeida
apiVersion: extensions/v1beta1 | |
kind: Ingress | |
metadata: | |
name: secure-gateway | |
annotations: | |
kubernetes.io/ingress.class: "istio" | |
spec: | |
tls: | |
# TLS configuration. Currently the Ingress only supports a single TLS port, 443. | |
# If multiple members of this list specify different hosts, they will be multiplexed |
This guide provides step-by-step instructions for using the setup_perf_cluster.sh
load testing script.
The script deploys a GKE cluster, an Istio mesh, a GCE VM and runs Fortio
on the VM and within the mesh. Fortio is used to perform load testing.
$ git clone https://github.com/istio/istio.git && cd istio
https://kubernetes.io/docs/tasks/tools/install-kubectl/
Note: You can also use gcloud component install kubelet
gcloud container clusters create istio --num-nodes=1 --machine-type=n1-standard-4 --no-enable-legacy-authorization --enable-kubernetes-alpha
gcloud container clusters get-credentials istio
- Generate TLS assets (openssl):
$ openssl req -x509 -nodes -days 365 -newkey rsa:2048 -keyout /tmp/tls.key -out /tmp/tls.crt -subj "/CN=foo.bar.com"
- Create a secret object that uses the TLS assets. Note: The name must be
istio-ingress-certs
:
$ kubectl create -n istio-system secret tls istio-ingress-certs --key /tmp/tls.key --cert /tmp/tls.crt
// You have to set logging level to debug in envoy: | |
// kubectl exec -it reviews-v3-77dfb9f77d-v7sj9 -c istio-proxy /bin/bash | |
// curl http://127.0.0.1:15000/logging?level=debug | |
// kubectl logs reviews-v3-77dfb9f77d-v7sj9 -c istio-proxy > proxy.log | |
[2017-12-14 18:37:32.488][2177][info][main] external/envoy/source/server/connection_handler_impl.cc:129] [C44] new connection | |
[2017-12-14 18:37:32.489][2177][debug][http] external/envoy/source/common/http/conn_manager_impl.cc:181] [C44] new stream | |
[2017-12-14 18:37:32.489][2177][debug][http] src/envoy/mixer/http_filter.cc:324] Called Mixer::Instance : Instance | |
[2017-12-14 18:37:32.489][2177][debug][http] src/envoy/mixer/http_filter.cc:383] Called Mixer::Instance : setDecoderFilterCallbacks | |
[2017-12-14 18:37:32.489][2177][debug][http] external/envoy/source/common/http/conn_manager_impl.cc:439] [C44][S6253685066161528132] request headers complete (end_stream=true): | |
[2017-12-14 18:37:32.489][2177][debug][http] external/envoy/source/common/http/conn_manager_impl.cc:444] |
# curl http://127.0.0.1:15000/clusters | |
<SNIP> | |
out.4bdc5a0e59af7107a7189467360a720381024b5c::default_priority::max_connections::1024 | |
out.4bdc5a0e59af7107a7189467360a720381024b5c::default_priority::max_pending_requests::1024 | |
out.4bdc5a0e59af7107a7189467360a720381024b5c::default_priority::max_requests::1024 | |
out.4bdc5a0e59af7107a7189467360a720381024b5c::default_priority::max_retries::3 | |
out.4bdc5a0e59af7107a7189467360a720381024b5c::high_priority::max_connections::1024 | |
out.4bdc5a0e59af7107a7189467360a720381024b5c::high_priority::max_pending_requests::1024 | |
out.4bdc5a0e59af7107a7189467360a720381024b5c::high_priority::max_requests::1024 | |
out.4bdc5a0e59af7107a7189467360a720381024b5c::high_priority::max_retries::3 |