Original Message:
Sent: 02-13-2024 05:15
From: Andrew Midgley
Subject: Unit Cost Metrics ($ per GB, $ per CPU) for kubernetes containers
You are definitely heading in the right direction @Jeff Hyatt. Here's how I would go about it for CPU:
For the cost I would use "costs:cpu/reserved:fairShare" since that captures the entire cost for the period.
For CPU, the best way to think of what's been consumed is in terms of core-hours (a bit similar to the usage quantity AWS would have in the CUR file for EC2, which is instance-hours). The column for this is "cpu/reserved:resource:sum" and the unit for this is effectively micro-core-hours (1 millionth of a core-hour). So working through the maths it would be:
"costs:cpu/reserved:fairShare" / "cpu/reserved:resource:sum" * 1,000,000. I did that on some of our data and the numbers came out as i'd expect.
One last point to note the difference between milli and micro, with milli being divided by 1,000 and micro 1,000,000
Original Message:
Sent: 02-12-2024 15:00
From: Jeff Hyatt
Subject: Unit Cost Metrics ($ per GB, $ per CPU) for kubernetes containers
and I'm going with this unless Cloudability relays something different:
1000 microcpu == millicore == 1vCPU
k8s divides a second of cpu time into 1000 milicores, and allows subsharing of instructions per second within a single vCPU
Original Message:
Sent: 02-12-2024 14:59
From: Jeff Hyatt
Subject: Unit Cost Metrics ($ per GB, $ per CPU) for kubernetes containers
It looks like "sum" is just the daily average "mean" multiplied by number of days in the report period. so either metric could be used as long as you use the cost for matching period.
Original Message:
Sent: 02-12-2024 14:30
From: Jeff Hyatt
Subject: Unit Cost Metrics ($ per GB, $ per CPU) for kubernetes containers
thanks @Andrew Midgley - the reference for the csv columns is super helpful.
What is Cloudability's definition for the unit listed on the report: "microcpu"? another term for "CPU" or equivalent to K8s "millicore"?
If you were looking for a cost per unit of memory from the report - would you divide cost by the memory "mean" value or the "sum"?
I'm still digging through the details - I'll update anything new here too.
Original Message:
Sent: 02-12-2024 06:42
From: Andrew Midgley
Subject: Unit Cost Metrics ($ per GB, $ per CPU) for kubernetes containers
Hey @Jeff Hyatt, in good news the team has done a really good job in documenting all of those special container metrics here in the help center.
The metrics "costs:memory/reserved_rss:allocation" and "costs:memory/reserved_rss:fairShare" are not unit costs, but in fact are the aggregate costs associated with memory. In this case the cost of memory that could be allocated to actual usage, and the cost of memory in total (including usage and idle). Similar exist for CPU etc.
The amount of CPU and memory consumed is actually listed in the report too, looking like "cpu/reserved:resource:sum" - this isn't documented, but the average hourly amount is. In any case these easily gets you to a unit cost. Let me know how you go!
Original Message:
Sent: 02-09-2024 11:15
From: Jeff Hyatt
Subject: Unit Cost Metrics ($ per GB, $ per CPU) for kubernetes containers
@Andrew Midgley - The Cloudability Insights/Containers UI and report export provide nice cost metrics for a cluster's total memory and CPU. Coming up with a unit cost (per GB or per CPU) could be as simple as "$$ / GB total / hours in report" - not entirely sure. The report export contains columns "memory/reserved_rss:allocation" and "memory/reserved_rss:fairShare" that appear to be a unit cost - but not sure, they don't line up with the previous formula described.
tl;dr: do you have a recommended method for determining cost per GB or cost per CPU for kubernetes clusters (ideally using the data available in the Cldy container reports)?
bonus - best source for detailed definitions of the columns in the Insight/Containers report export?
#Cloudability