> ## Documentation Index
> Fetch the complete documentation index at: https://docs.thoras.ai/llms.txt
> Use this file to discover all available pages before exploring further.

# Cost Estimates

> Understand how Thoras calculates potential savings and waste across your Kubernetes cluster based on workload resource usage and node pricing data.

Thoras estimates cost savings and waste by analyzing your workload resource
requests against predicted usage patterns. This guide explains how these
calculations work and how to customize pricing data for your environment.

## How Cost Calculations Work

Thoras calculates potential savings by comparing your current resource
allocations with forecasted recommendations. The calculation involves three main
components:

### 1. Determining Average Node Cost

Thoras establishes a baseline "average node cost per hour" for your cluster:

1. **Node Discovery** - Collects node information similar to the output from
   `kubectl get nodes -oyaml`
2. **Metadata Extraction** - Parses labels to identify:
   * Cloud provider (AWS, GCP, Azure, etc.)
   * Instance type (e.g., `m7g.medium`, `n2-standard-4`)
   * Capacity type (on-demand or spot)
3. **Price Matching** - Matches node details against pricing data to determine
   hourly cost, CPU cores, and memory
4. **Cluster Averaging** - Averages cost, cores, and memory across all nodes to
   establish cluster-wide baseline

If pricing data is unavailable for a node (e.g. unknown instance type), that
node is excluded from the cluster's "average node." If no nodes can be priced,
Thoras defaults to 4 cores, 16GB memory, and \$0.19/hour (equivalent to an AWS
`t3.xlarge`).

**Note:** This approach provides ballpark estimates rather than precise billing
figures. The goal is directional guidance on how rightsizing workloads impacts
your overall cloud spend.

### 2. Calculating Workload-Level Savings

For each workload, Thoras compares original controller specifications (e.g.
Deployment, StatefulSet, ArgoRollout) against forecasted resource
recommendations:

**Over-provisioned workloads** (positive delta):

* Current requests exceed predicted usage
* Labeled as **waste** in recommendation mode
* Labeled as **savings** in autonomous mode

**Under-provisioned workloads** (negative delta):

* Current requests fall below predicted usage
* Tracked as **Resources Needed** (recommendation mode) or **Resources Added**
  (autonomous mode)
* Thoras recommends increasing resources to improve stability

Thoras tracks the potential reduction (or required increase) in CPU cores and
memory bytes per hour for each workload.

### 3. Cluster-Wide Cost Impact

Thoras aggregates workload-level changes across your entire cluster:

1. Sum wasted or saved CPU and memory across all workloads
2. Calculate how many fewer nodes are needed based on:
   * Aggregate CPU core reduction
   * Aggregate memory reduction
3. Use the **lower of the two** (CPU or memory determines node count)
4. Multiply by average node hourly cost to estimate total cluster savings

This represents the maximum potential savings if all right sizing
recommendations were applied autonomously by Thoras.

## Sourcing Pricing Data

Because Thoras operates in an air-gapped environment without real-time cloud API
access, pricing data comes from a built-in static price list that is
periodically updated in product releases.

### Handling Spot Pricing

Spot instance pricing fluctuates based on supply and demand. Rather than
tracking real-time spot prices, Thoras uses published average savings
percentages from cloud providers.

For example, according to
[AWS EC2 Spot Instance Advisor](https://aws.amazon.com/ec2/spot/instance-advisor/),
a spot `m7g.medium` provides an average 59% savings over on-demand pricing (as
of February 5, 2026).

**Note:** Your actual spot costs may differ from dashboard estimates because
Thoras uses static averages rather than current market rates.

### Preemptible Instances

Preemptible instances (GCP's predecessor to their spot offering) are priced
using spot pricing data as a proxy. While not exact, the two pricing models are
typically close. Your actual preemptible costs may vary from dashboard
estimates.

## Overriding Average Node Cost

You can manually override the calculated average node cost when:

* Your cluster uses an bespoke instance types
* You have custom pricing agreements or reserved instance discounts
* You want more precise cost calculations based on your actual billing

To override the average node cost, navigate to the cluster settings in the
Thoras dashboard and enter your custom value.

## What's Included (and What's Not)

**Included in cost calculations:**

* CPU and memory resource costs
* Node-level infrastructure pricing

**Not included in cost calculations:**

* Reserved instance or savings plan discounts
* Committed use discounts (GCP)
* Custom pricing agreements

For workloads with significant non-compute costs, treat Thoras savings estimates
as a lower bound on total potential savings.

### Horizontal Scaling Savings and Waste

Vanilla HPA is reactive by design. To protect against sudden traffic spikes,
teams typically run workloads at 20-30% utilization. Thoras's predictive
horizontal scaling allows workloads to run at much higher instantaneous
utilization (80-90%) by scaling proactively based on forecasts.

However, Thoras uses vanilla HPA as a safety backstop, always scaling to the
higher value between the Thoras forecast and vanilla HPA's recommendation.
Realizing savings from this improved utilization requires increasing HPA's
target utilization metric, which is a manual configuration change.

Because savings depend on customer action to adjust HPA settings, cost estimates
exclude horizontal scaling savings.

## Mixed Instance Types

Thoras handles heterogeneous clusters gracefully:

* **Mixed capacity types** - Averages across spot and on-demand instances
* **Multiple instance types** - Blends pricing across different machine types
* **Multi-cloud** - Averages across cloud providers if nodes span multiple
  clouds

**Note:** This averaging approach ignores bin-packing optimizations that tools
like Karpenter might achieve. Actual savings may be higher if your autoscaler
can consolidate workloads onto fewer nodes.

## Node Detail Collection

Thoras snapshots node metrics every 5 minutes and rolls up aggregates hourly and
daily. Cost projections are based on these aggregated usage patterns.
