Uploaded image for project: 'Jenkins'
  1. Jenkins
  2. JENKINS-18366

Jetty should be used rather than Winstone for embedded deployments

    • Icon: Improvement Improvement
    • Resolution: Fixed
    • Icon: Major Major
    • core
    • None

      Hudson recently switched to using Jetty as an embedded servlet engine. It has a very small size, and very very good performance.
      Put bluntly, the current use of Winstone SUCKS, and due to its threaded design will cause performance to slow to a crawl at 240+ requests a minute even on high end hardware with aggressive varnish caching. At the same time using an external Java EE container isn't that easy, so by following hudson and switching to Jetty we get the best of both worlds.

      Thanks
      md_5

          [JENKINS-18366] Jetty should be used rather than Winstone for embedded deployments

          Hi Jason,

          We ran into the same issue as you with Ubuntu 11.04. What ended up working was the following:

          1. Create (or choose) a directory where you want to have the WAR be extracted, and make sure the "jenkins" user has R/W access to it. We ended up using $JENKINS_HOME/tmp

          2. Modify the /etc/default/jenkins file to specify the java.io.tmpdir option as an argument to starting Jenkins. For example something like:

          JAVA_ARGS="-Djava.io.tmpdir=$JENKINS_HOME/tmp"

          3. Restart Jenkins

          dev @ doxo.com added a comment - Hi Jason, We ran into the same issue as you with Ubuntu 11.04. What ended up working was the following: 1. Create (or choose) a directory where you want to have the WAR be extracted, and make sure the "jenkins" user has R/W access to it. We ended up using $JENKINS_HOME/tmp 2. Modify the /etc/default/jenkins file to specify the java.io.tmpdir option as an argument to starting Jenkins. For example something like: JAVA_ARGS="-Djava.io.tmpdir=$JENKINS_HOME/tmp" 3. Restart Jenkins

          I have the same error with our Jenkins after an upgrade to 1.539. It extract the war file into our /tmp folder but this one is cleaned by some other process and I can't guarantee that all files will not be deleted... This is a horrible behavior for us and so, it's blocker.

          Nov 20, 2013 3:29:14 PM org.eclipse.jetty.util.log.JavaUtilLog info
          INFO: jetty-8.y.z-SNAPSHOT
          Nov 20, 2013 3:29:14 PM org.eclipse.jetty.util.log.JavaUtilLog info
          INFO: Extract jar:file:/usr/lib/jenkins/jenkins.war!/ to /tmp/jetty-0.0.0.0-8181-jenkins.war-_jenkins-any-/webapp
          Nov 20, 2013 3:29:16 PM org.eclipse.jetty.util.log.JavaUtilLog info
          INFO: NO JSP Support for /jenkins, did not find org.apache.jasper.servlet.JspServlet
          Jenkins home directory: /data/jenkins found at: System.getProperty("JENKINS_HOME")

          @dev, I have try to use your solution and I define another tmp folder for Jenkins but it still extract its war file into our /tmp folder.

          Here an echo of my command line exectuded when I start the service.

          Starting Jenkins
          JAVA_CMD : /usr/java/java6/bin/java -Djava.awt.headless=true -XX:MaxPermSize=512M -Xms512m -Xmx4096m -DJENKINS_HOME=/data/jenkins -jar /usr/lib/jenkins/jenkins.war
          PARAMS : --logfile=/data/logs/jenkins/jenkins.log --webroot=/data/jenkins/war --daemon --httpPort=8181 --ajp13Port=8010 --debug=5 --handlerCountMax=100 --handlerCountMaxIdle=20 -Djava.io.tmpdir=/data/jenkins/tmp --prefix=/jenkins --accessLoggerClassName=winstone.accesslog.SimpleAccessLogger --simpleAccessLogger.format=combined --simpleAccessLogger.file=/var/log/jenkins/access_log

          Thx for any help

          Benjamin Dewez added a comment - I have the same error with our Jenkins after an upgrade to 1.539. It extract the war file into our /tmp folder but this one is cleaned by some other process and I can't guarantee that all files will not be deleted... This is a horrible behavior for us and so, it's blocker. Nov 20, 2013 3:29:14 PM org.eclipse.jetty.util.log.JavaUtilLog info INFO: jetty-8.y.z-SNAPSHOT Nov 20, 2013 3:29:14 PM org.eclipse.jetty.util.log.JavaUtilLog info INFO: Extract jar: file:/usr/lib/jenkins/jenkins.war!/ to /tmp/jetty-0.0.0.0-8181-jenkins.war-_jenkins-any-/webapp Nov 20, 2013 3:29:16 PM org.eclipse.jetty.util.log.JavaUtilLog info INFO: NO JSP Support for /jenkins, did not find org.apache.jasper.servlet.JspServlet Jenkins home directory: /data/jenkins found at: System.getProperty("JENKINS_HOME") @dev, I have try to use your solution and I define another tmp folder for Jenkins but it still extract its war file into our /tmp folder. Here an echo of my command line exectuded when I start the service. Starting Jenkins JAVA_CMD : /usr/java/java6/bin/java -Djava.awt.headless=true -XX:MaxPermSize=512M -Xms512m -Xmx4096m -DJENKINS_HOME=/data/jenkins -jar /usr/lib/jenkins/jenkins.war PARAMS : --logfile=/data/logs/jenkins/jenkins.log --webroot=/data/jenkins/war --daemon --httpPort=8181 --ajp13Port=8010 --debug=5 --handlerCountMax=100 --handlerCountMaxIdle=20 -Djava.io.tmpdir=/data/jenkins/tmp --prefix=/jenkins --accessLoggerClassName=winstone.accesslog.SimpleAccessLogger --simpleAccessLogger.format=combined --simpleAccessLogger.file=/var/log/jenkins/access_log Thx for any help

          Hi Benjamin,

          Looks like you are passing the "-Djava.io.tmpdir" argument to the Servlet container, not to the Java runtime. That "-D" argument needs to be a part of JAVA_CMD.

          dev @ doxo.com added a comment - Hi Benjamin, Looks like you are passing the "-Djava.io.tmpdir" argument to the Servlet container, not to the Java runtime. That "-D" argument needs to be a part of JAVA_CMD.

          Alex Ouzounis added a comment - - edited

          Hi,

          Just to add my observations here.

          Following the instructions from dev #comment-189758 the issue is gone for my Jenkins 1.539 installation.
          The only thing to add is make sure that the JENKINS_HOME var is defined before the JAVA_ARGS var.

          Alex

          Alex Ouzounis added a comment - - edited Hi, Just to add my observations here. Following the instructions from dev #comment-189758 the issue is gone for my Jenkins 1.539 installation. The only thing to add is make sure that the JENKINS_HOME var is defined before the JAVA_ARGS var. Alex

          @dev, Oh my god, you right ! I define this property into the JENKINS_ARGS and no JAVA_ARGS. I fix this error tomorrow and I keep you aware of the result. Thx

          Benjamin Dewez added a comment - @dev, Oh my god, you right ! I define this property into the JENKINS_ARGS and no JAVA_ARGS. I fix this error tomorrow and I keep you aware of the result. Thx

          Hi,
          I am having trouble getting the Jenkins webpage up using a Solaris 10 server (JRE 1.6.0_26-b03).
          The log shows Jenkins started successfully (Jenkins is fully up and running).
          However when I try to connect using a web browser (tried IE and Firefox from Jenkins server localhost and remote machines) it hangs indefinitely.
          Checking netstat shows the connection is ESTABLISHED.
          All versions of Jenkins prior to 1.535 work perfectly under Solaris 10 and no versions after 1.534 work.
          So I can only assume it was the introduction of Jetty in 1.535 that has caused this issue.
          Cheers,
          Josh

          Joshua Wherrett added a comment - Hi, I am having trouble getting the Jenkins webpage up using a Solaris 10 server (JRE 1.6.0_26-b03). The log shows Jenkins started successfully (Jenkins is fully up and running). However when I try to connect using a web browser (tried IE and Firefox from Jenkins server localhost and remote machines) it hangs indefinitely. Checking netstat shows the connection is ESTABLISHED. All versions of Jenkins prior to 1.535 work perfectly under Solaris 10 and no versions after 1.534 work. So I can only assume it was the introduction of Jetty in 1.535 that has caused this issue. Cheers, Josh

          S Stack added a comment -

          Solaris 10: CLI broken at Jenkins 1.535+

          @Josh, we're running Solaris 10 and while the Jenkins UI appears to work just fine in 1.535 and above, the CLI hangs:

          java -jar 1.538/WEB-INF/jenkins-cli.jar -s http://cits.icc.intcx.net:8080 version
          
          Exception in thread "main" java.net.SocketTimeoutException: connect timed out
                  at java.net.PlainSocketImpl.socketConnect(Native Method)
                  at java.net.AbstractPlainSocketImpl.doConnect(AbstractPlainSocketImpl.java:327)
                  at java.net.AbstractPlainSocketImpl.connectToAddress(AbstractPlainSocketImpl.java:193)
                  at java.net.AbstractPlainSocketImpl.connect(AbstractPlainSocketImpl.java:180)
                  at java.net.SocksSocketImpl.connect(SocksSocketImpl.java:385)
                  at java.net.Socket.connect(Socket.java:546)
                  at hudson.cli.CLI.connectViaCliPort(CLI.java:211)
                  at hudson.cli.CLI.<init>(CLI.java:134)
                  at hudson.cli.CLIConnectionFactory.connect(CLIConnectionFactory.java:72)
                  at hudson.cli.CLI._main(CLI.java:469)
                  at hudson.cli.CLI.main(CLI.java:384)
          

          Observations

          • Jetty is unpacked to the -Djava.io.tmpdir directory regardless of setting -DJETTY_HOME=/some/dir/.
          • JNLP port is enabled; setting this to either random or a fixed port did not address the CLI timeout.

          S Stack added a comment - Solaris 10: CLI broken at Jenkins 1.535+ Per https://issues.jenkins-ci.org/browse/JENKINS-20128?focusedCommentId=188660&page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#comment-188660 , CLI works fine up to and including 1.534 @Josh, we're running Solaris 10 and while the Jenkins UI appears to work just fine in 1.535 and above, the CLI hangs: java -jar 1.538/WEB-INF/jenkins-cli.jar -s http: //cits.icc.intcx.net:8080 version Exception in thread "main" java.net.SocketTimeoutException: connect timed out at java.net.PlainSocketImpl.socketConnect(Native Method) at java.net.AbstractPlainSocketImpl.doConnect(AbstractPlainSocketImpl.java:327) at java.net.AbstractPlainSocketImpl.connectToAddress(AbstractPlainSocketImpl.java:193) at java.net.AbstractPlainSocketImpl.connect(AbstractPlainSocketImpl.java:180) at java.net.SocksSocketImpl.connect(SocksSocketImpl.java:385) at java.net.Socket.connect(Socket.java:546) at hudson.cli.CLI.connectViaCliPort(CLI.java:211) at hudson.cli.CLI.<init>(CLI.java:134) at hudson.cli.CLIConnectionFactory.connect(CLIConnectionFactory.java:72) at hudson.cli.CLI._main(CLI.java:469) at hudson.cli.CLI.main(CLI.java:384) Observations Jetty is unpacked to the -Djava.io.tmpdir directory regardless of setting -DJETTY_HOME=/some/dir/ . JNLP port is enabled; setting this to either random or a fixed port did not address the CLI timeout.

          Jesse Glick added a comment -

          @maschuru

          migration to jetty seem to ignore JENKINS_HOME

          File a separate bug (with a JIRA link) please. Do not reopen this one.

          Jesse Glick added a comment - @maschuru migration to jetty seem to ignore JENKINS_HOME File a separate bug (with a JIRA link) please. Do not reopen this one.

          Code changed in jenkins
          User: Kohsuke Kawaguchi
          Path:
          pom.xml
          war/pom.xml
          http://jenkins-ci.org/commit/jenkins/2394c0cd0e233449c85da3bc75628420a2b07a05
          Log:
          [FIXED JENKINS-18366] Winstone is now powered by Jetty

          (cherry picked from commit b19f4650d7cc146e28398a33ad0625d46991e27f)

          Conflicts:
          changelog.html
          war/pom.xml

          SCM/JIRA link daemon added a comment - Code changed in jenkins User: Kohsuke Kawaguchi Path: pom.xml war/pom.xml http://jenkins-ci.org/commit/jenkins/2394c0cd0e233449c85da3bc75628420a2b07a05 Log: [FIXED JENKINS-18366] Winstone is now powered by Jetty (cherry picked from commit b19f4650d7cc146e28398a33ad0625d46991e27f) Conflicts: changelog.html war/pom.xml

          dogfood added a comment -

          Integrated in jenkins_main_trunk #3787
          [FIXED JENKINS-18366] Winstone is now powered by Jetty (Revision 2394c0cd0e233449c85da3bc75628420a2b07a05)

          Result = SUCCESS
          jesse glick : 2394c0cd0e233449c85da3bc75628420a2b07a05
          Files :

          • war/pom.xml
          • pom.xml

          dogfood added a comment - Integrated in jenkins_main_trunk #3787 [FIXED JENKINS-18366] Winstone is now powered by Jetty (Revision 2394c0cd0e233449c85da3bc75628420a2b07a05) Result = SUCCESS jesse glick : 2394c0cd0e233449c85da3bc75628420a2b07a05 Files : war/pom.xml pom.xml

            Unassigned Unassigned
            md_5 Michael D
            Votes:
            10 Vote for this issue
            Watchers:
            24 Start watching this issue

              Created:
              Updated:
              Resolved: