wikipedia

Support Wikipedia

Thursday, September 13, 2012

Improving performance of Jenkins

Jenkins slows down over a period of time. Builds start taking more time than usual. The start up time increases to manifolds. You may wonder that throwing in more memory to the Jenkins process or making the JVM process do garbage collection frequently, etc might make it better. But if that doesn't do the trick, then read on.

One way to check if builds in Jenkins are taking a long time is by running them outside of Jenkins. if you see a considerable difference in the times then Jenkins may be slowing down.

Here is a white paper on optimizing Jenkins written by it's creator with some really nice tips.

But in our case the real reason for the slow performance turned out to be the temp files! Jenkins creates a boatload of them, around 100s  (this depends on how many active jobs you have) each hour and doesn't bother to clean them up at all.

On windows platform  Jenkins writes to C:\Temp and on Linux it is /var/tmp. Luckily there is a plugin which can be configured to clean out these directories. For example you could setup the plugin to keep files which are a day old and get rid of the rest.

Try it out and see if that makes Jenkins sprint.

Sunday, September 9, 2012

Process Explorer for Windows

Task Manager has been the default process manager on windows systems for a long time and even today. Sysinternals, a company Microsoft acquired way back in 2006, has a suite of troubleshooting tools.The process monitor from Sysinternals called Process Explorer, is much more useful, cool and powerful than the good old windows Task manager.
You can see things like the runtime program directives, process tree and many more for a live process.
You could query a process, on which  files it has open or find out all processes that have a handle on a data file. Those are really helpful features for trouble shooting.

Here is a first look at process explorer



To look at the files that are used by a process, You can turn on process tree from the view menu.  Here is the process tree.





Further if you want to find the process holding on to a file then use the search feature and let's search for processes using java.exe

 That of course lists tons of processes. Now let's try a more refined search, for a log file.

There are many more useful features that you can explore further with Process Explorer. I always felt Process Explorer could be included  as part of the regular windows distribution!