<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: Too many CLOSED_WAIT connections in Operating System - Linux</title>
    <link>https://community.hpe.com/t5/operating-system-linux/too-many-closed-wait-connections/m-p/5362773#M53268</link>
    <description>&lt;P&gt;Get your application fixed.(There used to be some JVM bugs in Java 1.4.x.x related to this, but I think they have been fixed a long time ago.)&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;CLOSE_WAIT means the remote side has reported it's closing the remote-&amp;gt;local side of the connection (i.e. the remote won't send any more data) but the local application has not told the OS to close the local-&amp;gt;remote side. This is called a "half-closed" TCP connection and it's the only way to implement a one-way TCP connection, should you need one.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The application can legitimately keep a socket in CLOSE_WAIT as long as it wants, to allow it to complete whatever data transmission it has to do. So there are no OS-level timers that would force the connection to close.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Forcing the connections to close by sysadmin command would be about the networking equivalent of truncating some files the application has open for writing: although the results probably won't be as dire, you should understand this is not something you should be doing.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;If your application uses the HttpURLConnection class, explicitly calling its disconnect() method would be a good thing.&lt;/P&gt;&lt;P&gt;If you're using the URLConnection.getInputStream() or getOutputStream(), use the close() method of the stream. If your application uses the Socket class, then remember to close() the socket.&lt;/P&gt;</description>
    <pubDate>Fri, 14 Oct 2011 23:02:34 GMT</pubDate>
    <dc:creator>Matti_Kurkela</dc:creator>
    <dc:date>2011-10-14T23:02:34Z</dc:date>
    <item>
      <title>Too many CLOSED_WAIT connections</title>
      <link>https://community.hpe.com/t5/operating-system-linux/too-many-closed-wait-connections/m-p/5362387#M53264</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I am running JBOSS 6 ona RHEL5 server put it continuously crashes due to the number of CLOSE_WAIT connections on port 8080.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;How can I kill the several hundred CLOSE_WAIT connections without killing the actual live "LISTENING" connection?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;R,&lt;/P&gt;&lt;P&gt;D.&lt;/P&gt;</description>
      <pubDate>Fri, 14 Oct 2011 14:33:11 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/too-many-closed-wait-connections/m-p/5362387#M53264</guid>
      <dc:creator>Duffster</dc:creator>
      <dc:date>2011-10-14T14:33:11Z</dc:date>
    </item>
    <item>
      <title>Re: Too many CLOSED_WAIT connections</title>
      <link>https://community.hpe.com/t5/operating-system-linux/too-many-closed-wait-connections/m-p/5362773#M53268</link>
      <description>&lt;P&gt;Get your application fixed.(There used to be some JVM bugs in Java 1.4.x.x related to this, but I think they have been fixed a long time ago.)&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;CLOSE_WAIT means the remote side has reported it's closing the remote-&amp;gt;local side of the connection (i.e. the remote won't send any more data) but the local application has not told the OS to close the local-&amp;gt;remote side. This is called a "half-closed" TCP connection and it's the only way to implement a one-way TCP connection, should you need one.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The application can legitimately keep a socket in CLOSE_WAIT as long as it wants, to allow it to complete whatever data transmission it has to do. So there are no OS-level timers that would force the connection to close.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Forcing the connections to close by sysadmin command would be about the networking equivalent of truncating some files the application has open for writing: although the results probably won't be as dire, you should understand this is not something you should be doing.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;If your application uses the HttpURLConnection class, explicitly calling its disconnect() method would be a good thing.&lt;/P&gt;&lt;P&gt;If you're using the URLConnection.getInputStream() or getOutputStream(), use the close() method of the stream. If your application uses the Socket class, then remember to close() the socket.&lt;/P&gt;</description>
      <pubDate>Fri, 14 Oct 2011 23:02:34 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/too-many-closed-wait-connections/m-p/5362773#M53268</guid>
      <dc:creator>Matti_Kurkela</dc:creator>
      <dc:date>2011-10-14T23:02:34Z</dc:date>
    </item>
  </channel>
</rss>

