Kubernetes: Cant Increase Req/Sec with more Nodes

12/22/2019

I created simple nodejs express application, it just listen single get port and returns hello word string.

Then i deployed that application on a kubernete cluster with 1 node with 4vCpu 8GB Ram. Routed all traffic to app with nginx ingress controller.

So after completed deployment, i performed simple http load test. Results was 70 - 100 req/sec. I tried to increase replica set to 6 but results was still same. I also tried to specify resource limits but nothing changed.

Lastly i added 2 more node to pool with 4vCpu 8GB Ram.

After that i performed load test again but results was still same. Total of 3 nodes with 12vCpu and 24GB Ram, it can barely handle 80 Req/Sec.

Results form load testing.

12 threads and 400 connections

Latency 423.68ms 335.38ms 1.97s 84.88%

Req/Sec 76.58 34.13 212.00 72.37%

4457 requests in 5.08s, 1.14MB read

Probably i am doing something wrong but i couldn't figure out.

This is my deployment and service yaml file.

apiVersion: v1
kind: Service
metadata:
  name: app-3
spec:
  type: ClusterIP
  ports:
    - port: 80
      targetPort: 8080
  selector:
    app: app-3
---
apiVersion: apps/v1
kind: Deployment
metadata:
  name: app-3
spec:
  replicas: 6
  selector:
    matchLabels:
      app: app-3
  template:
    metadata:
      labels:
        app: app-3
    spec:
      containers:
        - name: app-3-name
          image: s1nc4p/node:v22
          ports:
            - containerPort: 8080
          resources:
            requests:
              memory: "1024Mi"
              cpu: "1000m"
            limits:
              memory: "1024Mi"
              cpu: "1000m"

This is ingress service yaml file.

kind: Service
apiVersion: v1
metadata:
  name: ingress-nginx
  labels:
    app.kubernetes.io/name: ingress-nginx
    app.kubernetes.io/part-of: ingress-nginx
spec:
  externalTrafficPolicy: Local
  type: LoadBalancer
  selector:
    app.kubernetes.io/name: ingress-nginx
    app.kubernetes.io/part-of: ingress-nginx
  ports:
    - name: http
      port: 80
      protocol: TCP

And this is ingress file.

apiVersion: networking.k8s.io/v1beta1
kind: Ingress
metadata:
  name: hello-kubernetes-ingress
  annotations:
    kubernetes.io/ingress.class: nginx
    nginx.ingress.kubernetes.io/rewrite-target: /$1
spec:
  rules:
    - host: kkk.storadewebservices.com
      http:
        paths:
          - path: '/'
            backend:
              serviceName: app-3
              servicePort: 80
-- Taha Ergun
docker
kubernetes
load-testing
nginx-ingress
performance

0 Answers