Can I reduce delay at start of build?

29 views
Skip to first unread message

Andrew Coulton

unread,
May 30, 2013, 6:04:25 PM5/30/13
to jenkins...@googlegroups.com
Hi there,

I have a Jenkins server (v1.5.10) set up to run builds on remote slaves. My build is starting to get bigger, and I'm trying to shave time off it to reduce the feedback loop.

I've noticed that every build seems to have a delay of about 40 seconds at the beginning before it starts to checkout from git, as below:

00:00:00.000 Github pull request #69 of commit 6e9920cd8d49af9da20d5f9f18e4f3b33c3971f0 automatically merged.
00:00:00.508 Building remotely on ####### (i-145b3f5e) in workspace /var/jenkins/workspace/######
00:00:01.314 Checkout:##### / /var/jenkins/workspace/##### - hudson.remoting.Channel@af1257:#### dev-server build slave (i-145b3f5e)
00:00:01.314 Using strategy: Default
00:00:01.451 Last Built Revision: Revision 4256bc9e6338f975905ba09d3f47c407046e8215 (origin/pr/69/merge)
00:00:40.098 Fetching changes from 1 remote Git repository
00:00:40.114 Fetching upstream changes from g...@github.com:#####
00:00:46.039 Commencing build of Revision a7cc4e94e1a1a07b47542abf3273e30bc17150c8 (origin/pr/69/merge)
00:00:47.851 Merging Revision a7cc4e94e1a1a07b47542abf3273e30bc17150c8 (origin/pr/69/merge) onto master

Does anyone know what's happening during that time and if there's anything I can do to reduce the lag? I've had a look at various logs, and done some googling, but haven't been able to come up with any ideas.

Thanks,

Andrew


Mark Waite

unread,
May 30, 2013, 9:28:43 PM5/30/13
to jenkins...@googlegroups.com
A few wild guesses (not based on code knowledge, just speculation):

  • If the repository on the slave is being wiped each time you build, it might save time to skip the wipe and only clean instead of wiping
  • If the repository on the slave has not had "git gc" run recently and it has been there a long time with many commits, it might save time to run "git gc" in the slave repository
  • If the repository on github is large, it might save time to clone to a known location on the slave then use the "reference repo" argument to reference the existing local copies rather than copying from github each time
Mark Waite


From: Andrew Coulton <and...@ingenerator.com>
To: jenkins...@googlegroups.com
Sent: Thursday, May 30, 2013 4:04 PM
Subject: Can I reduce delay at start of build?

--
u received this message because you are subscribed to the Google Groups "Jenkins Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to jenkinsci-use...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.
 
 


Andrew Coulton

unread,
Jun 3, 2013, 4:57:26 AM6/3/13
to jenkins...@googlegroups.com
Thanks Mark,

We weren't wiping the slave repository, and I'd scheduled a git gc to run periodically though I ran one again. I've also tried using the reference repo on the last few builds with no appreciable difference. The delay seems to be coming before any of the git operations run (or at least that's the impression I have from the logs).

Anyone else any tips?

Thanks,

Andrew


--
You received this message because you are subscribed to a topic in the Google Groups "Jenkins Users" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/jenkinsci-users/idyFLfgBRjM/unsubscribe?hl=en.
To unsubscribe from this group and all its topics, send an email to jenkinsci-use...@googlegroups.com.

For more options, visit https://groups.google.com/groups/opt_out.
 
 



--
Andrew Coulton
Founder
inGenerator Ltd

Follow us on Twitter @inGenerator

inGenerator Ltd is a company registered in Scotland (no SC435161) with its registered office at 20A South Learmonth Gardens, Edinburgh, EH4 1EZ.

Mark Waite

unread,
Jun 3, 2013, 11:33:57 AM6/3/13
to jenkins...@googlegroups.com
Another wild guess...

If there is a lot of history in that job and one or more of your plugins requires loading all the history during the job start, it may be causing the lazy loading of job results to go into "worst case" behavior.  You could test that theory by copying the job to a new name and checking if the copied job starts significantly faster.

Mark Waite


Sent: Monday, June 3, 2013 2:57 AM
Subject: Re: Can I reduce delay at start of build?

You received this message because you are subscribed to the Google Groups "Jenkins Users" group.
Reply all
Reply to author
Forward
0 new messages