CPU Limits

Enclave allocates 1 / 4 th of a CPU thread per GB of memory to Containers. In other words:

  • 512 MB containers are allocated 1 / 8th of a CPU thread.
  • 1 GB containers are allocated 1 / 4th of a CPU thread.
  • 2 GB containers are allocated half of a CPU thread.
  • 4 GB containers are allocated a full CPU thread.
  • Etc.

This ratio is not configurable.

Enforcement

CPU Limits are in place to enforce the aforementioned CPU allocation on Shared Stacks, but by default, that’s not the case on Dedicated Stacks.

This has a few important implications for Containers deployed on Dedicated Stacks:

  • Your Containers will be allowed to use more CPU than their share
  • Your Containers may negatively impact other Containers you own if they use too much CPU.

In other words, in the absence of CPU limits, your Containers are granted extra CPU you didn’t pay for, but their CPU share is not guaranteed. Conversely, if CPU limits are enabled, then your Containers are granted only what you paid for, but that CPU share is guaranteed.

In practice, given this tradeoff, most Enclave customers prefer to keep CPU limits disabled on their Dedicated Stacks. However, if you would like to enable them, this can be done via a simply request to Aptible Support.