2i2c-org / infrastructure

Infrastructure for configuring and deploying our community JupyterHubs.
https://infrastructure.2i2c.org
BSD 3-Clause "New" or "Revised" License
103 stars 56 forks source link

Clarify and document rounding for resource allocation list #3584

Open yuvipanda opened 6 months ago

yuvipanda commented 6 months ago

The list of resource allocations that end users can choose from on the VEDA hub looks like this:

image

Why are these numbers odd?

The reason these are a bit odd (1.9GB instead of 2GB, etc) is so we account for overhead of running various system and support components on each node, so not all the resources of the node are available for end users to use. The resources that are available, we split into chunks that fit together proportionally to minimize the amount of possible wasted space. https://github.com/2i2c-org/infrastructure/pull/3030 is the PR that originally added this, and has a lot of rationale in the description about how they are calculated.

Why do we show these numbers?

Why do we show these odd numbers? It's because if I log in, and in the bottom of JupyterLab, I see the current memory limit:

image

When an end user hits this memory limit, they start seeing their kernels die. Kernels dying due to memory exhaustion is perhaps the number one confusing thing that end users experience on a JupyterHub that they don't on their local machine. If you exhaust memory on your local machine, everything freezes. Here, the kernel dies.

So when building the script to generate these choices (https://github.com/2i2c-org/infrastructure/pull/3030), I made the display of memory match the actual memory limit, so it is easy for the user to understand where this number was coming from. It does mean that the numbers look 'odd', but I personally think it's better to have one number be in the server startup screen and in jupyterlab and that look odd, than to have two different numbers here simply so that they look more rounded out.

However, everyone always asks why this number looks odd, so we should at least document this someplace nice.

yuvipanda commented 6 months ago

For CPU though, I think we don't need to show 2 decimals after the ., 1 is probably fine. I opened https://github.com/2i2c-org/infrastructure/pull/3585 to address that.