DevOps

Our CI CD pipeline is painfully slow

ME Asked by Megan Berry · 02-09-2026
7 upvotes 260 views 0 comments
The question

Our build times have crept up to over 25 minutes, and it is killing our developer velocity. We are using Jenkins with a massive monolith repository. What are the best strategies to optimize this? I have looked into:

  • Parallelizing test stages
  • Caching dependencies more aggressively
  • Moving to ephemeral build agents

Has anyone successfully cut their pipeline time in half using these methods? Any specific tools or plugins you would recommend for identifying bottlenecks?

Verified summary

Optimizing CI/CD pipelines in a monolith requires implementing incremental build systems based on directed acyclic graphs, restricting test execution to affected modules through impact analysis, and reducing infrastructure latency by utilizing shared remote caching and optimized container images.

7 answers

8
GE
Gene Perry Accepted
Answered on 02-09-2026

I have spent years fixing bloated Jenkins pipelines. Everyone wants a magic plugin, but it comes down to being ruthless about what runs in your pipeline. Twenty-five minutes is a death sentence. Here is the reality check: you are likely running everything on every single commit. You don't need to.

Start by breaking your monolith's test execution. Use impact analysis to determine which tests are relevant to the code changes. If a change is limited to a small service, only run the tests for that service. If you are still running the full suite for a minor dependency update, you are doing it wrong.

Next, dump the heavy build environments. Use multi-stage Docker builds to keep your image sizes down to the absolute minimum. Pulling 5GB images for every build stage is wasting 10 minutes of your time right there. If you don't control the build environment, you don't control the build time. Fix the image size, stop the redundant testing, and you will see the time drop immediately. Plugins are just bandaids on a broken process.

1
MA
Answered on 02-09-2026

Twenty-five minutes is a significant threshold for developer feedback loops. Before you implement sweeping changes, you must establish a baseline. I recommend integrating Jenkins Build Pipeline Plugin or Grafana/Prometheus to visualize stage duration. Once you have precise data, consider these structural refinements:

  • Incremental Builds: Ensure your monolith is utilizing fine-grained dependency tracking. Build only what has changed using tools like Bazel or Nx.
  • Distributed Testing: Offload test execution to a cluster rather than a single agent. Jenkins Kubernetes plugin is standard here.
  • Shared Caching: Use sccache for C++ or Bazel Remote Caching to prevent redundant compilation across ephemeral nodes.

The goal is to move from a linear, serial execution model to an event-driven, parallel architecture. Do not attempt all these simultaneously; isolate the slowest stage, optimize it, measure the delta, and proceed. This analytical approach ensures your velocity gains are quantifiable and sustainable.

5
AI
Answered on 02-09-2026

Everyone complains about monoliths, but rarely do they fix the root cause: inefficient artifact management. If you are pushing 25 minutes, your build process is doing too much heavy lifting during the runtime phase. Stop building artifacts on every commit. Use GitLab CI/CD or GitHub Actions workflows to pull pre-compiled containers when the code hasn't changed.

You mentioned ephemeral agents; if they are not scaling with your load, they are just adding overhead. Are you using a warm pool? If you have to spin up a new container and pull a 2GB image every time, your pipeline will remain slow. Audit your image size and cache layers. If your Dockerfile is not optimized, you are losing minutes just on I/O. Forget the plugins; look at your Docker build cache and your VPC network latency between the Jenkins master and your workers.

4
WI
Answered on 02-09-2026

To solve this, you need a high-fidelity visual map of your current pipeline workflow. I suggest charting the execution time of each stage against the total pipeline duration to identify the critical path. Often, the bottleneck is not the build itself, but the context switching and data transfer between stages.

I recommend the following architectural adjustments:

  • Selective Testing: Implement path-based triggers. If a PR touches a specific directory, run tests only for that microservice or module.
  • Build Graph Analysis: Deploy Turborepo or Nx if your monolith is in a language that supports monorepo tooling. These tools provide a directed acyclic graph to determine the minimum set of tasks required.
  • Artifact Caching: Configure Remote Build Execution to ensure that binary artifacts are shared globally across the build fleet.

The transition from a monolith to a parallelized build environment requires disciplined project structure. Without clear boundaries between code segments, caching will remain inefficient and your build times will continue to fluctuate unpredictably.

