glassfish
  1. glassfish
  2. GLASSFISH-16254

CountOpenConnections in Connection Queue Statistics is extremely high

    Details

    • Type: Bug Bug
    • Status: Resolved
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: v3.0.1
    • Fix Version/s: 3.1.1_b11
    • Component/s: web_container
    • Labels:
      None
    • Environment:

      Linux 64 bit Ubuntu

      Description

      For a high-traffic site, I have monitoring enabled for ThreadPool, HTTP Service (and Web Container).
      After some hours, the system is low on memory. Cleaning all application-specific caches showed that java.util.concurrent.ConcurrentHashMap$HashEntry is the biggest memory consumer, with about 6 million instances, consuming about 240MB memory.
      Inspecting a sample of those instances showed that most of them belong to com.sun.enterprise.v3.services.impl.monitor.stats.ConnectionQueueStatsProvider.openConnectionsCount, which is a ConcurrentHashMap<Integer, Long>().
      I checked this code, and it seems that connectionIds are added via @ProbeListener ("... connectionAcceptedEvent") and they are removed from the map via @ProbeListener ("... connectionClosedEvent")

      The monitor-stats show that at a given moment, the CountOpenConnections = 6,600,129, the countTotalConnections = 6,600,129 and the CountTotalQueued = 7,497,644

      However, there are (fortunately) only about 10 active connections at the same moment. It seems to me the connectionClosedEvent is not always generated?

        Activity

        Hide
        oleksiys added a comment -

        patch

        Show
        oleksiys added a comment - patch
        Hide
        oleksiys added a comment -

        attaching simple patch, which fixes the issue

        Show
        oleksiys added a comment - attaching simple patch, which fixes the issue
        Hide
        oleksiys added a comment -
        • Why fix this issue in 3.1.1?
          Monitoring issue, the fix is pretty small and simple.

        -Which is the targeted build of 3.1.1 for this fix?
        b11

        • Do regression tests exist for this issue?
          No, it's only monitoring related. Possible impact is minimal.
        • Which tests should QA (re)run to verify the fix did not destabilize GlassFish?
          Quicklook
        Show
        oleksiys added a comment - Why fix this issue in 3.1.1? Monitoring issue, the fix is pretty small and simple. -Which is the targeted build of 3.1.1 for this fix? b11 Do regression tests exist for this issue? No, it's only monitoring related. Possible impact is minimal. Which tests should QA (re)run to verify the fix did not destabilize GlassFish? Quicklook
        Hide
        Alexis MP added a comment -

        (in addition to Oleksiys' comment) :

        • Why fix this issue in 3.1.1?
          This is a community-reported (and fully documented) issue.
        Show
        Alexis MP added a comment - (in addition to Oleksiys' comment) : Why fix this issue in 3.1.1? This is a community-reported (and fully documented) issue.
        Hide
        oleksiys added a comment -

        fixed

        Project: glassfish
        Repository: svn
        Revision: 47923
        Author: oleksiys
        Date: 2011-07-08 09:25:20 UTC
        Link:

        Log Message:
        ------------
        + fix issue #16254
        http://java.net/jira/browse/GLASSFISH-16254

        "CountOpenConnections in Connection Queue Statistics is extremely high"

        approved by Sathyan

        Show
        oleksiys added a comment - fixed Project: glassfish Repository: svn Revision: 47923 Author: oleksiys Date: 2011-07-08 09:25:20 UTC Link: Log Message: ------------ + fix issue #16254 http://java.net/jira/browse/GLASSFISH-16254 "CountOpenConnections in Connection Queue Statistics is extremely high" approved by Sathyan

          People

          • Assignee:
            oleksiys
            Reporter:
            johanvos
          • Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved: