<p>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.</p>

<p>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:</p>

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

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

<p>I am using these yaml files for setting up Traefik:</p>

<pre><code>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
</code></pre>

AVarf
<p>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.</p>
