Gradle Build takes long time while running from Jenkins slave but its faster when I run from local command line

16 views
Skip to first unread message

Saravanan Manickam

unread,
Aug 26, 2020, 8:53:50 AM8/26/20
to jenkins...@googlegroups.com
Gradle Clean/Build takes long time while running from Jenkins slave but its faster when I run from local command line on the same slave with the same user logged in.

I have a gradle job configured and it runs as part of multi branch pipeline.
* Checkout - First stage
* Clean  - Second stage
* Build - Thrid stage

When the job is run from Jenkins (dedicated slave), it took 12 mins of time to complete the clean operation and 1 hour for build operation.

Whereas, when I logged into the same slave machine with same user I used in Jenkins, it took only 4 mins for clean and 15 mins for build.

The remote root directory is in NFS path. I also played around increasing the heap space for Jenkins slave with advanced JVM options "-Xms4096M -Xmx8192M -XX:MaxPermSize=4192M -Djava.awt.headless=true", but it doenst help much.

Please share your thoughts.

Regads,
Saravanan

Ivan Fernandez Calvo

unread,
Aug 26, 2020, 2:57:04 PM8/26/20
to Jenkins Users
When you run the job on Jenkins the agent process is writing more files to the workspace, like the log so the IO speed to the NFS server is really important, I would not recommend to use NFS for the workspace if you cannot ensure a 100-150MB/s IO and NFSv4 protocol https://support.cloudbees.com/hc/en-us/articles/217479948-NFS-Guide. I guess you need it as cache for the dependencies or other stuff, so should be better to only use the NFS on read only mode for that cache and use the local disk for the build. If you are using pipelines you can reduce the IO by disabling the persistence options but you lost the rerun from a stage feature https://www.jenkins.io/doc/book/pipeline/scaling-pipeline/
Reply all
Reply to author
Forward
0 new messages