A request through traefik is much slower than through svc

Requests/sec: 3795.83 // through traefik
Requests/sec: 31458.42 // through svc
It's an order of magnitude worse, how can I tune it?

# cat nginx_httproute.yaml 
---
apiVersion: networking.x-k8s.io/v1alpha1
kind: HTTPRoute
metadata:
  name: nginx-httproute
  namespace: monitoring
  labels:
    app: traefik
spec:
  hostnames:
    - "nginx.yff.com"
  rules:
    - matches:
        - path:
            type: Prefix
            value: /
      forwardTo:
        - serviceName: nginx-service
          port: 80
          weight: 1

 //  through traefik
[root@master01 traefik]# wrk -t10 -c100 -d30s --latency  http://nginx.yff.com
Running 30s test @ http://nginx.yff.com
  10 threads and 100 connections
  Thread Stats   Avg      Stdev     Max   +/- Stdev
    Latency    32.27ms   30.07ms 179.12ms   78.22%
    Req/Sec   381.35     62.45     0.89k    71.70%
  Latency Distribution
     50%   14.38ms
     75%   56.65ms
     90%   79.94ms
     99%   92.09ms
  114025 requests in 30.04s, 89.82MB read
Requests/sec:   3795.83
Transfer/sec:      2.99MB

// through svc
[root@master01 traefik]# wrk -t10 -c100 -d30s --latency  http://10.100.117.75
Running 30s test @ http://10.100.117.75
  10 threads and 100 connections
  Thread Stats   Avg      Stdev     Max   +/- Stdev
    Latency     3.48ms    3.72ms 110.47ms   94.58%
    Req/Sec     3.16k   400.55     4.53k    73.87%
  Latency Distribution
     50%    2.68ms
     75%    3.65ms
     90%    5.68ms
     99%   12.30ms
  946598 requests in 30.09s, 767.33MB read
Requests/sec:  31458.42
Transfer/sec:     25.50MB

It's an order of magnitude worse, how can I tune it?

What does nginx.yff.com resolve as? An internal ip address(RFC1918 range) or an external ip address ?

internal ip address。

[root@master01 test]# cat /etc/hosts
127.0.0.1 localhost localhost.localdomain localhost4 localhost4.localdomain4
::1 localhost localhost.localdomain localhost6 localhost6.localdomain6
10.9.68.231 master01
10.9.68.232 master02 ceph-admin
10.9.68.233 master03 mon01 stor01
10.9.68.234 node01 mon02 stor02 mgr01
10.9.68.235 node02 mon03 stor03
10.9.68.236 node03 stor04

10.9.68.234 nginx.yff.com

[root@master01 test]# curl http://nginx.yff.com

Welcome to nginx!

This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.