Aptible logo
Sign up for free
Nick Anderegg
Nick Anderegg
July 27, 2022

Optimize your resource usage with Container Profiles and Enforced Resource Allocation

We are excited to announce that Container Profiles and Enforced Resource Allocation are now generally available on Aptible!

With Aptible’s Dedicated Stacks, your infrastructure resources are already dedicated to you and protected from noisy neighbors—by default, these dedicated environments run on single-tenant host machines with network segregation. Now, when Enforced Resource Allocation is enabled, you can ensure that the individual services you have deployed within that single stack don’t negatively impact one another.

Quieting Noisy Neighbors Roommates

In the past, Dedicated Stacks on Aptible have not enforced CPU Limits, which provides surge capacity for the individual services within your Dedicated Stack. With a lack of CPU Limit enforcement, if there was excess CPU capacity on the host machines where the stack was deployed, any service deployed in that stack could take advantage of those unused resources.

Container Profiles Diagram showing surge capacity available on host machine

However, without enforced CPU Limits, a container from one of your services can be starved of CPU by other containers deployed to the same stack and allocated to the same host, causing timeouts, errors, and alerts that don’t even reflect an issue with the app that’s generating these errors! Moreover, the underlying events that trigger these errors may not even be visible to you—such as an ephemeral SSH session causing CPU starvation of the stack’s NAT Gateway, negatively impacting all outbound traffic from your app.

Container Profile diagram showing containers on host machine being throttled

Enforced Resource Allocation—meaning CPU Limits and Memory Limits are enabled and enforced for a Stack—prevents a variety of failure modes by ensuring your containers do not use more resources than they are allocated.

Because there is a risk that Apps without enforced CPU Limits are presently relying on resources beyond their nominal allocation, transitioning your Dedicated Stacks to Enforced Resource Allocation is not trivial. Before enabling CPU Limits on your existing Dedicated Stacks, ensure that you don’t have any critical Apps which rely on CPU beyond their current nominal allocation.

New, Flexible Deployment Options to Optimize Costs

To make it easier to ensure your containers have the memory and processing resources they need, we are also excited to introduce a variety of new Container Profiles. These profiles can help you optimize your resource allocation and per-service costs by providing various ratios of CPU to RAM across a large range of sizes. The three types of Container Profiles currently available are as follows:

  • General Purpose: 1/4 CPU per 1GB RAM; the default Container Profile, which works well for most use cases.
  • CPU Optimized: 1/2 CPU per 1GB RAM; for CPU-constrained workloads, this profile provides high-performance CPUs and more CPU per GB of RAM.
  • Memory Optimized: 1/8 CPU per 1GB RAM; for memory-constrained workloads, this profile provides more RAM for each CPU allocated to the container.

Our documentation has more information about these new Container Profiles and how they use Enforced Resource Allocation to ensure your services have the resources they need.

How do I enable Container Profiles and Enforced Resource Allocation?

On all Shared Stacks and new Dedicated Stacks, Enforced Resource Allocation is already enabled by default. To enable Enforced Resource Allocation features on an existing Dedicated Stack, you can make a request to Aptible Support. Our CPU Limits FAQ has everything you need to know about these new features!