Traefik adds huge overhead to the requests in Kubernetes

6/3/2019

I am using Traefik as the ingress controller for my Kubernetes setup. I decided to run some performance test for my application but I faced a huge difference when I sent the requests through the Traefik.

The test consists of sending 10K request in parallel and the application returned the compiled result and based on the logs of my application it needs around 5 milliseconds to process one request. The results for the performance test are as below:

  • Native application: Execution time in milliseconds: 61062
  • Application on Kubernetes (without going through Traefik and just using its IP): Execution time in milliseconds: 62337
  • Application on Kubernetes and using Traefik: Execution time in milliseconds: 159499

My question is why this huge difference exists and is there a way to reduce it (except adding more replicas).

I am using these yaml files for setting up Traefik:

https://raw.githubusercontent.com/containous/traefik/v1.7/examples/k8s/traefik-rbac.yaml
https://raw.githubusercontent.com/containous/traefik/v1.7/examples/k8s/traefik-ds.yaml
-- AVarf
kubernetes
kubernetes-ingress
load-balancing
performance
traefik

1 Answer

6/4/2019

I tried Ambassador as my API gateway in kubernetes and its result was much better than Traefik and very close to using the IP of the container (63394 milliseconds). Obviously, Traefik is not as good as people think.

-- AVarf
Source: StackOverflow