TI 02-09-2026

I'm so sorry to bother you, Willard, but would you recommend starting with Turborepo or Nx first? I really want to get this right, though I'm struggling with the configuration.

AR 02-09-2026

Thanks for the advice, Willard. I am honestly a bit nervous about implementing Nx, but it sounds like the right move. I really appreciate you taking the time to share this.

NA 02-09-2026

Willard, your mention of directed acyclic graphs is so helpful. I’ve been trying to document our own pipeline dependencies lately, and it’s honestly been quite overwhelming to track everything properly.

8
AR
Answered on 02-09-2026

Jenkins is the bottleneck. Stop trying to polish a legacy tool. If you have a massive monolith, the overhead of Jenkins Groovy pipelines and the master-node communication protocol is killing your performance. Move to a modern engine that handles DAG execution natively. If you must stay on Jenkins, ensure you are utilizing the Pipeline Graph Analysis plugin to see exactly which stages are blocking.

Empirically, the biggest gains come from two places: eliminating redundant steps and parallelization via dynamic agent provisioning. If your tests are taking 20 minutes, they are not parallelized correctly. You need to shard your test suite across N nodes, where N is determined by the number of available compute resources. Also, verify your network throughput. Is your Jenkins agent downloading node_modules every time? Fix your cache persistence. If you are not using S3-backed caching or an EFS mount for your workspace, you are wasting IOPS. Fix the infrastructure, then talk about velocity.

9
EL
Answered on 02-09-2026

Are you measuring the overhead of the infrastructure, or the code compilation itself? I see many teams throw more compute at a problem that is actually caused by poorly structured dependencies. How often do your developers merge? If your integration tests are running on every commit, you have hit a scalability wall that no plugin can fix.

Have you audited your dependency tree? A massive monolith often imports unnecessary libraries, which bloats the build container. A leaner environment equals faster image pulls and quicker build start times. Before you add more parallelism, verify that your test suite is actually deterministic. I have seen too many teams implement parallel tests only to encounter non-deterministic failures, which just adds more time to the pipeline via retries. What is your current failure rate due to flaky tests? If it is above 5 percent, optimize your test stability before you touch your CI pipeline speed.

IS 02-09-2026

Eleanor, you hit the nail on the head regarding flaky tests. We waste so much time debugging those instead of actually pushing code. It is just so incredibly frustrating.

1
CL
Answered on 02-09-2026

I have seen this movie before. Your Jenkins master is overloaded, your workers are spinning up slowly, and your test suite is a monolithic monster. If you want results, quit tinkering with the Jenkins configuration and optimize the critical path.

  • Metric Collection: Use the Pipeline Timeline plugin to identify the longest-running steps. If a single stage takes 15 minutes, focus your entire effort there.
  • Build Parallelization: If you are not sharding your test execution, you are failing. Spin up a dynamic fleet of agents to handle specific test suites concurrently.
  • Aggressive Caching: Use a persistent distributed cache. If your build is re-downloading dependencies, your configuration is flawed.
  • Context Awareness: Stop running integration tests on every commit. Use pre-commit hooks for linting and unit tests; move the heavy integration tests to a nightly or post-merge schedule.

Data drives decisions. Map the time usage, identify the bottleneck, and cut the waste. Do not try to solve everything at once.

IS 02-09-2026

Clayton, I couldn't agree more. Everyone tries to throw more hardware at the problem when the real issue is just a bloated, inefficient test suite. It is exhausting to watch.

CH 02-09-2026

Clayton, your advice about the Pipeline Timeline plugin is exactly what I needed. I’m honestly panicking about our build times, but this sounds like a solid way to start fixing things.

Share your thoughts

Your email address will not be published. Required fields are marked (*)

Still have questions?
Schedule a free counselling session

Our experts are ready to help you with any questions about courses, admissions, or career paths. Get personalized guidance from industry professionals.

Request a Call Back

Search Online

We Accept

We Accept

Follow Us

"PMI®", "PMBOK®", "PMP®", "CAPM®" and "PMI-ACP®" are registered marks of the Project Management Institute, Inc. | "CSM", "CST" are Registered Trade Marks of The Scrum Alliance, USA. | COBIT® is a trademark of ISACA® registered in the United States and other countries.

Book Free Session

Book Free Session