# NGINX Ingress adds 1500ms to response time

**URL:** <https://discuss.kubernetes.io/t/nginx-ingress-adds-1500ms-to-response-time/21227>\
**Category:** General Discussions\
**Tags:** development\
**Created:** [September 8, 2022, 5:22pm UTC](https://discuss.kubernetes.io/t/nginx-ingress-adds-1500ms-to-response-time/21227 "2022-09-08T17:22:04Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Flinty916](https://sea2.discourse-cdn.com/flex016/user_avatar/discuss.kubernetes.io/flinty916/32/10784_2.png) [@Flinty916](https://discuss.kubernetes.io/u/Flinty916)\
**Post date:** [September 8, 2022, 5:22pm UTC](https://discuss.kubernetes.io/t/nginx-ingress-adds-1500ms-to-response-time/21227/1 "2022-09-08T17:22:04Z")

</div>

Hey, looking to get some feedback/assistance, as I’m new to Kube and having a tough time getting my application deployed properly. For context, I’m running a PHP (laravel) app, and on a conventional web server I get response times of 100ms and below, and now I’m getting 2s+

### Cluster information:

Kubernetes version: 1.25.0  
Cloud being used: Hetzner Cloud  
Installation method: Manual  
Host OS: Ubuntu 20.04  
PHP: 8.1.9  
Ingress Controller: Nginx

I have a deployment of 2 replicas, combined by a Cluster IP service (8080/TCP), and an ingress that maps to the service (all requests to [beta.mydomain.com](http://beta.mydomain.com) go to api-service).

When I run a curl command from my master node to the api’s pod, using the private IP address, I get a response time of 500ms (poor image performance, working on it, but 500ms is what I expect currently). However when I run a curl command outside the cluster using the domain, it adds an additional 1500ms~ to the response time.

Here is how I setup the nginx controller:

```auto
helm upgrade --install ingress-nginx ingress-nginx/ingress-nginx -f ingress-values.yaml --namespace ingress-nginx --create-namespace

```

ingress-values.yaml:

```auto
controller:
  replicaCount: 1
  service:
    enabled: true
    type: LoadBalancer
    annotations:
      load-balancer.hetzner.cloud/location: hel1
  resources:
    limits:
      cpu: "800m"
      memory: "2096Mi"
    requests:
      cpu: "800m"
      memory: "2096Mi"
  ingressClassResource:
    name: nginx
    enabled: true
    default: true
    controllerValue: "k8s.io/ingress-nginx"
  ingressClassByName: true

```

And here is my api ingress yaml:

````auto
apiVersion: networking.k8s.io/v1
kind: Ingress
metadata:
  annotations:
    kubernetes.io/ingress.class: nginx
    cert-manager.io/cluster-issuer: letsencrypt-production
  name: uc-api-ingress
spec:
  rules:
    - host: beta.mydomain.com
      http:
        paths:
          - path: /
            pathType: Prefix
            backend:
              service:
                name: uc-api-service
                port:
                  number: 8080
  tls:
    - hosts:
        - beta.mydomain.com
      secretName: beta.mydomain.com
``` If you need any additional information, just ask. I've been struggling to figure this out, and really would appreciate any help.

Thanks!
````

---

<div class="post-metadata">

**Author:** ![Theog75](https://sea2.discourse-cdn.com/flex016/user_avatar/discuss.kubernetes.io/theog75/32/9241_2.png) [@Theog75](https://discuss.kubernetes.io/u/Theog75)\
**Post date:** [September 10, 2022, 1:48pm UTC](https://discuss.kubernetes.io/t/nginx-ingress-adds-1500ms-to-response-time/21227/2 "2022-09-10T13:48:12Z")

</div>

if you can share a bit more information:

- what is the BODY size for this request?
- how many concurrent requests are you doing or is it just a single request?
- Do you have redirects in the HTTP request ?

there are several places I would look into in addition that are no HTTP request related:

- what is the cpu consumption of the ingress Pods? is it throttling? are there non-voluntary context switches? (you can user RTM metrics tools such [Sosivio](https://docs.sosiv.io/pods/) as an examine to check this)
- if **your** Pod throttling?

further deeper issues might be differences in MTU between the client performing the request and the ingress Pod and routing loops, but I wouldn’t check that until you check the above mentioned issues.
