Managed instances: cost estimation

How to calculate the cost of a managed instance

⚠️ IMPORTANT: This provides a rough estimate to the best of our ability, infrastructure pricing estimates are not trivial to do accurately and actual costs are always subject to change. The goal of this is to give you a rough estimate of costs, not an exact amount.

ℹ️ If unsure about anything with pricing for a managed instance, message @devops-support in the #cloud-devops – ensure you include all the information needed for the resource calculator and any extra information about why you need help.

Several data points are needed to work out the cost:

  • Size of all of their repositories on disk
  • Number of repositories
  • Number of those repositories that are monorepos

These data points are also listed in the CS managed instance request template.

Cost estimateDescription
$282/moData and snapshot storage costs for the first 250GB
+$1/GB storageFor any additional storage above 250GB required.
$56/moNetwork infrastructure costs
+$388/mo min.VM instance type - see “Working out the VM type required” below
+$1.54/GBFor each GB of network traffic to/from the instance.

Thus, the smallest managed instance supporting around ~300 repositories and ~100 users costs around $726/mo. Add enough buffer to the pricing to account for some variation in usage—for example, an estimate of $10–15k for this instance.

Working out the VM type required

  1. Use the resource estimator to work out the memory and CPUs required for the customer’s user count and repos.
  2. Go to GCP’s page for machine sizing
    1. Make sure you’re looking at N1 machine types.
    2. Make sure the bar at the top is set as follows, with US-Central selected on the left and Monthly pricing toggled on the right.
  3. Find the machine type from any of the following tables that at least exceeds the CPU and memory requirements advised by the Resource Estimator.
    • N1 standard machine types
    • N1 high-memory machine types
    • N1 high-CPU machine types

Potential cost savings

The above does not take into account:

  • Potential committed use discounts, which are handled transparently on Sourcegraphs’ side through cross-project committed use discount sharing and passed onto you automatically.
  • Cost reduction based on proactive monitoring of services based on your actual usage—resource requirements of Sourcegraph vary widely depending on how your usage looks. This is handled automatically by Sourcegraph as part of monthly upgrades.

Detailed breakdown

The following describes how the above table was derived—reviewing this is not necessary for calculating the cost of a new managed instance.

The following summarizes the infrastructure costs incurred for a managed instance. Managed instances are always created in completely isolated GCP projects, and as such it is easy to see the exact infrastructure cost breakdown for a given customer.

Cost estimateDescription
$388/mo min. variesVM instance, n1-standard-16 min. in us-central. Consult resource estimator
$85/mo min. / $0.340/GBData disk, SSD/regional, 250G minimum—exact size depends on customer’s repository sizes.
$34/moBoot disk, SSD/regional, 100G fixed size.
$85/mo / $0.026/GB13 weekly snapshots (taken weekly, retained for 90d)
$78/mo / $0.026/GB12 monthly upgrade data disk snapshots (taken once per month as part of upgrade, retained for 1yr).
$36/moCloud Load Balancing, two rules required.
$12/moExternal IP address, four required.
$1/mo + $0.045/GBCloud NAT, one required.
$6/mo + $0.75/million requestsCloud Armor, one policy, one rule, and user-activity requests.
$1.42/GBCloud Proxy, 3 are required.
$0.12/GBInternet egress traffic from us-central1.