6 Replies Latest reply on May 17, 2016 9:45 PM by emag

    Empty pool statistics after moving to Wildfly 10

    aalang

      Hello,

       

      In a Wildfly 8 application we run, from the jboss-cli, if I run:

      /subsystem=datasources/xa-data-source=<jndi-name>:read-resource(include-runtime=true,recursive=true)

      I get pool statistics.

       

      In a version we have that is using Wildfly 10, and I run (in the new version, the datasource isn't an xa):

      /subsystem=datasources/data-source=<jndi-name>:read-resource(include-runtime=true,recursive=true)

       

      I get and haven't been able to figure out if it is a config value I need to turn on somewhere, the command structure is different or something else:

      {

          "outcome" => "success",

          "result" => {

              "allocation-retry" => undefined,

              "allocation-retry-wait-millis" => undefined,

              "allow-multiple-users" => false,

              "background-validation" => undefined,

              "background-validation-millis" => undefined,

              "blocking-timeout-wait-millis" => undefined,

              "capacity-decrementer-class" => undefined,

              "capacity-decrementer-properties" => undefined,

              "capacity-incrementer-class" => undefined,

              "capacity-incrementer-properties" => undefined,

              "check-valid-connection-sql" => "/* ping */ SELECT 1",

              "connectable" => false,

              "connection-listener-class" => undefined,

              "connection-listener-property" => undefined,

              "connection-url" => "jdbc:mysql://localhost:3306/production",

              "datasource-class" => undefined,

              "driver-class" => undefined,

              "driver-name" => "mysql",

              "enabled" => true,

              "enlistment-trace" => true,

              "exception-sorter-class-name" => "org.jboss.jca.adapters.jdbc.extensions.mysql.MySQLExceptionSorter",

              "exception-sorter-properties" => undefined,

              "flush-strategy" => undefined,

              "idle-timeout-minutes" => undefined,

              "initial-pool-size" => undefined,

              "jndi-name" => "java:/<jndi-name>",

              "jta" => true,

              "max-pool-size" => 40,

              "mcp" => "org.jboss.jca.core.connectionmanager.pool.mcp.SemaphoreConcurrentLinkedDequeManagedConnectionPool",

              "min-pool-size" => 10,

              "new-connection-sql" => undefined,

              "password" => "",

              "pool-prefill" => true,

              "pool-use-strict-min" => undefined,

              "prepared-statements-cache-size" => undefined,

              "query-timeout" => undefined,

              "reauth-plugin-class-name" => undefined,

              "reauth-plugin-properties" => undefined,

              "security-domain" => undefined,

              "set-tx-query-timeout" => false,

              "share-prepared-statements" => false,

              "spy" => false,

              "stale-connection-checker-class-name" => undefined,

              "stale-connection-checker-properties" => undefined,

              "statistics-enabled" => false,

              "track-statements" => "NOWARN",

              "tracking" => false,

              "transaction-isolation" => "TRANSACTION_REPEATABLE_READ",

              "url-delimiter" => undefined,

              "url-selector-strategy-class-name" => undefined,

              "use-ccm" => true,

              "use-fast-fail" => false,

              "use-java-context" => true,

              "use-try-lock" => undefined,

              "user-name" => "k3",

              "valid-connection-checker-class-name" => undefined,

              "valid-connection-checker-properties" => undefined,

              "validate-on-match" => undefined,

              "connection-properties" => undefined,

              "statistics" => {

                  "pool" => {

                      "ActiveCount" => 0,

                      "AvailableCount" => 0,

                      "AverageBlockingTime" => 0L,

                      "AverageCreationTime" => 0L,

                      "AverageGetTime" => 0L,

                      "AveragePoolTime" => 0L,

                      "AverageUsageTime" => 0L,

                      "BlockingFailureCount" => 0,

                      "CreatedCount" => 0,

                      "DestroyedCount" => 0,

                      "IdleCount" => 0,

                      "InUseCount" => 0,

                      "MaxCreationTime" => 0L,

                      "MaxGetTime" => 0L,

                      "MaxPoolTime" => 0L,

                      "MaxUsageTime" => 0L,

                      "MaxUsedCount" => 0,

                      "MaxWaitCount" => 0,

                      "MaxWaitTime" => 0L,

                      "TimedOut" => 0,

                      "TotalBlockingTime" => 0L,

                      "TotalCreationTime" => 0L,

                      "TotalGetTime" => 0L,

                      "TotalPoolTime" => 0L,

                      "TotalUsageTime" => 0L,

                      "WaitCount" => 0,

                      "XACommitAverageTime" => 0L,

                      "XACommitCount" => 0L,

                      "XACommitMaxTime" => 0L,

                      "XACommitTotalTime" => 0L,

                      "XAEndAverageTime" => 0L,

                      "XAEndCount" => 0L,

                      "XAEndMaxTime" => 0L,

                      "XAEndTotalTime" => 0L,

                      "XAForgetAverageTime" => 0L,

                      "XAForgetCount" => 0L,

                      "XAForgetMaxTime" => 0L,

                      "XAForgetTotalTime" => 0L,

                      "XAPrepareAverageTime" => 0L,

                      "XAPrepareCount" => 0L,

                      "XAPrepareMaxTime" => 0L,

                      "XAPrepareTotalTime" => 0L,

                      "XARecoverAverageTime" => 0L,

                      "XARecoverCount" => 0L,

                      "XARecoverMaxTime" => 0L,

                      "XARecoverTotalTime" => 0L,

                      "XARollbackAverageTime" => 0L,

                      "XARollbackCount" => 0L,

                      "XARollbackMaxTime" => 0L,

                      "XARollbackTotalTime" => 0L,

                      "XAStartAverageTime" => 0L,

                      "XAStartCount" => 0L,

                      "XAStartMaxTime" => 0L,

                      "XAStartTotalTime" => 0L,

                      "statistics-enabled" => false

                  },

                  "jdbc" => {

                      "PreparedStatementCacheAccessCount" => 0L,

                      "PreparedStatementCacheAddCount" => 0L,

                      "PreparedStatementCacheCurrentSize" => 0,

                      "PreparedStatementCacheDeleteCount" => 0L,

                      "PreparedStatementCacheHitCount" => 0L,

                      "PreparedStatementCacheMissCount" => 0L,

                      "statistics-enabled" => false

                  }

              }

          }

      }

        • 1. Re: Empty pool statistics after moving to Wildfly 10
          aalang

          Ironically a little bit after I posted this, I did stumble across this to turn on the statistics at run time:
          /subsystem=datasources/data-source=OperationalDS/statistics=pool:write-attribute(name=statistics-enabled,value=true)

           

          But I still can't figure out how to do this on service start.  I haven't seen anything in our Wildfly8 configuration that tips me off.

          • 2. Re: Empty pool statistics after moving to Wildfly 10
            ctomc

            Adam Lang wrote:

             

            Ironically a little bit after I posted this, I did stumble across this to turn on the statistics at run time:
            /subsystem=datasources/data-source=OperationalDS/statistics=pool:write-attribute(name=statistics-enabled,value=true)

             

            But I still can't figure out how to do this on service start.  I haven't seen anything in our Wildfly8 configuration that tips me off.

            you don't need to do that on service start, it is persisted configuration.

            you only need do do this once and server saves that configuration, so on next boot it will be enabled.

             

            This is change in default behavior since version 9 IIRC, as runtime statistics can in some scenarios be expensive and can hurt performance of the server. so they are now by default disabled.

            • 3. Re: Empty pool statistics after moving to Wildfly 10
              aalang

              Tomaz,

               

              Thanks for the reply.  I had done that setting change at run time and after restarting wildfly, it didn't retain the setting.

              • 4. Re: Empty pool statistics after moving to Wildfly 10
                emag

                Hi, Adam, Tomaz.

                 

                Apparently datasource schema has changed since WildFly 9, so statistics-enabled attributed is not persisted.

                 

                Maybe workaround is to override the datasource statistics-enabled attr manually in standalone*.xml.

                 

                <xa-datasource jndi-name="java:/jboss/datasources/fooXaDS" pool-name="fooXaDS" statistics-enabled="true">

                • 5. Re: Empty pool statistics after moving to Wildfly 10
                  aalang

                  Thanks, Yoshimasa.  That was the config change I was needing.

                  • 6. Re: Empty pool statistics after moving to Wildfly 10
                    emag

                    My pleasure, and if you don't want to edit standalone*.xml manually, you can also use the following CLI command. My understanding for datasource schema was wrong. sorry for confusing you.

                     

                    /subsystem=datasources/xa-data-source=fooXaDS:write-attribute(name=statistics-enabled,value=true)