Updates

Divio Starts Enforcing CPU and Memory Limits

Beginning 31st of May 2024, Divio will begin enforcing CPU and memory limits. Read more about the reasons behind this decision and how it will affect you and your applications.

Lucy Linder

Lucy Linder

Team Lead Site Reliability Engineer

Why CPU Limits Matter

Up until now, our pricing plans have been based solely on memory allocation, with no enforced CPU limits. As our platform grows and evolves, we are committed to maintaining the same high quality and smooth experience for all our users. Enforcing both memory and CPU limits will help us improve the overall stability of the platform and ensure a fair distribution of resources.

Introducing CPU Limits

Starting 31st of May 2024, we will be implementing CPU limits alongside our existing memory limits. This means that in addition to the allocated amount of memory specified in your chosen pricing plan, your applications will now also be restricted to a specific amount of CPU cores.

We designed the plans to achieve the best balance between memory and CPU resources, tailored to suit a wide range of general purposes:

  • 256 MB RAM → max 0.2 CPU Cores

  • 512 MB → max 0.25 CPU Cores

  • 768 MB → max 0.5 CPU Cores

  • 1024 MB → max 0.5 CPU Cores

  • 2048 MB → max 1.0 CPU Cores

  • 4096 MB → max 2.0 CPU Cores

  • 8192 MB → max 4.0 CPU Cores

Note that the power of e.g. 0.2 CPU Cores depends on the cloudspace your application is deployed on. For an AWS-backed Cloudspace in the Open Cloud, 0.2 CPU cores is equivalent to 20% of 1 Intel Xeon Platinum 8000 series processor (Skylake-SP or Cascade Lake) with a sustained all core Turbo CPU clock speed of up to 3.1 GHz.

Regarding Memory Limits

While your plan has always specified a maximum allocated memory, it's important to note that this limit has never been enforced. Moving forward, Divio will begin enforcing memory limits in alignment with the same gradual enforcement approach as the CPU limits.

As a reminder, a plan with a memory of 512 MB means your application has access to at most 512MB of RAM, and 1024MB (1GB) of swap space.

Swap is a safety mechanism triggered when your application runs out of RAM. In such cases, the operating system transfers data to disk (known as swap) to free up RAM space, and retrieves it back into RAM when needed. While swapping prevents your application from crashing when it reaches the RAM limit, it comes at a cost - reading from disk and moving data around is slow and may significantly impact performance. The maximum swap space available at Divio is always twice the amount of memory stated in the plan.

Gradual Enforcement Approach

To ensure a smooth transition and minimize any potential impact on your applications, we are taking a gradual approach to enforcing CPU and memory limits over a period of three months. Here is how it will work:

  • Initially, we will enforce limits at twice the advertised level (factor of 2). For instance, if your plan includes 512MB of memory, your application will be allocated 1024MB (1GB) memory of RAM, 2048 MB (2 GB) of swap space and 0.4 CPU cores. These limits only come into effect upon the first deployment after the starting date (31st of May 2024).

  • Over the next three months (June, July and August 2024), we will gradually decrease this factor from 2 to 1 until limits are enforced at the advertised level. Note that applications on a Divio Feature plan Gold or higher will benefit from a factor of 1.2, to allow for some leeway (soft limits).

  • In the event an application has not been redeployed by the end of the gradual enforcement period (June, July and August 2024), Divio will initiate a deployment to ensure compliance with the new limits.

What This Means for You

We understand that changes to resource allocation can have an impact on your applications, and we want to make this transition as seamless as possible for you.

  • CPU limits mean that your application can only access a small percentage of the available CPU on the runner. If your application runs CPU-intensive tasks that would require more CPU than available, these tasks may take longer to execute, potentially resulting in degraded response times. However, it's important to note that reaching CPU limits will not cause your application to crash.

  • Memory limits mean that your application is restricted to a specific amount of memory. Similar to conventional computers, exceeding this limit will first cause swapping, and if the swap space is full the application will eventually crash. Divio can detect these crashes and automatically restart your application; however, this process is not instantaneous and may lead to downtime. If your application continues to exceed its memory allocation, it will consistently crash until the underlying issue is resolved.

Take Action

To prepare for these changes, we recommend reviewing your current resource usage using the metrics tab on the Control Panel and adjusting your plan as needed to align with the new CPU limits. We expect most applications to not be impacted at all. However, remember to stay alert in the foreseeable future for any error related to increased latency or memory-related errors.

Our support team is here to assist you every step of the way, so don't hesitate to reach out if you have any questions or need assistance.