New CPU-based limits for Cirrus CI
TLDR: Cirrus CI will start limiting how many CPUs user’s tasks are using simultaneously and not limiting how many tasks are actually running in parallel. Nothing will change if you are using the default 2CPUs/4G configuration for your tasks. But you can also get 2X parallelism if your tasks don’t benefit from more CPUs. The new limits mechanism will replace the current one at 10am EST on Sunday, May 31st.
Cirrus CI had a free tier for Open Source projects with a limitation of how many tasks a user can run for different platforms. Here is a list of the current limitations:
- 8 Linux Containers or VMs
- 2 Windows Containers or VMs
- 2 FreeBSD VMs
- 1 macOS VM
Each Linux Container or VM can also be from 1/4 CPU to 8 CPUs. This led to two different problems.
Problem #1
Some entrepreneurial users decided to mine crypto coins via resources the community clusters because they are able to run 8 VMs with 8 cores with the total of 64 CPUs trying to mine the coins. There are couple of mechanisms implemented to counter agains these kind of attacks:
- Anti fraud detection mechanism of non-human like behavior/usage
- Firewall rules to block most of the mining pools
- Different other limiting mechanisms
- Some other things that don’t need to be disclosed here 😅
These mechanisms make the mining attempts useless and most of the entrepreneurial users give up pretty quickly even before we investigate the alerts.
But anyways these mining attempts in rare cases disrupted Cirrus CI services. Size of community clusters are limited and the entrepreneurial users were still using some of the resources that could’ve been used properly by other users.
The current scheduler uses a single queue for all the tasks to be scheduled which resulted in longer triggered-to-scheduled tasks for everyone.
Problem #2
Some users just always use the maximum available CPUs even though their build tools are not utilizing all of the CPUs. This is just seems wasteful. To help with optimizing utilization Cirrus CI recently started showing CPU and Memory usage charts:
New CPU Based Limits
To solve both problems Cirrus CI will introduce new scheduling mechanism on Sunday, May 31st 2020 at 10am EST. The new scheduler has a different implementation where each user has a separate queue of tasks for scheduling and more importantly the new scheduler limits scheduling based on the amount of CPUs for each platform:
- 16.0 CPUs for Linux platform (Containers or VMs).
- 8.0 CPUs for Windows platform (Containers or VMs)
- 8.0 CPUs for FreeBSD VMs.
- 2.0 CPUs macOS VM (1 VM with hyper-threading).
For example, by default Linux Containers have 2 CPUs which will allow 8 tasks in parallel. But if your task utilizes only one CPU, then you’ll be able to notice it on the CPU usage chart, change the default and then you’ll be able to run 16 tasks in parallel!
Users on Private Personal Repositories plan with have 2x the CPU limits.
Please let us know if you have any questions or concerns.