Issues with balancing the load for gRPC using tyk oss gateway

Hi,
I am using tyk oss gateway for all our gRPC services. I have configure gRPC passthrough proxy (gRPC Proxy)
The API configuration is as follows:

{
  "name": "<api_name>",
  "api_id": "<api_id>",
  "org_id": "<org_id>",
  "proxy": {
    "listen_path": "/",
    "target_url": "h2c://<k8s_service_endpoint>:9090",
    "strip_listen_path": false
  },
  "use_keyless": false,
  "version_data": {
    "not_versioned": true,
    "default_version": "",
    "versions": {
      "Default": {
        "name": "Default"
      }
    }
  },
  "active": true,
  "definition": {
    "location": "header",
    "key": "version"
  },
  "auth": {
    "auth_header_name": "authorization"
  }
}

As seen we are proxying the request to k8s service endpoint.

I am having issues in load balacing the requests. On doing some perf tests, we are observing that the requests when going through tyk is getting distributed only to 2 downstream pods of service even though we have more 3 running relicas. Increasing the service replicas to 4-5 still distributes it to only 2 pods.

I tried bypassing the tyk by directly accessing the k8s service. In this case the load is distributed across all pods.

Even though the target url is h2c://<k8s_service_endpoint>:9090, why isn’t k8s balacing the load? Do we need to enable anything specific on tyk for balancing the load ?

I can see there is a specific config to enable load balancing at Proxy Transport Settings. Is this still relevant?

How tyk have its own load balancing module to distribute the load ? If yes, does it check for some uptime etc on each pod where it wants to distribute the load ?

What kind of load balancer/load balancing algorithm do you have?

No. Managing the load and performance should be handled by the upstream or proxy

Try restarting the gateway and see if it makes things better. If no changes occur then try disabling keep alives

Yes, but this is if you don’t have a proxy or load balancing service.

You can find more info in our docs about load balancing, service discovery and uptime tests