Resource consumption and cost management
Understanding how CircleCI Server consumes cloud resources helps you plan capacity, set appropriate budgets, and detect cost anomalies.
Resource cost drivers
CircleCI Server consumes cloud resources across several categories:
Compute resources
| Resource | Component | Description | Cost impact |
|---|---|---|---|
Nomad worker nodes (ASG/MIG) |
Execution environment |
EC2/GCE instances that run Docker executor jobs |
Highest - scales with job volume |
Machine executor jobs |
Machine Provisioner |
On-demand instances for |
High - billed per job duration |
Kubernetes nodes |
Control plane |
EKS/GKE nodes running CircleCI services |
Medium - stable |
Nomad workers
Nomad workers are the primary compute cost driver. They scale up when jobs are queued and scale down when idle, controlled by the Nomad Autoscaler.
Cost factors include:
-
Instance type configured in your Terraform module.
-
Number of concurrent jobs.
-
Job duration.
-
Autoscaler configuration (
min,max,cooldown).
| If the Nomad Autoscaler fails to scale down (for example, due to nodes stuck in draining state), compute costs can increase. Monitor autoscaler logs and ASG/MIG instance counts. |
Storage resources
| Resource | Description | Cost impact |
|---|---|---|
Object storage (S3/GCS) |
Build artifacts, caches, workspaces |
Medium - grows over time |
Block storage (EBS/Persistent Disk) |
Root volumes for Nomad workers, database storage |
Low to medium |
CircleCI uses object storage for:
-
Build artifacts - Files uploaded via
store_artifacts. -
Test results - JUnit XML files from
store_test_results. -
Caches - Dependency caches from
save_cache/restore_cache. -
Workspaces - Data shared between jobs via
persist_to_workspace/attach_workspace. -
Action logs - Step output logs displayed in the UI.
-
Workflow configuration - Pipeline and workflow definition data.
-
Audit logs - System audit events.
| Configure lifecycle policies for your object storage bucket to automatically expire old objects and control storage costs. See Data Retention in Server for details on configuring retention periods and S3 lifecycle policies. |
Resource tagging
Proper resource tagging enables accurate cost attribution in your cloud provider’s cost management tools.
Auto-tagged resources
CircleCI automatically tags certain resources:
| Resource | Tag/Label | Value |
|---|---|---|
Machine executor instances (AWS) |
|
|
Machine executor instances (AWS) |
|
For example, |
Machine executor instances (GCP) |
|
|
Nomad workers (AWS) |
|
|
Nomad workers (AWS) |
|
Your configured base name |
Nomad workers (GCP) |
Network tag |
|
Cost monitoring
We recommend using your cloud provider’s native cost management tools to monitor CircleCI Server resource consumption.
AWS
-
AWS Budgets - Set spending limits and receive alerts when costs approach thresholds. See AWS Budgets documentation.
-
AWS Cost Anomaly Detection - ML-powered detection of unexpected spending patterns with automated alerts. See AWS Cost Anomaly Detection.
Filter by tag ManagedBy: circleci-machine-provisioner to track machine executor costs separately. Filter by tag vendor: circleci for Nomad worker costs.
|
GCP
-
GCP Budgets - Set spending limits with email or Pub/Sub alerts. See GCP Budgets documentation.
-
GCP Cost Management - Analyze costs and get optimization recommendations. See GCP Cost Management.
Common cost issues
The following scenarios can lead to unexpected costs:
-
Instances not scaling down - Cloud provider API timeouts, rate limiting, or transient errors can prevent scale-in operations from completing, leaving instances running longer than expected.
-
Orphaned compute instances - Cloud provider API failures during instance termination can result in instances that continue running after their associated jobs complete.
-
Storage growth - Build artifacts and caches accumulate over time. Configure lifecycle policies for your object storage bucket to automatically expire old data.