Loui5
Loui5

Reputation: 94

How to ensure service in cloud platform do not down

I do a load test recently. I found that the pod in cloud will crash down when large amount of request.

The autoscale speed is not fast enough and the service will not available for a while. Should I increase the the minimum pod number or increase the resources of the pod?

Upvotes: 0

Views: 46

Answers (1)

RammusXu
RammusXu

Reputation: 1260

Should I increase the the minimum pod number or increase the resources of the pod?

Sure, it helped. I would add replicas first and then increase limit.cpu

Increase request.cpu is only useful when node out of resource. It guarantee the minimum cpu your pod can get.

There are a lot of things you can do

  1. CDN in front of your service(pods), if your pod most time respond same result.
  2. HPA: You need set limit.cpu greater than request.cpu. Let HPA have time to active.
  3. Minimize your docker image size. It's can download fast means launch fast to handle incoming requests.
  4. podAntiAffinity: Make sure your pods are not in same node.

      affinity:
        podAntiAffinity:
          requiredDuringSchedulingIgnoredDuringExecution:
          - labelSelector:
              matchExpressions:
              - key: app
                operator: In
                values:
                - web-store
            topologyKey: "kubernetes.io/hostname"
        podAffinity:
          requiredDuringSchedulingIgnoredDuringExecution:
          - labelSelector:
              matchExpressions:
              - key: app
                operator: In
                values:
                - store
            topologyKey: "kubernetes.io/hostname"

Upvotes: 2

Related Questions