{"id":331,"date":"2026-10-13T15:31:38","date_gmt":"2026-10-13T15:31:38","guid":{"rendered":"http:\/\/www.scmgalaxy.com\/tutorials\/2013\/02\/04\/performance-optimization-of-build-server\/"},"modified":"2026-10-13T15:31:38","modified_gmt":"2026-10-13T15:31:38","slug":"performance-optimization-of-build-server","status":"publish","type":"post","link":"https:\/\/www.devopsschool.com\/blog\/performance-optimization-of-build-server\/","title":{"rendered":"Build Server Performance Optimization: Practical Checklist for Faster CI Pipelines"},"content":{"rendered":"\n<p class=\"wp-block-paragraph\">Build servers slow down when they rebuild too much code, keep too much data locally, or run on hosts with competing workloads. This guide helps DevOps and CI engineers optimize build throughput with a structured checklist covering infrastructure, CI configuration, application server tuning, and system-level hygiene.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><em>Originally published on 2013-02-04; fully revised and updated.<\/em><\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><img decoding=\"async\" src=\"https:\/\/www.devopsschool.com\/blog\/wp-content\/uploads\/2013\/02\/build-server.png\" alt=\"Build server optimization overview\"\/><\/figure>\n\n\n\n<h2 class=\"wp-block-heading\">Start with a baseline before tuning<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">Before changing anything, capture a baseline so you can verify whether each optimization helps. Focus on build duration, queue time, host resource pressure, and CI data growth.<\/p>\n\n\n\n<ul class=\"wp-block-list\"><li>Average and percentile build time per pipeline<\/li><li>Queue wait time and executor utilization<\/li><li>CPU, memory, and disk I\/O on build hosts<\/li><li>Growth of workspaces, logs, and build artifacts<\/li><\/ul>\n\n\n<pre class=\"wp-block-code\" aria-describedby=\"shcb-language-1\" data-shcb-language-name=\"JavaScript\" data-shcb-language-slug=\"javascript\"><span><code class=\"hljs language-javascript language-bash\">date\n\ntime mvn -DskipTests package\n\ndu -sh \/<span class=\"hljs-keyword\">var<\/span>\/lib\/jenkins\n\ndf -h<\/code><\/span><small class=\"shcb-language\" id=\"shcb-language-1\"><span class=\"shcb-language__label\">Code language:<\/span> <span class=\"shcb-language__name\">JavaScript<\/span> <span class=\"shcb-language__paren\">(<\/span><span class=\"shcb-language__slug\">javascript<\/span><span class=\"shcb-language__paren\">)<\/span><\/small><\/pre>\n\n\n<h2 class=\"wp-block-heading\">Build server optimization workflow<\/h2>\n\n\n\n<pre class=\"mermaid\">\nflowchart LR\n    A[Collect baseline metrics] --> B{Biggest bottleneck}\n    B --> C[Too much code rebuilt]\n    B --> D[Host resource contention]\n    B --> E[CI data growth logs artifacts]\n    C --> F[Use selective or module builds]\n    D --> G[Stop noisy background services]\n    E --> H[Apply retention and offload artifacts]\n    F --> I[Measure again]\n    G --> I\n    H --> I\n    I --> B\n<\/pre>\n\n\n\n<h2 class=\"wp-block-heading\">Build infrastructure improvements<\/h2>\n\n\n\n<h3 class=\"wp-block-heading\">Build only what changed<\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">The original post correctly emphasizes avoiding full rebuilds when only part of the code changed. In practice, this means using tool features for selective\/module builds and dependency-aware compilation.<\/p>\n\n\n<pre class=\"wp-block-code\" aria-describedby=\"shcb-language-2\" data-shcb-language-name=\"PHP\" data-shcb-language-slug=\"php\"><span><code class=\"hljs language-php language-bash\"><span class=\"hljs-comment\"># Make: parallelize and rebuild only out-of-date targets<\/span>\nmake -j$(nproc)\n\n<span class=\"hljs-comment\"># Maven: build selected modules and required dependencies<\/span>\nmvn -pl service-a,service-b -am test\n\n<span class=\"hljs-comment\"># Gradle: target modules and enable cache\/parallelism<\/span>\n.\/gradlew :service-a:build :service-b:build --parallel --build-cache<\/code><\/span><small class=\"shcb-language\" id=\"shcb-language-2\"><span class=\"shcb-language__label\">Code language:<\/span> <span class=\"shcb-language__name\">PHP<\/span> <span class=\"shcb-language__paren\">(<\/span><span class=\"shcb-language__slug\">php<\/span><span class=\"shcb-language__paren\">)<\/span><\/small><\/pre>\n\n\n<h3 class=\"wp-block-heading\">Split projects into independently buildable modules<\/h3>\n\n\n\n<ul class=\"wp-block-list\"><li>Separate components so each module can build and test independently.<\/li><li>Define clear dependency boundaries to avoid triggering unrelated builds.<\/li><li>Integrate modules only where needed in downstream packaging or release stages.<\/li><\/ul>\n\n\n\n<h3 class=\"wp-block-heading\">Plan for disk and artifact growth early<\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">Workspace size and retained artifacts grow quickly. Plan retention and cleanup from day one instead of waiting for emergency disk incidents.<\/p>\n\n\n<pre class=\"wp-block-code\" aria-describedby=\"shcb-language-3\" data-shcb-language-name=\"JavaScript\" data-shcb-language-slug=\"javascript\"><span><code class=\"hljs language-javascript language-bash\">du -sh \/<span class=\"hljs-keyword\">var<\/span>\/lib\/jenkins\/jobs\nfind \/<span class=\"hljs-keyword\">var<\/span>\/lib\/jenkins\/workspace -maxdepth <span class=\"hljs-number\">1<\/span> -mindepth <span class=\"hljs-number\">1<\/span> -type d | wc -l<\/code><\/span><small class=\"shcb-language\" id=\"shcb-language-3\"><span class=\"shcb-language__label\">Code language:<\/span> <span class=\"shcb-language__name\">JavaScript<\/span> <span class=\"shcb-language__paren\">(<\/span><span class=\"shcb-language__slug\">javascript<\/span><span class=\"shcb-language__paren\">)<\/span><\/small><\/pre>\n\n\n<h2 class=\"wp-block-heading\">Application server and CI service tuning<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">If your CI UI is fronted by Apache or another web server, keep it lean: reduce unnecessary modules, tune logging, and follow hardened configuration practices for your environment.<\/p>\n\n\n\n<ul class=\"wp-block-list\"><li>Set practical log levels and rotate logs regularly.<\/li><li>Disable unused modules and integrations.<\/li><li>Review CI plugins\/extensions periodically and remove unused ones.<\/li><li>Set build history retention so old records and artifacts are pruned.<\/li><\/ul>\n\n\n\n<p class=\"wp-block-paragraph\">The original article referenced a Jenkins optimization paper: <a href=\"http:\/\/www.cloudbees.com\/sites\/default\/files\/whitepapers\/7WaysToOptimizeJenkins.pdf\">7WaysToOptimizeJenkins.pdf<\/a>.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">System-level tuning for dedicated build hosts<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">Build hosts should be treated as dedicated infrastructure. Background services and ad hoc usage often create noisy-neighbor effects and unstable build times.<\/p>\n\n\n\n<ul class=\"wp-block-list\"><li>Stop unnecessary background tasks that consume CPU or memory.<\/li><li>Keep OS and runtime packages updated under controlled change management.<\/li><li>Avoid using build servers for unrelated interactive work.<\/li><li>Use storage that matches your I\/O profile for builds and test workloads.<\/li><\/ul>\n\n\n<pre class=\"wp-block-code\"><span><code class=\"hljs language-bash\">ps -eo pid,comm,%cpu,%mem --sort=-%cpu | head\nfree -h\niostat -xz 1 5<\/code><\/span><\/pre>\n\n\n<h2 class=\"wp-block-heading\">Compare common optimization strategies<\/h2>\n\n\n\n<figure class=\"wp-block-table\"><table class=\"has-fixed-layout\"><thead><tr><th>Approach<\/th><th>Best for<\/th><th>Main benefit<\/th><th>Main trade-off<\/th><\/tr><\/thead><tbody><tr><td>Full rebuild every commit<\/td><td>Small repos with simple dependencies<\/td><td>Simple and deterministic pipeline behavior<\/td><td>Wasted compute as codebase grows<\/td><\/tr><tr><td>Selective module builds<\/td><td>Modular projects and monorepos<\/td><td>Less compilation and test workload per change<\/td><td>Requires accurate dependency mapping<\/td><\/tr><tr><td>Distributed builds on agents\/nodes<\/td><td>High commit volume and parallel pipelines<\/td><td>Higher throughput and shorter queue times<\/td><td>Agent capacity and lifecycle management overhead<\/td><\/tr><tr><td>Artifact offloading to repository\/object storage<\/td><td>Large binaries and long retention needs<\/td><td>Prevents CI host disk exhaustion<\/td><td>Adds external service dependency and access controls<\/td><\/tr><\/tbody><\/table><\/figure>\n\n\n\n<h2 class=\"wp-block-heading\">Example Jenkins guardrails for retention and stability<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">In Jenkins, distributed workers (commonly called <strong>agents<\/strong>; older material may use legacy terms) and retention defaults can significantly reduce controller pressure.<\/p>\n\n\n<pre class=\"wp-block-code\" aria-describedby=\"shcb-language-4\" data-shcb-language-name=\"JavaScript\" data-shcb-language-slug=\"javascript\"><span><code class=\"hljs language-javascript language-groovy\">pipeline {\n  agent { label <span class=\"hljs-string\">'linux'<\/span> }\n  options {\n    disableConcurrentBuilds()\n    timeout(time: <span class=\"hljs-number\">45<\/span>, <span class=\"hljs-attr\">unit<\/span>: <span class=\"hljs-string\">'MINUTES'<\/span>)\n    buildDiscarder(logRotator(numToKeepStr: <span class=\"hljs-string\">'30'<\/span>, <span class=\"hljs-attr\">artifactNumToKeepStr<\/span>: <span class=\"hljs-string\">'10'<\/span>))\n  }\n  stages {\n    stage(<span class=\"hljs-string\">'Checkout'<\/span>) {\n      steps { checkout scm }\n    }\n    stage(<span class=\"hljs-string\">'Build'<\/span>) {\n      steps { sh <span class=\"hljs-string\">'mvn -pl service-a,service-b -am test'<\/span> }\n    }\n  }\n}<\/code><\/span><small class=\"shcb-language\" id=\"shcb-language-4\"><span class=\"shcb-language__label\">Code language:<\/span> <span class=\"shcb-language__name\">JavaScript<\/span> <span class=\"shcb-language__paren\">(<\/span><span class=\"shcb-language__slug\">javascript<\/span><span class=\"shcb-language__paren\">)<\/span><\/small><\/pre>\n\n<pre class=\"wp-block-code\" aria-describedby=\"shcb-language-5\" data-shcb-language-name=\"PHP\" data-shcb-language-slug=\"php\"><span><code class=\"hljs language-php language-bash\"><span class=\"hljs-comment\"># Example artifact offload step (repository URL\/path will vary)<\/span>\ncurl -u <span class=\"hljs-string\">\"$REPO_USER:$REPO_PASS\"<\/span> --upload-file target\/app.jar \\\n  https:<span class=\"hljs-comment\">\/\/repo.example.com\/repository\/releases\/com\/example\/app\/1.0.0\/app-1.0.0.jar<\/span><\/code><\/span><small class=\"shcb-language\" id=\"shcb-language-5\"><span class=\"shcb-language__label\">Code language:<\/span> <span class=\"shcb-language__name\">PHP<\/span> <span class=\"shcb-language__paren\">(<\/span><span class=\"shcb-language__slug\">php<\/span><span class=\"shcb-language__paren\">)<\/span><\/small><\/pre>\n\n\n<h2 class=\"wp-block-heading\">Common pitfalls<\/h2>\n\n\n\n<ul class=\"wp-block-list\"><li>Optimizing without a baseline, so gains cannot be verified.<\/li><li>Keeping unlimited build logs and artifacts on the CI host.<\/li><li>Running unrelated services or manual workloads on build machines.<\/li><li>Using module-selective builds without maintaining dependency accuracy.<\/li><li>Scaling agents without monitoring queue behavior and executor saturation.<\/li><\/ul>\n","protected":false},"excerpt":{"rendered":"<p>Build server performance issues usually come from unnecessary rebuilds, poor retention policies, and host-level contention. This updated guide turns the original checklist into a practical workflow with commands, architecture guidance, and CI guardrails you can apply immediately.<\/p>\n","protected":false},"author":1,"featured_media":3785,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_joinchat":[],"footnotes":""},"categories":[2],"tags":[91,1793,2401,2404,2405,1122,545,2399,872,2400,2402,2403,399,732,213,1452],"class_list":["post-331","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-uncategorised","tag-build","tag-build-server","tag-build-server-performance-optimization","tag-build-server-performance-optimization-guide","tag-build-server-performance-optimization-tutorial","tag-guide","tag-how","tag-optimization","tag-performance","tag-performance-optimization","tag-performance-optimization-guide","tag-performance-optimization-tutorial","tag-server","tag-steps","tag-tutorial","tag-ways"],"_links":{"self":[{"href":"https:\/\/www.devopsschool.com\/blog\/wp-json\/wp\/v2\/posts\/331","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.devopsschool.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.devopsschool.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.devopsschool.com\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.devopsschool.com\/blog\/wp-json\/wp\/v2\/comments?post=331"}],"version-history":[{"count":3,"href":"https:\/\/www.devopsschool.com\/blog\/wp-json\/wp\/v2\/posts\/331\/revisions"}],"predecessor-version":[{"id":79201,"href":"https:\/\/www.devopsschool.com\/blog\/wp-json\/wp\/v2\/posts\/331\/revisions\/79201"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.devopsschool.com\/blog\/wp-json\/wp\/v2\/media\/3785"}],"wp:attachment":[{"href":"https:\/\/www.devopsschool.com\/blog\/wp-json\/wp\/v2\/media?parent=331"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.devopsschool.com\/blog\/wp-json\/wp\/v2\/categories?post=331"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.devopsschool.com\/blog\/wp-json\/wp\/v2\/tags?post=331"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}