Fix regional Machine prices on the pricing page - #2505
Conversation
The region multipliers in RegionPricingSelector didn't match what we bill (Tokyo was 2.0 rather than 1.3077, São Paulo 1.21 rather than 1.6154), and its base prices were Amsterdam's rather than Ashburn's, so every region except Amsterdam showed the wrong price. Use the multipliers from landing's data/pricing.yml, which match billing, and compute each row from the Ashburn per-second rates the way the Sitepress page did. Default the selector to Ashburn, and show two decimals in the monthly column ($32.30, not $32.3).
|
Preview deployment for your docs. Learn more about Mintlify Previews.
💡 Tip: Enable Automations to automatically generate PRs for you. |
kcmartin
left a comment
There was a problem hiding this comment.
Checked this against landing/data/pricing.yml rather than the rendered page, and computed every cell both ways. 846 cells, zero mismatches. Same regions, markups, base rates and preset ladder. Tokyo works out to exactly $40.54.
One optional nit, and it predates this PR. BASELINE_RAM_PRICE_PER_30_DAYS = 5 is really 0.00000193 × 2592000 = 5.00256, so the sentence under the table reads a cent low in Mumbai, Paris, London and Johannesburg. Deriving it would remove the last hardcoded number in the file:
const BASELINE_RAM_PRICE_PER_30_DAYS = RAM_PRICE_PER_GB_SECOND * SECONDS_PER_MONTH;Also worth noting for 1 October: this now derives from three constants and a markup table, so that update is a few numbers rather than 846 cells.
The sentence under the table used a flat $5, which is really 0.00000193 x 2592000 = $5.00256, so it read a cent low in Johannesburg, London, Mumbai and Paris.
A customer noticed that the Machines pricing table on docs.fly.io/about/pricing was showing the wrong prices for most regions. A performance-1x Machine with 2GB in Tokyo was listed at $64.39 a month when we actually bill $40.54. Johannesburg and Mumbai were showing more than double the real price, and São Paulo went the other way, listed lower than what we charge.
This happened when the docs moved to the new site. The regional prices were carried over as rough estimates instead of the real numbers we bill with, and the starting prices came from Amsterdam instead of Ashburn.
This PR brings the table back in line with what customers are actually billed in every region. It also opens the table on Ashburn by default and shows monthly prices with two decimals ($32.30 instead of $32.3).
Prices change on October 1, so this table will need one more small update that day to match fly.io/pricing-update.