3 Replies Latest reply on Jul 11, 2016 8:21 AM by Wolf-Dieter Fink

    jboss 7.1.1 - Write DB connection pool usage, active sessions count, JVM memory usage to a log file

    syau Newbie

      JBoss - jboss-as-7.1.1.Final

      Java - 1.6

       

      My production JBoss sometimes loses database connection, I'm thinking of increasing

        Datasource connection pool

        and also JVM heap size

       

      Before doing that, I would like to write to a log file

        pool usage

        memory usage

        active users count

      so that I can use it for debug purposes.

       

      JConsole

      ----------------

      I could see active sessions count under

        'MBeans' tab - 'jboss.web' 'Manager' 'mywebapp' 'default-host' 'Attributes' 'activeSessions'

        I believe this session count is the count of users logged in (my program creates session once user logged in)

       

      But I couldn't see anywhere in JConsole the number of db pool connections in use, I checked under

        'MBeans' tab - 'jboss.as' 'datasources' 'mywebappDS' 'Attributes'

        nothing available here.

        Where can I find this in JConsole?

        At the same time, in JBoss management console, I could see under 'Pool Usage' tab, 'Active Count' and 'Max Used' - Is this

        the correct representation of pool usage?

       

      Anyway, my main requirement is to write to a log necessary stats. Can someone please let me know how I can log,

        db connection pool usage

        memory usage

        Users count