What's the best way to make my k8s deployment faster?

So I created this k8s cluster and launched it on GCP GKE and it’s running but it’s quite slow. It’s a web app and the app is loading rather slowly. How do I make it load faster? Do I scale horizontally with more nodes is there something else that has to be done? And whatever that has to be done, how to do it?

Currently total nodes 3, total vCPUs 6 and total memory 12 GB.

Depends on why it’s slow. You need to drill down to where your bottle neck is and then solve for the bottle neck.

You need Application Performance Monitoring (APM) tooling to really be effective at debugging your application.

Some of the questions you aim to answer are like the following.

  • Where is my app spending the most of it’s time?
  • Why is my app spending time doing ${thing}?
  • How long is my app waiting on other resources and what are those resources?
  • Have I tuned any memory and process settings for the language my app is using correctly?

Scaling doesn’t magically fix problems. Scaling is a necessity for certain types of problems, like reaching to limits of the CPU and memory resources available on your host node.

suppose I simply want to increase the number of nodes. How do I do that in google cloud console?

It’s important to figure out if you even need more nodes. You don’t want to waste your money on resources you don’t need. Take a look at kubectl top nodes to see if you even need to scale the nodes.

How to resize your cluster in GKE is documented here and scaling your deployments and statefulsets is explained here