> For the complete documentation index, see [llms.txt](https://docs.perfectscale.io/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.perfectscale.io/2.0-self-hosted-or-perfectscale-documentation/product-overview/understanding-k8s-scaling.md).

# Understanding K8s scaling

PerfectScale's agent (stateless deployment, one per K8s cluster) continuously observes scaling, resiliency, and performance metrics across the entire K8s stack, including workloads, infrastructure, etc.

The agent is constantly looking for two types of issues:

* Risky under-provisioning or missing definitions that could harm uptime and SLA.
* Over-provisioning, where compute resources are constantly underutilized, results in waste and excessive CO2 emission.

Those issues could affect Vertical Scaling, Horizontal Scaling, or both.

## Vertical scaling&#x20;

Vertical scaling refers to the amount of resources (such as CPU and memory) allocated to a particular instance like Container, Pod, Node, etc. When we scale up or down vertically, we modify the amount of resources available for each instance.

\
To achieve proper scheduling and runtime, all Pod's containers should have defined resources (requests, and in many cases, limits), and underlying infrastructure (worker nodes) should have the proper resource capacity to host the Pods (containers).

## Horizontal scaling&#x20;

Horizontal scaling refers to parallelization. To achieve the desired level of performance or resiliency, we might need multiple instances of the same workload or infrastructure (to ensure High Availability, processing parallelization, etc.)

Kubernetes and the open-source community provide multiple tools to control horizontal scaling. However, those should be tuned appropriately to bring the desired values.

PerfectScale supports the following horizontal scaling products/solutions :

* HorizontalPodAutoscaler
* Keda
* ClusterAutoscaler
* AWS Karpenter
* GCP Autopilot


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://docs.perfectscale.io/2.0-self-hosted-or-perfectscale-documentation/product-overview/understanding-k8s-scaling.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
