Change number of threads for Jenkins server

12,926

http://winstone.sourceforge.net/#commandLine is the official command-line reference - but as I mention in the comment --handlerCountMax (or --handlerCountStartup, for that matter) did not seem to work for me. Try it yourself (here's how to run Jenkins in stand-alone mode).

You may want to try to reduce the number of executors as well as disabling plugins you do not need and see what happens.

Please keep in mind, however, that if you plan to continue using Jenkins seriously, you should plan for more resources, not less: as the number of your jobs grows, so will the resource utilization.

Share:
12,926
lszrh
Author by

lszrh

Updated on June 12, 2022

Comments

  • lszrh
    lszrh almost 2 years

    I installed Jenkins on my vserver. When I had a look at htop Jenkins was running with 30 thread, each was allowed to allocate 247MB memory and up to 1181MB virtual memory.

    Because I've only a small vserver I tried to change the number of threads. But I could not find any configuration file.

    I installed jenkins via aptitude install jenkins and in htop I can see that Jenkins is running from: /usr/bin/java -jar /usr/share/jenkins/jenkins.war

    Tomcat isn't installed as well as jetty isn't installed.

    Where is the information about the number of threads saved? Or how can I reduce the number of threads for Jenkins?

  • lszrh
    lszrh about 12 years
    I read something about --handlerCountMax=$JENKINS_HANDLER_MAX and --handlerCountIdle=$JENKINS_HANDLER_IDLE on serverfault.com/questions/278555/jenkins-use-it-with-ssl-htt‌​ps but it seems to do not work. I also tried this parameters in JAVA_ARGS but then Jenkins does not start... Another reference: issues.hudson-ci.org/browse/HUDSON-5753
  • malenkiy_scot
    malenkiy_scot about 12 years
    --handlerCountMax is not Java, but rather Winstone Servlet Container parameter - winstone.sourceforge.net/#commandLine. I tried running Jenkins in stand-alone mode with it, but it does not seem to do anything.
  • lszrh
    lszrh about 12 years
    1 job, installed plugins are: CheckStyle, CloverPHP, DRY, HTML Publisher, JDependend, Plot, PMD, Violations and xUnit. For me it doesn't matter if this job runs 1 minute or 30 minutes
  • Feasoron
    Feasoron about 12 years
    So we have many many more jobs and jobs, but a quick ps on the system is showing that we're not using anything near that. Is there a reason you are not deploying a .war to Tomcat or the like?
  • lszrh
    lszrh about 12 years
    I don't use Jenkins for a java project. The job checks a PHP project. And trying to use PMD runs the server out of memory. I disabled PMD, Plot, JDependend and HTML Publisher and for this configuration Jenkins "only" needs 357 MB of the memory without running a job. But running a job Jenkins still needs nearly 1 GB of the RAM and deallocates the memory back to ~ 360 MB.