Skip to article frontmatterSkip to article content
Site not loading correctly?

This may be due to an incorrect BASE_URL configuration. See the MyST Documentation for reference.

What makes up cloud costs and how to control them

We pass through cloud costs directly to our communities in a transparent manner. This encourages us to continually reduce the cloud costs for our communities, and helps them understand how their decisions affect their cloud bill. See Who owns the cloud account for whether you or 2i2c should own the cloud account behind your hub.

What components make up my cloud bill

There are a few kinds of infrastructure that make up your cloud bill. Here is a short summary:

There are some other components that go into your cloud bill (e.g., “networking costs”) but these are the major pieces.

You pay for what you request, not for what you use

Cloud resources like memory and CPU are reserved the moment a user session starts, whether or not the user fully uses them. A user who picks a large resource profile “just in case” still pays the full cost for that capacity. Encourage your users to start with the smallest resource profile that fits their work, and to scale up only when they actually need to.

User actions that impact cloud costs

Cloud costs depend on a few key factors that you and your community has control over. Here we list some major considerations (in decreasing order of importance):

Estimate my cloud costs

The following is a very rough guideline to follow in order to understand and estimate what your cloud costs might be. These are similar whether you’re using 2i2c to manage your hub, or running it yourself.

Generally speaking, the biggest technical driver of cloud costs is user memory (RAM). This is because RAM must be “reserved” on a node, and each node has a finite amount of memory available to it.

Let’s say a user node costs $100.00 an hour, and comes with 100GB total RAM. If each user is guaranteed 1GB of RAM, then the node can theoretically fit 100 users at a time. 100 simultaneous users will cost $100.00 an hour, or roughly $1 / user / hour.

If we double the guaranteed RAM available to users, then the node can now fit 50 users at once (100 GB / 2 GB per user = 50 users total). We now need twice the number of nodes to handle the same number of users. 100 simultaneous users will now cost $200.00 an hour, or roughly $2 / user / hour.

In practice, the cost per node depends heavily on the cloud provider, and is constantly in-flux. To estimate your own cloud costs, follow these steps:

  1. Estimate memory available to each user. The amount of RAM needed for each user is often the biggest driver of cloud cost. Decide the “maximum” amount of RAM that a user will generally need, and multiply that by 1.5x.

  2. Determine how many average simultaneous users you’d like a hub to support. This isn’t necessarily the total size of your community, but how many people you think will be using the hub at the same time.

  3. Look up the monthly price for an n1-highmem-4 node. This is a basic node type that serves most use-cases and can be used as a benchmark for comparison.

    1. Go to the Google Cloud pricing page. This lists prices for many kinds of nodes with Google Cloud Platform.

    2. Go to the N1 high-memory machine types section. This contains prices for all N1 node types with high memory.

    3. Look at the hourly price for n1-highmem-4.

    4. Divide this amount by n_simultaneous_users_per_hour * GB_per_user.

    5. This is your estimated extra cost per hour per user.

  4. Estimate storage costs. Estimate your storage costs based on the expected storage each user will take up. 2i2c’s hubs use a standard NFS File Storage for most hubs, which has very fast latency for interactive computing. Here are Google’s file storage prices, for example. You can estimate these costs based on the expected storage used across all of your users.