7 Ways to Optimize Hudson in Production


Published on

CloudBees' webinar slides: 7 Ways to Optimize Hudson in Production. Webinar delivered by Kohsuke Kawaguchi - the founder of Hudson.

Video of the Webinar available on http://www.youtube.com/cloudbeestv

Published in: Technology
  • Be the first to comment

No Downloads
Total views
On SlideShare
From Embeds
Number of Embeds
Embeds 0
No embeds

No notes for slide

7 Ways to Optimize Hudson in Production

  1. 1. 7 Ways To Optimize Hudson/Jenkinsfor Production Installation<br />Kohsuke Kawaguchi<br />Creator of the Hudson project<br />©2011 Cloud Bees, Inc. All Rights Reserved<br />
  2. 2. ©2011 Cloud Bees, Inc. All Rights Reserved<br />About CloudBees<br />Our Mission<br />Become the leading Java™ Platform as a Service (PaaS)<br />Why We’re Different<br />CloudBees services the complete lifecycle of Cloud application development and deployment.No Servers. No Virtual Machines. No IT.<br /><ul><li>DEV@cloud – Cloud Services for Developers
  3. 3. RUN@cloud–Frictionless runtime PaaS for Java apps</li></ul>Strategy<br />
  4. 4. Benefits of DEV@cloud Hudson Service:<br />Scaleyour Hudson environment with the power of the Cloud<br />Easeyour Hudson management overhead<br />Speedyour Hudson builds<br />Save money with on-demand Hudson Service.<br />©2011 Cloud Bees, Inc. All Rights Reserved<br />Continuous Integration - Hudson<br />Nectar – On-Premise Enterprise Hudson<br />Support from the Hudson experts.<br />VMwarescale your Hudson environment.<br />Enterprise Featuresextend Hudson for large environments.<br />Integrate with the Cloud integration with DEV@Cloud and RUN@Cloud coming<br />Hudson Adoption, by Builds<br />Source: Hudson Labs<br />
  5. 5. 7 relatively easy techniques you can apply today<br />It helps to spend some time setting it up “right”<br />Even if Hudson is easy enough to deploy<br />Especially for serious production use<br />It’s not too late even if you are already running Hudson<br />Idea Behind This Webinar<br />©2011 CloudBees, Inc. All Rights Reserved<br />
  6. 6. Better late than never<br />Useful for<br />Disaster recovery<br />Accidental configuration changes<br />#1: Backup<br />
  7. 7. Everything is under $HUDSON_HOME<br />Check system config to see where it is<br />No need to backup slaves<br />Live vs offline<br />Live backup is OK<br />Configuration writes are atomic<br />#1: Backup Planning<br />
  8. 8. /war (exploded war)<br />/cache (downloaded tools)<br />/tools (extracted tools)<br />/jobs/*<br />builds (build records)<br />builds/*/archive (archived artifacts)<br />workspace<br />#1: Subsetting backup<br />
  9. 9. File system-level snapshot for maximum consistency<br />LVM<br />Other storage-level snapshots<br />Don’t forget fsfreeze<br />ZFS, if you are on Solaris<br />Incremental, too<br />Nectar can help you<br />#1: More on backup<br />
  10. 10. Just copy it somewhere and “java -jar hudson.war --httpPort=9999”<br />HUDSON_HOME is relocateable<br />#1: Testing restore<br />
  11. 11. Prepare for disk usage growth<br />Especially when you start to host jobs from people who aren’t close to you<br />Make sure you can throw more disks at the problem later<br />No need to waste money on 15000rpm SCSI disks<br />But bigger disk is nice<br />#2: Disk<br />
  12. 12. “Spanned volume” on Windows<br />LVM on Linux<br />This needs the most upfront planning<br />ZFS<br />Shame there’s no viable free Solaris flavor<br />$HUDSON_HOME should be its own FS<br />If it’s too late, symlink is your friend<br />#2: Expandable volume<br />
  13. 13. Comes in .deb/.rpm<br />Much easier to install/upgrade<br />Reproducible<br />init script & daemon user<br />Configuration in<br />/etc/default/hudson<br />/etc/sysconfig/hudson<br />Windows --- work in progress<br />Existing $HUDSON_HOME can be migrated<br />#3: Native packages<br />
  14. 14. You will grow beyond a single system<br />Load is not the only factor<br />Better isolation between builds<br />Diversity in the test/build platform<br />Cheaper to scale horizontally<br />Let Hudson use multiple computers<br />#4: Distributed builds<br />
  15. 15. Demo<br />
  16. 16. Let master launch slaves (if you can)<br />Via SSH or DCOM<br />Easier to keep the cluster up & running<br />It’s amazing how easily a computer gets sick<br />Set up SSH public key authentication<br />Login to systems without typing password<br />Must-have! Inexcusable!<br />Only takes 5 minutes or so to set up<br />#4: Slave reconnectivity<br />
  17. 17. Treat build machines like livestock, not like pets<br />Don’t tie builds to specific build machine<br />Build machines should be interchangeable<br />Labels, instead of names<br />Tag slaves by their capabilities/environments<br />Jobs can be tied to boolean expression of labels<br />Better resource utilization, manageability<br />#5: Labels<br />
  18. 18. Demo<br />
  19. 19. If your users can’t see Hudson, much of the benefit is lost<br />Make the URL easier to remember<br />#6: Invest in good URL<br />http://sca14-3530.sca.cloudbees.com:8080/hudson/<br />http://hudson.cloudbees.com/<br />
  20. 20. Get the host alias, instead of using primary machine name<br />If your IT isn’t helping, use dynamic DNS<br />This also makes your service relocatable<br />#6: Use service name<br />
  21. 21. Apache reverse proxy<br />Let you run Hudson in non-root, too<br />For Windows<br />IIS7+URL Rewrite+Application Request Routing<br />#6: Share port 80 with other apps<br />Apache<br />Hudson<br />browser<br />
  22. 22. Use virtual host to distinguish multiple apps, not context path<br />#6: No “/hudson”<br />Hudson<br />Apache / IIS<br />browser<br />Redmine<br />http://hudson.cloudbees.com/<br />http://redmine.cloudbees.com/<br />
  23. 23. Discard old build records if you can<br />Helps start-up time, memory usage<br />Often feasible, for example CI builds<br />Setting is per-project basis<br />The point is to avoid unbounded consumption. Don’t go overboard<br />#7: Keeping build records under control<br />
  24. 24. Demo<br />
  25. 25. 7 tips<br />Backup<br />Disk planning<br />Native packages<br />Distributed builds<br />Labels<br />Reverse proxy<br />Discard build records<br />Conclusion<br />
  26. 26. CloudBees<br />http://www.cloudbees.com/<br />Nectar<br />http://nectar.cloudbees.com/<br />Try Dev@Cloud<br />https://grandcentral.cloudbees.com/account/signup<br />Register for news from CloudBees<br />http://www.cloudbees.com/company.cb<br />CloudBees on YouTube: new videos soon<br />http://www.youtube.com/user/CloudBeesTV<br />CloudBees Resources<br />
  27. 27. Instructor-led<br />More comprehensive, all-round<br />London, New York, and Tokyo<br />To receive updates:<br />http://www.cloudbees.com/company.cb<br />Coming Soon: 1 Day Hudson Training<br />
  28. 28. Q&A<br />©2011 CloudBees, Inc. All Rights Reserved<br />