Calculation tool × Python automation

Rate Plan Optimization Calculator

Renting cloud servers requires agreeing on a monthly reserved quota in advance. A higher quota raises the fixed monthly fee. Usage above the quota is billed at a surcharge. The tool uses the past year of actual usage to calculate the reserved quota with the lowest annual cost for each system.

Unit-by-unit calculationCovers every quota between the lowest and highest usage
3 plansNo overage / limited overage months / lowest cost
1 reportA summary table and a chart for each system

Billing terms

Reserved quota

The monthly usage amount agreed in advance with the service provider. The fixed monthly fee is calculated from this quota and does not depend on actual usage in the month.

Peak usage

The highest usage value in a month. A month counts as an overage month when its peak usage is higher than the reserved quota.

Overage surcharge

Usage above the reserved quota is billed separately. The unit rate is 2 times or 3 times the fixed monthly fee rate.

The previous situation

Before

  • The reserved quota used the value agreed several years earlier and was not adjusted as usage changed.
  • A re-evaluation required pasting each system's monthly usage into a spreadsheet one entry at a time. Each change of quota required a new calculation.
  • The overage surcharge uses two unit rates, and manual calculation was error-prone.

After

  • The program reads 12 months of peak usage for each system and applies the provider's published rate table.
  • It calculates the annual cost of each quota in steps of one unit and plots the results as a curve. The lowest point of the curve is the quota with the lowest cost.
  • It lists three plans side by side, with the annual cost difference between each plan and the current quota.

Workflow

1Prepare usage recordsCompile 12 months of peak usage and the current reserved quota for each system. Check for missing months and units.
2Apply rate rulesThe fixed monthly fee has separate unit rates for the peak season and the off season. Overage up to 10% of the reserved quota is billed at 2 times the rate, and the remainder at 3 times.
3Calculate unit by unitThe quota increases by 1 unit at each step. For each step, the program calculates the annual fixed monthly fee, the overage surcharge, and the number of overage months.
4Select three plansThe plans are no overage, limited overage months, and unlimited overage months. They are compared side by side.
5Generate the reportThe program writes a spreadsheet with one summary sheet and one chart sheet for each system.

Interactive demo: adjust the quota and view the cost change

Reserved quota calculationThe data is a synthetic example, and the rates are sample values
Annual fixed monthly fee
Annual overage surcharge
Overage months
Compared with current
Monthly peak usage and reserved quota
Quota vs. annual cost curve (calculated in steps of 1 unit)
Comparison of three plans
This demo compares only the two costs that change with the reserved quota: the fixed monthly fee and the overage surcharge. Charges based on actual usage do not depend on the quota and are not included. The rates are sample values and can be adjusted below.

Outcome and technology

Basis for decisions

Each system has a cost curve chart that marks the lowest-cost quota and the current quota.

Selectable risk level

In addition to the lowest-cost plan, the report lists a no-overage plan and a limited-overage-months plan. Managers can choose according to the number of overage months they accept.

Repeatable runs

After the system list or the yearly data is replaced, running the program again produces a report with the same layout.

PythonpandasopenpyxlAutomatic Excel chart generationRate rule modeling