4 Replies Latest reply on Feb 10, 2009 5:08 PM by Richard Taylor

    CLOSE_WAIT AJP connections

    Ramon Hermon Newbie

      I am hitting a wall and require some guidance. After many hrs I come to simplify my problem to keeping the 8009 connection in "K" state as reported by http:<server:8080>/web-console/status.
      1. What exactly is "Ready" state? My connections become useless once tag as Ready.
      2. How can I remove 8009 connections in CLOSE_WAIT state without restarting the jboss service?

      Here are the details of my findings (Apache/2.2.3, jboss-4.2.2.GA, CentOS 5.1 )
      1. Use mod_jk 1.2.26
      2. Use keepalive = true in the mod_jk configuration file (
      workers.properties)
      3. Adjust OS keepalive value to 600 secs ( /proc/sys/net/ipv4/tcp_keepalive_time )
      4. Do NOT use any other directives to try to maintain the connection alive, such as ping method or connection timeout.

      Summary:
      The problem occurred when the application server placed the connection in a "Ready" state. If the connection timeout was used in the JBoss AS server ( server.xml ) AJP connector declaration the keep alive value for the connection defaulted to the connection timeout value.
      Therefore a setting of 10mins for a connection timeout meant that after 10mins the connection will also be placed in a ready state and it will no longer be in "keep alive" state. Once the connection was placed in a ready state by JBoss the OS will report the connection in CLOSE_WAIT status, rendering the connection useless.
      The problem then became, how do I keep the connection in keep alive ? ( See Details above ).

        • 1. Re: CLOSE_WAIT AJP connections
          Jean-Frederic Clere Master

          Are you using APR (TC-native/JbossNative)?

          • 2. Re: CLOSE_WAIT AJP connections
            Ramon Hermon Newbie

            I will have to say no as my install consist of extracting jboss-4.2.2.GA.zip and configuring the default configuration.

            • 3. Re: CLOSE_WAIT AJP connections
              Ramon Hermon Newbie

              I decided to take a closer look at JBoss Native and here is what I did:
              downloaded JBoss Native 2.0.6 source
              the build generated jboss-native-2.0.6-src-ssl/output/jboss-native-2.0.6-linux2-x64.tar.gz which I extracted into a _tmp dir.
              created a $JBOSS_HOME/bin/native directory as the run.sh looks for it there.
              placed all the contents of _tmp/bin/META-INF/lib/linux2/x64/ in $JBOSS_HOME/bin/native/
              restarted the jboss service and:
              2009-01-15 13:57:47,724 INFO [org.jboss.wsf.stack.jbws.NativeServerConfig] JBoss Web Services - Native
              2009-01-15 13:57:47,724 INFO [org.jboss.wsf.stack.jbws.NativeServerConfig] jbossws-native-2.0.1.SP2 (build=200710210837)

              Now my connections as indicated by http://<server:8080>/web-console/status are in Ready state but the OS shows them as "ESTABLISHED keepalive" and the site is serving fine.

              Before installing native the "netstat -o|grep 8009" at the application server always showed the connection as "ESTABLISHED off" and not "ESTABLISHED keepalive".

              I guess I should have installed native from the beginning. I will keep a close eye on it.

              • 4. Re: CLOSE_WAIT AJP connections
                Richard Taylor Newbie

                FYI The issues you ran into were likely the result of this https://jira.jboss.org/jira/browse/JBPAPP-366 . The issue has been fixed but the fix is not in JBoss 4.2.3 (and presumably not 4.2.2). We ran into the exact same problem and went with JBoss Native as well.