<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<html>
<body link="#355491" alink="#4262a1" vlink="#355491" style="background: #e2e2e2; margin: 0; padding: 20px;">

<div>
        <table cellpadding="0" bgcolor="#FFFFFF" border="0" cellspacing="0" style="border: 1px solid #dadada; margin-bottom: 30px; width: 100%; -moz-border-radius: 6px; -webkit-border-radius: 6px;">
                <tbody>
                        <tr>

                                <td>

                                        <table border="0" cellpadding="0" cellspacing="0" bgcolor="#FFFFFF" style="border: solid 2px #ccc; background: #dadada; width: 100%; -moz-border-radius: 6px; -webkit-border-radius: 6px;">
                                                <tbody>
                                                        <tr>
                                                                <td bgcolor="#000000" valign="middle" height="58px" style="border-bottom: 1px solid #ccc; padding: 20px; -moz-border-radius-topleft: 3px; -moz-border-radius-topright: 3px; -webkit-border-top-right-radius: 5px; -webkit-border-top-left-radius: 5px;">
                                                                        <h1 style="color: #333333; font: bold 22px Arial, Helvetica, sans-serif; margin: 0; display: block !important;">
                                                                        <!-- To have a header image/logo replace the name below with your img tag -->
                                                                        <!-- Email clients will render the images when the message is read so any image -->
                                                                        <!-- must be made available on a public server, so that all recipients can load the image. -->
                                                                        <a href="http://community.jboss.org/index.jspa" style="text-decoration: none; color: #E1E1E1">JBoss Community</a></h1>
                                                                </td>

                                                        </tr>
                                                        <tr>
                                                                <td bgcolor="#FFFFFF" style="font: normal 12px Arial, Helvetica, sans-serif; color:#333333; padding: 20px;  -moz-border-radius-bottomleft: 4px; -moz-border-radius-bottomright: 4px; -webkit-border-bottom-right-radius: 5px; -webkit-border-bottom-left-radius: 5px;"><h3 style="margin: 10px 0 5px; font-size: 17px; font-weight: normal;">
    Large number of threads/connections marked "keep alive"
</h3>
<span style="margin-bottom: 10px;">
    created by <a href="http://community.jboss.org/people/benhsu_at_bluefly">Ben Hsu</a> in <i>Performance Tuning</i> - <a href="http://community.jboss.org/message/587341#587341">View the full discussion</a>
</span>
<hr style="margin: 20px 0; border: none; background-color: #dadada; height: 1px;">

<div class="jive-rendered-content"><p>Hello</p><p style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</p><p>We're seeing an issue where the performance of our application would degrade over time, to the point where its unresponsive. Based on what I see, I think it might be related to how we're configuring keep-alive, and I'm wondering where I can find more information about configuring keep-alive in JBoss.</p><p style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</p><p>The symptoms:</p><p> - The application's performance would degrade over the day </p><p>- eventually we will get a message saying "all 200 threads are busy, please increase the maximum thread count"</p><p> - at this point, doing a thread dump (using "kill -3") shows many threads in the following state:</p><p>&lt;blockquote&gt;</p><p>"TP-Processor200" daemon prio=1 tid=0x0000002b31e372c0 nid=0x651a runnable [0x000000005408e000..0x000000005408ec30]</p><p>&#160;&#160;&#160;&#160; &#160;&#160;&#160;&#160;&#160;at java.net.SocketInputStream.socketRead0(Native Method)</p><p>&#160;&#160;&#160;&#160; &#160;&#160;&#160;&#160;&#160;at java.net.SocketInputStream.read(SocketInputStream.java:129)</p><p>&#160;&#160;&#160;&#160; &#160;&#160;&#160;&#160;&#160;at java.io.BufferedInputStream.fill(BufferedInputStream.java:218)</p><p>&#160;&#160;&#160;&#160; &#160;&#160;&#160;&#160;&#160;at java.io.BufferedInputStream.read1(BufferedInputStream.java:256)</p><p>&#160;&#160;&#160;&#160; &#160;&#160;&#160;&#160;&#160;at java.io.BufferedInputStream.read(BufferedInputStream.java:313)</p><p>&#160;&#160;&#160;&#160; &#160;&#160;&#160;&#160;&#160;- locked &lt;0x0000002b082abec0&gt; (a java.io.BufferedInputStream)</p><p>&#160;&#160;&#160;&#160; &#160;&#160;&#160;&#160;&#160;at org.apache.jk.common.ChannelSocket.read(ChannelSocket.java:620)</p><p>&#160;&#160;&#160;&#160; &#160;&#160;&#160;&#160;&#160;at org.apache.jk.common.ChannelSocket.receive(ChannelSocket.java:558)</p><p>&#160;&#160;&#160;&#160; &#160;&#160;&#160;&#160;&#160;at org.apache.jk.common.ChannelSocket.processConnection(ChannelSocket.java:685)</p><p>&#160;&#160;&#160;&#160; &#160;&#160;&#160;&#160;&#160;at org.apache.jk.common.ChannelSocket$SocketConnection.runIt(ChannelSocket.java:889)</p><p>&#160;&#160;&#160;&#160; &#160;&#160;&#160;&#160;&#160;at org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:684)</p><p>&#160;&#160;&#160;&#160; &#160;&#160;&#160;&#160;&#160;at java.lang.Thread.run(Thread.java:595)</p><p>&lt;/blockquote&gt;</p><p> - when I look at the "connection scoreboard" in the JBoss web console, I see 200 connections marked with a "K" for "keep alive", also these connections look like they've been around for a long time (around 7,000,000ms, which will be 2 hours), long after we've killed all the clientsd</p><p style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</p><p>Based on what I saw above and some googling, I'm thinking this might be related to how we're configuring keep alive. I haven't been able to go further than this, because I don't know much about JBoss configuration. Does anybody have any information about how keep alive is being configured in JBoss?</p><p style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</p><p>We are using JBoss version 4.0.5 GA</p><p style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</p><p>Thank you!</p></div>

<div style="background-color: #f4f4f4; padding: 10px; margin-top: 20px;">
    <p style="margin: 0;">Reply to this message by <a href="http://community.jboss.org/message/587341#587341">going to Community</a></p>
        <p style="margin: 0;">Start a new discussion in Performance Tuning at <a href="http://community.jboss.org/choose-container!input.jspa?contentType=1&containerType=14&container=2078">Community</a></p>
</div></td>
                        </tr>
                    </tbody>
                </table>


                </td>
            </tr>
        </tbody>
    </table>

</div>

</body>
</html>