How to speed up gradle daemon in CI pipeline

Describe your question in as much detail as possible:

We’re building Spring Boot Kotlin apps using Gradle Kotlin. Gradle startup times are slow.

  • What are you seeing, and how does that differ from what you expect to see?

We are seeing gradle daemon start times approaching 3 minutes (see below). Modern versions of gradle do not allow you to disable the daemon. We would like to see these perform better, as we are paying for CI minutes.

$ time gradle --daemone[0;m
Starting a Gradle Daemon (subsequent builds will be faster)

> Task :help

Welcome to Gradle 8.0.2.

To run a build, run gradle <task> ...

To see a list of available tasks, run gradle tasks

To see more detail about a task, run gradle help --task <task>

To see a list of command-line options, run gradle --help

For more detail on using Gradle, see

For troubleshooting, visit

1 actionable task: 1 executed

real	2m43.055s
user	0m2.185s
sys	0m0.221s
  • What version are you on? Are you using self-managed or

We are on SaaS. Latest version as of this writing.

  • Add the CI configuration from .gitlab-ci.yml and other configuration if relevant (e.g. docker-compose.yml)
  stage: build-artifacts
    - name: postgres:14.2
      alias: postgres-cicd
    - name: mongo:4.4
      alias: mongo-cicd
    - name: redis:7.0.4-alpine
      alias: redis-cicd
    - name: orientdb:3.2.17
      alias: orientdb-cicd
    # the following images require DOCKER_AUTH_CONFIG to be properly set;
    # see
    - name:
      alias: hivemq-cicd
    - java --version
    - gradle --version
    - env | sort
    - free -h
    - pwd
    - apt update
    - apt install -y jq httpie
    - time gradle --daemon
    - time gradle $CI_GRADLE_OPTS build | ./ | tee build.log
    - ...
  • What troubleshooting steps have you already taken? Can you link to any docs or other resources so we know where you have been?

We’ve already tried disabling the daemon in every documented way.