Things on this page are fragmentary and immature notes/thoughts of the author. Please read with your own judgement!
import polars as pldf = pl.read_csv("aws_ec2_vm_instances.csv")
df = df.with_columns(
hourly_cost=pl.col("hourly_cost").str.lstrip("$").cast(float),
memory=pl.col("memory").str.rstrip(" GiB").cast(float),
performance_per_vcpu=pl.when(pl.col("performance_per_vcpu").is_null())
.then(1)
.otherwise(pl.col("performance_per_vcpu")),
).with_columns(
real_vcpu=pl.col("vcpu") * pl.col("performance_per_vcpu"),
)
dfLoading...
VM Instances With Highest vCPU / memory Ratio¶
(df["real_vcpu"] / df["memory"]).max()2.0df.filter(df["real_vcpu"] / df["memory"] >= 2)Loading...
Cheapest VM Instance per vCPU Hour¶
t2.nano is the cheapest with an hourly cost of $0.0058 and a monthly cost of $4.176 per vCPU.
(df["hourly_cost"] / df["real_vcpu"]).min()0.0058df.filter(df["hourly_cost"] / df["real_vcpu"] <= 0.0058)Loading...
Monthly cost (USD).
0.0058 * 24 * 304.176