A Jenkins that works well attracts work: TecnoShop started with one service and one developer, and at the end of module 8 it has two applications with full CI, a delivery pipeline, security analysis, container images and a Kubernetes pilot, and other teams (shipments, recommendations, data) are asking when they can come on board. With every new project, the queue grows, and so do the simultaneous builds, the JENKINS_HOME disk and the number of people who cannot work if Jenkins goes down. Scaling is not just "getting a bigger machine": it means reading the signals, telling whether the bottleneck is in the agents or in the controller, choosing between growing vertically, adding ephemeral agents or splitting the work across several controllers, and being honest about what Jenkins does (and does not) offer in terms of high availability. In this lesson you will get to know those options and finish with TecnoShop's scaling plan.
The Signals That It Is Time to Scale
In Monitoring Jenkins you set up Prometheus, Alertmanager and Grafana with the "Jenkins - Health" dashboard. Those metrics are what tell you the platform is falling short, long before someone says so in the channel:
| Signal | Metric or source | Rough threshold | What it usually indicates |
|---|---|---|---|
| A queue that does not empty | jenkins_queue_size_value |
Items in the queue on a sustained basis (more than 5-10 minutes) during working hours | Not enough executors for some label |
| Time in queue | queueDurationMillis from wfapi (07-02), Waiting for next available executor |
A median of more than 1-2 minutes on PRs | Feedback is getting worse because of capacity, not because of the pipeline |
| Busy executors | jenkins_executor_count_value vs. executors in use |
Above 80% at peak hours | Not enough headroom for peaks |
| Controller heap | vm_memory_heap_usage |
Above 80% after garbage collections | The controller needs more memory or has too much load |
| GC pauses | JVM GC metrics, GC logs | Frequent long pauses (seconds) | Heap at its limit or poorly sized |
| Controller CPU | System or container metrics | Sustained above 70-80% | Too many pipelines, heavy Groovy, polling, expensive plugins |
| Slow interface | External check of /login (05-05) |
Growing response times | Saturated controller (CPU, memory or disk) |
JENKINS_HOME disk |
Node monitor and free space | Less than 20% free, or high I/O latencies | Insufficient retention, large artifacts, slow disk |
The rule of thumb: a long queue with a calm controller is an agent problem; a saturated controller with an empty queue is a controller problem. The solutions are different.
From Alerts to Trends
The alerts from 05-05 (JenkinsLongQueue, JenkinsHighHeap) fire when something is already wrong. To plan, you need trends: how things evolve week by week. A few PromQL queries for a new Grafana dashboard, "Jenkins - Capacity":
# Daily queue peak max_over_time(jenkins_queue_size_value[1d]) # Executor utilization (0-1), hourly average avg_over_time((jenkins_executor_in_use_value / jenkins_executor_count_value)[1h:5m]) # 95th percentile of the controller heap over the last week quantile_over_time(0.95, vm_memory_heap_usage[7d])
max_over_time(...[1d]): the maximum value in each one-day window. If the peaks grow week after week, the problem will arrive even if no alert fires today.[1h:5m]: a subquery: it evaluates the division every 5 minutes and averages the last hour. Check in/prometheus/the exact names of the executor metrics your version of the plugin exposes.quantile_over_time(0.95, ...): the value below which the metric stays 95% of the time. It is more stable than the maximum for making memory decisions.
And a capacity alert to add to those from 05-05, in the same rules file:
- alert: JenkinsAgentCapacity
expr: avg_over_time((jenkins_executor_in_use_value / jenkins_executor_count_value)[2h:5m]) > 0.8
for: 30m
labels:
severity: warning
annotations:
summary: "Executors have been above 80% utilization for more than 2 hours: review capacity"It does not wake anyone up (it is a warning): it is there to open a capacity task with days to spare.
Diagnose Before Acting
flowchart TD
S["Symptom: builds take longer"] --> Q{"Are they waiting in the queue?"}
Q -->|"yes"| E{"Why? (why field)"}
E -->|"no executors with that label"| A["Agents: more capacity<br/>or ephemeral agents (sections 4-6)"]
E -->|"lock / disableConcurrentBuilds"| L["Pipeline design:<br/>shared resources (07-03)"]
Q -->|"no"| R{"Are the stages slower?"}
R -->|"yes, on the agent"| G["Agent: CPU, disk, network,<br/>caches (09-03)"]
R -->|"no, everything is slow"| C{"Is the controller saturated?<br/>heap, GC, CPU, I/O"}
C -->|"yes"| V["Controller: vertical (section 3)<br/>and offloading (section 7)"]
C -->|"yes, and it is already big"| H["Split across controllers<br/>(section 8)"]
Three quick checks before changing anything:
- The queue, by label:
curl ... '/queue/api/json?tree=items[why,task[name]]'(08-04) shows what is waiting and why. Ten builds waiting forwindowsare not fixed by addinglinuxagents. - Load Statistics (Manage Jenkins → Load Statistics, and on each label): the chart of available executors, busy executors and queue length over time (05-05).
- A thread dump of the controller (
/threadDump, 03-06) when it is slow: it shows what it is busy with. Detailed analysis belongs to Optimizing Jenkins Performance.
Vertical Scaling of the Controller
The controller is a single Java process that keeps its state in JENKINS_HOME. Growing vertically means giving it more resources:
| Resource | What to do | Caveats |
|---|---|---|
| Memory (heap) | Set -Xms and -Xmx (equal, to avoid resizing) |
The container or VM needs more than the heap: metaspace, threads, buffers. Leave 1-2 GB on top |
| CPU | More cores | Helps with many simultaneous pipelines and with the interface; it does not make up for inefficient Groovy |
JENKINS_HOME disk |
Local or low-latency SSD | Jenkins does many small writes (logs, build.xml, pipeline state). A slow NFS is noticeable everywhere |
| Garbage collector | G1 (the default in modern JVMs) | Switching collectors or tuning their parameters is fine-tuning: 09-03 |
In the lab, the heap is set in docker-compose.yml. Remember from 08-03 that JAVA_OPTS replaces the image's, so it must also include disabling the setup wizard:
jenkins-controller:
# ... image, secrets, volumes and networks as in 08-03 ...
environment:
JAVA_OPTS: >-
-Djenkins.install.runSetupWizard=false
-Xms2g -Xmx2g
# ... the rest of the variables from 08-03 ...
mem_limit: 3g-Xms2g -Xmx2g: 2 GB of heap from startup.mem_limit: 3g: the container can use up to 3 GB; if it exceeds that, Docker kills it. The 1 GB margin covers the memory outside the heap.- With Helm (08-02), the equivalents are
controller.javaOptsandcontroller.resources.
The limit of vertical scaling: more heap is not free (collections with very large heaps can take longer) and a bigger machine is still one machine. As a common rule of thumb in the community, when a controller needs more than 8-16 GB of heap to run well, it is usually a sign that there is too much on it: it is time to offload it (section 7) or split it (section 8), not to keep going up.
Horizontal Scaling: More Agents, Preferably Ephemeral Ones
Jenkins scales horizontally through its agents: the controller distributes, the agents execute. There are two ways to add capacity:
| Permanent agents | Ephemeral agents (clouds) | |
|---|---|---|
| Example at TecnoShop | linux-agent-01 |
Pods from the kubernetes cloud (08-02) |
| Capacity | Fixed: you pay for it even when it is not used | On demand: born with the build, gone when it finishes |
| Isolation | Workspace and caches shared between builds | A clean environment per build |
| Maintenance | Patches, disks that fill up, tools that drift | The image is the definition; it is rebuilt, not patched |
| Startup | Immediate | From seconds to minutes (scheduling, pulling the image, booting a VM) |
| Caches | Local, fast | They have to be designed (volumes, Nexus, mirrors) |
| When they fit | Special hardware, macOS, licenses tied to a machine, deployments from a specific network | The vast majority of builds |
The direction almost every organization takes, and TecnoShop's too: ephemeral by default, permanent by exception, and only when justified.
Ephemeral Agents in the Cloud: Docker, Kubernetes and Virtual Machines
In Jenkins, a cloud is an on-demand agent provider: when there are builds in the queue with a label the cloud knows how to serve, Jenkins asks it for agents; when they finish, it releases them. Clouds are configured in Manage Jenkins → Clouds.
| Plugin | What it creates | Pros | Cons |
|---|---|---|---|
Docker (docker-plugin) |
One agent container per build on a Docker daemon | Simple if you already have Docker daemons for builds | Capacity limited to the daemons you configure; the daemon risks from 08-01 |
Kubernetes (kubernetes) |
One pod per build | Today's standard; with node autoscaling, elastic capacity | Requires a cluster and knowing how to operate it |
Amazon EC2 (ec2) |
One VM per build or per batch | Builds that need a whole machine (their own Docker, Windows) | Slower startup (minutes); cost per VM |
| Azure VM Agents, Google Compute Engine | The same, on those clouds | The same | The same |
The Docker Cloud, in the Lab
Lesson 08-01 introduced the Docker plugin. With it, instead of linux-agent-01 launching containers, Jenkins creates a complete agent on docker-dind for each build. Its configuration, for reference:
| Field | Value in the lab |
|---|---|
| Docker Host URI | tcp://docker-dind:2376 |
| Server credentials | A credential of type X.509 Client Certificate with key.pem, cert.pem and ca.pem from the docker_certs_client volume |
| Docker Agent templates → Labels | docker-ephemeral |
| Docker Image | registry.tecnoshop.local/tecnoshop/linux-agent:3 |
| Remote File System Root | /home/jenkins/agent |
| Connect method | Inbound connection (the image is inbound-agent), with the controller URL as seen from the container; in the lab, with the daemon's network (host), as in 08-01 |
| Pull strategy | Pull if it does not exist or if the tag has been updated |
| Instance Capacity | 4 |
| Retention | One build per container, and remove the container (and its volumes) when it finishes |
The exact names of the fields and connection strategies change between plugin versions; the idea is the same: an image, a label and a maximum number of instances. TecnoShop does not adopt it: it already has Kubernetes for ephemeral agents and does not want two mechanisms. It is a reasonable option for organizations without Kubernetes that already have VMs with Docker dedicated to builds.
Kubernetes with Node Autoscaling
The kubernetes cloud from 08-02 creates pods, but pods need nodes. If the cluster has a fixed number of nodes, capacity is still fixed. What makes the system elastic is node autoscaling:
- Cluster Autoscaler (on most providers) or Karpenter (common on AWS): when there are pods in
Pendingfor lack of resources, they add nodes; when nodes are left empty, they remove them. - A node group dedicated to CI, separate from the applications, with a taint (for example
dedicated=ci:NoSchedule) and the corresponding toleration inci/pod-ci.yaml. A spike in builds does not compete with production, and builds do not share nodes with sensitive data. - Interruptible instances (spot/preemptible) for the CI group: much cheaper, in exchange for the provider being able to reclaim them. An interrupted build is retried; recent versions of Pipeline can retry automatically when the agent is lost (the
retrystep with conditions such askubernetesAgent()). - Scaling to zero outside working hours: in the early morning, with only the nightly build, the group can shrink to one node or none.
- The pods'
requests(section 8 of 08-02) are what the autoscaler uses to decide: if they are unrealistic, the cluster will grow too much or too little.
In the orders-api pod template, sending builds to the CI group takes a few lines in the spec of ci/pod-ci.yaml (the node group label name depends on the provider; here, a fictitious one):
spec:
nodeSelector:
tecnoshop/group: ci # only nodes in the CI group
tolerations:
- key: dedicated
operator: Equal
value: ci
effect: NoSchedule # accepts the taint that repels all other pods
# ... serviceAccountName, securityContext and containers as in 08-02 ...nodeSelector: the pod can only go to nodes with that label.tolerations: the CI group has thededicated=ci:NoScheduletaint, which prevents pods that do not tolerate it (the applications) from being scheduled there. Combining the two gives you a node group exclusive to builds.- In the kind lab there are no node groups: these lines would leave the pods in
Pending. They are meant for TecnoShop's cluster.
Label Strategy
With several types of agents, labels decide where each build goes. TecnoShop's strategy:
| Label | Meaning | Who offers it | Who requests it |
|---|---|---|---|
linux |
Linux with JDK 21, gitleaks, Trivy, ssh |
linux-agent-01 |
Pipelines not yet in pods, CD |
docker |
Can run containers (client + build daemon) | linux-agent-01 |
catalog-web, jenkins-config, images built with Docker |
| (generated) | A specific pod | The kubernetes cloud |
agent { kubernetes { ... } } |
deploy (future) |
Located on the network from which staging and production are reachable |
Permanent agent(s) on that network | orders-api-cd, orders-api-rollback |
windows, macos (if they arrive) |
Operating system | Permanent agents or ephemeral VMs | Projects that need them |
The principles:
- Labels by capability, not by machine:
linux && docker, neverlinux-agent-01. That way you can add, replace or retire agents without touching anyJenkinsfile. - Few, and documented: each label is a contract. A list in the
jenkins-configREADME.mdstates what each one guarantees. - Expressions (
linux && !gpu) only when they add value; see 01-03. - Exclusive use (Only build jobs with label expressions matching this node) for expensive or special agents, so that they do not fill up with builds that could run anywhere.
Offloading the Controller
Before making the controller bigger or splitting it, it pays to take away work that does not belong on it. Without going into fine-tuning, which belongs to 09-03:
| What weighs on the controller | How to offload it | At TecnoShop |
|---|---|---|
| Builds on the controller | 0 executors on the built-in node | Since 05-01 |
Large artifacts in JENKINS_HOME |
Publish them to an artifact repository and archive only small things in Jenkins; or use an external artifact manager (for example, the Artifact Manager on S3 plugin moves archiveArtifacts and stash to object storage) |
Jar, SBOM and images in Nexus (06-05); Jenkins keeps the last 5 |
| Unlimited history | buildDiscarder in every pipeline and a global policy |
30 builds, 5 with artifacts; 100 for the CD |
| Huge logs | Less verbose builds (-ntp, -q); plugins that ship logs to external systems exist, but weigh them carefully |
MAVEN_ARGS='-B -ntp' since 04-03 |
| Heavy Groovy in pipelines | A pipeline's Groovy code (loops, JSON parsing, calculations) runs on the controller; move it into scripts that run with sh on the agent |
Thin library steps; logic in scripts under deploy/ and ci/ (04-07) |
| SCM polling | Webhooks | Since 06-01, with a daily fallback scan |
| Plugins | Fewer plugins, reviewed; each one adds memory, startup time and attack surface | The periodic review from 05-04 |
| Checkouts on the controller | Lightweight checkout to read the Jenkinsfile |
orders-api-cd and orders-api-rollback |
| Bulk API queries | tree instead of depth (08-04) |
pipeline-status.sh |
Several Controllers: Splitting by Team or Domain
When a single controller is already well sized and offloaded and it is still not enough, or when there are organizational reasons, the solution is to have several controllers, each with its own scope: by team, by business domain or by criticality level. This is usually called sharding.
| Pros | Cons |
|---|---|
| Smaller blast radius: a faulty plugin, an upgrade or an outage affects one team, not all of them | More to maintain: N controllers to upgrade, back up, monitor and secure |
| Performance: each controller has fewer jobs, builds and history | No native global view: each team looks at its own Jenkins; shared dashboards are built with the API or with metrics |
| Autonomy: each team can have its own plugins or upgrade schedule | Drift: without discipline, each controller ends up configured its own way |
| Security: credentials and permissions that are truly separate (one controller per trust level) | Dependencies between teams: triggering a job on another controller requires the API (08-04) or an event, not the build step |
What makes splitting viable is sharing the code, not hand-made configuration:
- The same image (Jenkins +
plugins.txt) for every controller, or a common base with minimal additions. - Layered JCasC: a common base (
casc/common/: security, library, integrations) and one layer per controller (casc/orders/,casc/data/: their own nodes, clouds, credentials and roles).CASC_JENKINS_CONFIGaccepts several paths. - The same
tecnoshop-lib, with semantic versions: each team upgrades when it wants to. - Job DSL per controller: each one with its own
jobs/, generated by its own seed. - Some commercial distributions based on Jenkins add a centralized management layer for multiple controllers; if you get to dozens of controllers, they are worth evaluating.
When not to split: to fix a long queue (that is what agents are for) or a poorly offloaded controller (section 7). Splitting multiplies the platform team's work; do it for blast radius, autonomy or security, with numbers in hand.
High Availability: What Exists and What Does Not
Open source Jenkins has no active-active mode: two controllers cannot run at the same time on the same JENKINS_HOME. Its state lives on disk and in the memory of a single process. The real options:
| Option | How it works | Recovery time | Risks |
|---|---|---|---|
| Fast recovery on Kubernetes | A single-replica StatefulSet with a persistent volume (the chart from 08-02); if the pod or the node goes down, Kubernetes recreates it and remounts the volume | Minutes (Jenkins startup plus mounting the volume on another node) | Volumes are usually tied to a zone: if the zone goes down, you need a backup or replica in another one |
| Active-passive with shared storage | A second controller on standby, which starts on the same JENKINS_HOME (NFS, a cloud file system) only if the first one dies |
Minutes | If both manage to start at the same time, they corrupt JENKINS_HOME: it requires a reliable mechanism guaranteeing that the first one is dead (fencing). And network storage is usually slower for Jenkins' I/O |
| Restore from backup | The procedure from 05-03 on a new machine | Hours (TecnoShop's 4 h RTO), less with JCasC | Whatever happened since the last backup is lost (24 h RPO) |
| Commercial solutions | Some enterprise distributions based on Jenkins offer high availability modes with several replicas | Depends on the product | Cost and vendor dependency; evaluate them with their documentation and a real test |
And what happens to the builds when the controller restarts:
- Pipelines resume after the restart, with the default durability (you saw this in 02-05): finished stages are not repeated.
- An
shthat was running on an agent may keep running while the controller comes back, and the pipeline picks up its result on reconnection, if the agent is still alive and the outage does not last too long. - Kubernetes pods may be lost if the outage is long;
retrywith lost-agent conditions helps.
For most organizations, the sensible answer is not to chase an active-active setup that does not exist, but to reduce recovery time: the controller on Kubernetes with a persistent volume, configuration in JCasC, tested backups, alerts that fire within minutes and a rehearsed procedure. And to design for the outage: an hour without Jenkins should delay deployments, but not stop anyone from working or leave an environment half-deployed (the reason for the lock, the milestone and the automatic rollback in module 7).
Capacity Planning by Organization Size
The figures are rough guidelines: they depend heavily on the type of builds, the plugins and the history. They are useful as a starting point and to know when to review; the real data comes from your metrics.
| Size | Teams / users | Jobs | Builds per day | Controller | Agents | Architecture |
|---|---|---|---|---|---|---|
| Small | 1-3 teams, fewer than 30 people | Fewer than 100 | Fewer than 200 | 2 vCPUs, 4 GB of RAM (2 GB of heap), 50 GB SSD | 1-3 permanent agents or a cloud with 5-10 concurrent | One controller; daily backups |
| Medium | 4-15 teams, 30-200 people | 100-1,000 | 200-2,000 | 4-8 vCPUs, 8-16 GB (4-8 GB of heap), 200 GB or more of SSD | Ephemeral cloud, 10-50 concurrent, with autoscaling | One well-offloaded controller, JCasC; consider a second one by criticality |
| Large | More than 15 teams, more than 200 people | More than 1,000 | More than 2,000 | Several controllers with 8-16 vCPUs and 8-16 GB of heap each | Hundreds concurrent on autoscaling clouds | Controllers per domain, common image and JCasC, centralized management |
And a few rules for estimating at any size:
- Executors needed ≈ builds per hour at peak × average duration (in hours) × 1.3 for headroom. With 40 builds per hour lasting 10 minutes: 40 × 0.17 × 1.3 ≈ 9 concurrent executors.
JENKINS_HOMEdisk ≈ jobs × retained builds × average size of a build (logs, results, archived artifacts), plus a 50% margin. Measuring the real size ofjobs/is more reliable than estimating it.- Review the trends every quarter for queue, heap and disk; scaling decisions are made weeks in advance, not on the day the disk fills up.
TecnoShop's Scaling Plan
Today TecnoShop is a small organization on its way to medium: three teams, about 25 jobs, between 100 and 150 builds a day and plans to add shipments, recommendations and data within the next year. Laura presents this plan:
flowchart LR
subgraph before["Today (end of module 8)"]
C1["Controller<br/>Docker / VM<br/>JCasC + Job DSL"]
A1["linux-agent-01<br/>2 executors<br/>linux, docker"]
D1["docker-dind"]
K1["kubernetes cloud<br/>orders-api CI"]
C1 --> A1 --> D1
C1 --> K1
end
subgraph after["Goal (6-12 months)"]
C2["Controller on Kubernetes<br/>Helm + SSD PV<br/>JCasC from jenkins-config"]
K2["Dedicated CI nodes<br/>autoscaling, spot<br/>every build in pods"]
P2["deploy-agent-01<br/>permanent, environments network<br/>deploy label"]
N2["Nexus: jars, npm, images,<br/>dependency proxies"]
C2 --> K2
C2 --> P2
K2 --> N2
end
before ==> after
| Phase | What changes | Criterion for moving to the next one |
|---|---|---|
| 1. All CI in pods | catalog-web and jenkins-config move to pod templates; linux-agent-01 and docker-dind are kept only for the CD |
Median PR queue time below 1 minute; no builds on linux-agent-01 except CD |
| 2. CI nodes with autoscaling | A dedicated node group with a taint, an autoscaler, interruptible instances and retries | Stable cost per build; no pod in Pending for more than 2 minutes |
| 3. Controller on Kubernetes | Helm with the jenkins-config image and JCasC, an SSD volume with a Retain policy, daily snapshots; migration with a restored backup during a maintenance window |
A successful full rehearsal of the migration and of recovery (delete the pod, recover on another node) |
| 4. CD from a deployment agent | deploy-agent-01 (permanent, on the staging and production network, deploy label) replaces linux-agent-01; or deployment on Kubernetes once staging and production get there |
linux-agent-01 and docker-dind decommissioned |
| 5. A second controller, only if needed | A controller for the data team if its security or plugin requirements justify it, with the same image and layered JCasC | A data-driven decision: more than 15 teams, heap sustained above 8 GB after offloading, or isolation requirements |
What is not in the plan: an active-active setup (it does not exist in open source Jenkins) and growing vertically without measuring first. The target RTO drops from 4 hours to under 30 minutes with phase 3; the RPO for the history still depends on the snapshots.
Common Mistakes and Tips
- Raising the heap at the first sign of slowness: if the queue is caused by a lack of agents, a controller with 16 GB will not empty it. Diagnose first.
-Xmxequal to the container's memory limit: the JVM needs memory outside the heap; the container will end upOOMKilled. Leave headroom.- Putting
JENKINS_HOMEon a slow NFS "to get high availability": the interface and the pipelines will feel it on every operation, and without fencing you do not have HA, you have a corruption risk. - Two controllers on the same
JENKINS_HOME: guaranteed corruption. Jenkins is not designed for it. - Labels with machine names: when the machine changes, you will have to edit every
Jenkinsfile. - Splitting into several controllers without JCasC or a common image: in six months you will have N different Jenkins instances and nobody will know why.
- Ephemeral agents without caches: every build downloads the world; times get worse and the savings disappear. Design the caches (Nexus, volumes, mirrors) at the same time as the cloud.
- Autoscaling with unrealistic
requests: the autoscaler decides based on what the pods request, not on what they use. - Tip: keep a capacity document in the
jenkins-configrepository with each quarter's figures (queue, executors, heap, disk, builds per day). Scaling decisions are much easier to discuss with a table in front of you.
Exercises
Exercise 1. On the Grafana dashboard from 05-05, during a working morning in your lab (or by triggering several orders-api and catalog-web builds at the same time), watch the queue, the executors and the heap. Using the rule from the diagnostic diagram, where is the bottleneck? Propose a specific action.
Exercise 2. In one year, TecnoShop expects 8 teams, 60 jobs and 600 builds a day, with a peak of 80 builds per hour and an average duration of 12 minutes. Estimate the concurrent executors needed at peak and the controller size according to the table. Would linux-agent-01 be enough? Which phase of the plan is essential?
Exercise 3. The data team asks for "its own Jenkins" because it needs a plugin that the platform team does not want to install on the shared controller. Write Laura's reply: when she would say yes, what conditions she would set and what both controllers would share.
Solutions
Solution 1. With two executors on linux-agent-01 and the kubernetes cloud limited to 4 pods, the usual picture is a queue that grows when more than two catalog-web builds (which use the docker label) or more than four orders-api builds coincide, while the controller heap stays stable and well below 80%: the bottleneck is the agents, not the controller. The queue's why field confirms it (Waiting for next available executor on 'docker' or the cloud's limit). Actions: raise the cloud's limit if the cluster has resources (checking for Pending pods), and bring phase 1 of the plan forward (moving catalog-web to pods) so as not to depend on the two executors. If, on the other hand, the heap after collections exceeded 80% with an empty queue, the problem would be the controller.
Solution 2. Executors ≈ 80 × (12/60) × 1.3 = 80 × 0.2 × 1.3 ≈ 21 concurrent at peak. With 8 teams and 600 builds a day, TecnoShop falls into the medium band: a controller with 4-8 vCPUs, 4-8 GB of heap and a 200 GB SSD, and ephemeral agents with autoscaling. linux-agent-01 (2 executors) is nowhere near enough, and a permanent agent with 21 executors would be expensive, sit idle at night and share everything between builds. Phase 1 (all CI in pods) and phase 2 (nodes with autoscaling) are essential; phase 3 stops being optional when eight teams depend on a single controller outside the cluster.
Solution 3. "Another controller is not free: it has to be upgraded, backed up, monitored and secured, and every one we add multiplies the platform team's work. Before saying yes, I want to understand the plugin: if it can be avoided with a container in your pipeline (an image with the tool, as we did in 08-01), that is the first option, because it does not touch the controller. If it really has to be a plugin, we evaluate it with the criteria from 02-06 and test it on jenkins-test; if it is secure and maintained, it can go into the shared controller. I would say yes to a controller of your own if the plugin is essential and we cannot accept its risk for everyone, or if your data requires stronger isolation of credentials and permissions than a folder provides. Conditions: the same base image and the same upgrade process, JCasC in jenkins-config with the common base plus your layer, a shared tecnoshop-lib, Job DSL for your jobs, the same backups and the same alerts, and someone from your team on the on-call rotation for that controller."
Conclusion
Scaling Jenkins starts with reading the signals from 05-05 and telling an agent problem (a queue that does not empty while the controller is calm) apart from a controller problem (heap, GC, CPU or disk at their limits). The controller is given memory and fast disk in measured amounts (-Xms/-Xmx with headroom in the container, SSD for JENKINS_HOME) and, above all, relieved of work: artifacts in Nexus, retention, webhooks, lightweight Groovy, fewer plugins. Execution capacity grows with ephemeral agents (Docker clouds, Kubernetes with node autoscaling, virtual machines in the cloud) and a capability-based label strategy. Splitting across several controllers reduces the blast radius at the cost of more maintenance, and is only sustainable with a shared image, JCasC and library. And when it comes to high availability, the honest answer is that open source Jenkins has no active-active mode: what works is recovering fast. With this lesson you close module 8: TecnoShop builds in containers and in pods, publishes and deploys images, describes all of its Jenkins in tecnoshop/jenkins-config, automates it with the API and the CLI, and has a plan for growth. In module 9 you will take a step back to consolidate everything you have learned into a set of guidelines, starting with Jenkins Best Practices.
