Costs

Costs provides predictable cost analysis and savings estimates for Kubernetes environments.

Costs is currently in Preview for the SaaS users. It is not currently available for on-prem environments.

Use Cases

Costs helps you get insights into the following use cases:

  • What is the cost of running compute (eg. EC2 instances) within a Kubernetes cluster?
  • What is the cost of running of compute required for an application / workload / namespace?
  • How can I reduce the cost of running workloads by rightsizing?

Supported Environments

  • The Sysdig Agent is required for Costs. The agent collects resource usage information that is augmented with billing data. There is no explicit configuration required for Costs.
  • Kubernetes clusters must be running in AWS, GCP, or Azure. Both managed clusters (eg. EKS) and vanilla Kubernetes (eg. KOPS) are supported.

Concepts

Cost Allocation

Cost Allocation is applicable to workloads and their associated namespaces, and displays the current allocated costs depending on resource requirements. Note that it is different from infrastructure costs, as workload cost allocation is calculated independently and can be considered a “logical cost”.

As workloads can exceed their configured requests (ie. it’s overcommitted using more than the number of requests, but less than resource limits) Cost Allocation is currently calculated daily by evaluating requests and usage, and taking whichever is greater for the given time period.

Cost Allocation considers compute (memory and CPU). In future, Sysdig will factor in other costs including storage, network / load balancer costs, and other associated infrastructure costs.

Given below is an example cost allocation for a workload. It has requests set to 5 CPU cores and 16GB memory running on an t3.medium with a CPU cost of $0.02/hour and memory cost of $0.003/hour (on-demand pricing).

Day      CalculationCost                    
Day 1Requested CPU: 5 CPUs ($0.10/hr)
Actual CPU Usage: 2 CPUs ($0.04/hr)
Requested Memory: 16GB ($0.048/hr)
Actual Memory Usage: 6GB ($0.018/hr)

Requests are greater than the usage; therefore, actual usage is ignored. Sysdig considers requests for calculating the cost.
CPU cost: $2.40
Memory cost: $1.15
Daily Cost: $3.55
Day 2Requested CPU: 5 CPUs ($0.10/hr)
Actual CPU Usage: 12 CPUs ($0.24/hr)
Requested Memory: 16GB ($0.048/hr)
Actual Memory Usage: 6GB ($0.018/hr)

Memory requests are greater than the usage; however the actual CPU usage is higher than the requests.
In this case, Sysdig considers actual CPU usage and memory requests.
CPU cost: $5.76
Memory cost: $1.15
Daily Cost: $6.91
Day 3Requested CPU: 5 CPUs ($0.10/hr)
Actual CPU Usage: 12 CPUs ($0.024/hr)
Requested Memory: 16GB ($0.048/hr)
Actual Memory Usage: 25GB ($0.075/hr)

Both the actual memory and CPU usage are higher than the requests (ie. overcommitted).
Here, Sysdig considers the actual CPU and memory usage.
CPU cost: $5.76
Memory cost: $1.80
Daily Cost: $7.56

Efficiency Metrics

CPU Requests

Average usage of CPU against requests over the last 10 minutes. No requests configured will show zero. Example:

CPU Requests = sum workload CPU usage over the last 10 minutes / sum workload CPU requests

Memory Requests

Average usage of memory against requests over the last 10 minutes. No requests configured will show zero. Example:

Memory Requests = sum workload memory usage over the last 10 minutes / sum workload memory requests

Note that for CPU requests, memory requests, and resource efficiency, the calculation is made a the individual workload level. This means when looking at a namespace, these values are an aggregate of all workloads within the same space.

Cost Savings

Costs helps teams optimize costs by recommending changes to their infrastructure.

Workload Rightsizing

Costs will surface savings to help you prioritize rightsizing workloads with the highest saving potential.

For all workloads running on your clusters, Cost Advisor evaluates the usage against requests. For oversized workloads (usage is less than requests) you can use Cost Advisor to 1) quantify cost saving if you were to rightsize requests, and 2) see a recommendation on what values to rightsize workloads to.

Costs helps to baseline workload costs by recommending CPU and memory requests. The recommendation is calculated by looking at the P95 usage of all unique containers running within a workload over the past 1 day. The recommendation is provided per container (in the case of pods running multiple containers).

Currently the recommendation to achieve savings is based on P95 usage over the past 1 day. Support for customizing the methodology that produces this recommendation is coming soon.

Learn More