Layer 7 Access Management

Expand all | Collapse all

Wildfly and JMS (NIO to AIO) Performance

  • 1.  Wildfly and JMS (NIO to AIO) Performance

    Posted 06-15-2018 02:53 PM

    Team,

     

    Thanks to Mark P. marpo01 for this note with regards to increasing performance for Wildfly JMS I/O.

        -  Key Phrases:   Journal / Hornetq

     

    Important side note:   These settings appears to have a supportive role with database connection pooling to the J2EE datasources to allow use of maximum possible connections.

     

    FYI  -  Out-of-the-box deployment of the JBOSS/Widfly component will have Hornetq Journal configuration set at NIO mode.

     

     

     

    This can be validated within the <JBOSS_HOME>/standalone/configuration/<ca-standalone-full-ha.xml> file or within startup server.log.

     

    grep NIO server.log

    server.log INFO [org.hornetq.core.server] (ServerService Thread Pool -- 60) HQ221013: Using NIO Journal
    server.log INFO [org.xnio] (MSC service thread 1-7) XNIO version 3.3.0.Final
    server.log INFO [org.xnio.nio] (MSC service thread 1-7) XNIO NIO Implementation Version 3.3.0.Final

     

     

     

     

     

     

    If your Linux OS file system allows for use of the library libaio; and your journal files are NOT on NFS, you may wish to explore this optional configuration.:   

                -View if already installed:   yum list libaio   

                - Install library:     yum install libaio

     

     

    You may wish to run the JBOSS/Wildfly GUI to update the standalone.xml or use vi/sed for the file.

     

    /opt/CA/wildfly-idm/bin/jboss-cli.sh --connect --user=jboss-admin --password=Password01!  --gui

        -  Requires X11 libraries to use

     

     

     

     

    Alternatively, you may wish to use the jboss-cli.sh process.

     

    Save the below lines to a new text file (jboss-aio.cli), and use jboss-cli.sh to import them (or copy-n-paste the lines one-by-one into the jboss-cli.sh shell).

       -  Example:

    /opt/CA/wildfly-idm/bin/jboss-cli.sh --connect --user=jboss-admin --password=Password01! --file=/tmp/jboss-aio.cli

     

     

    NOTE:  Be sure to update both the LIVE and the BACKUP of the Hornetq Journal system.

       -  If you ONLY have one node, you will likely ONLY have a LIVE section and no BACKUP.

     

    Edit: 2018-07-20  [added thread-pool-max-size]

     

    /subsystem=messaging/hornetq-server=default/:write-attribute(name=journal-type,value=ASYNCIO)
    /subsystem=messaging/hornetq-server=default/:write-attribute(name=journal-sync-transactional,value=false)
    /subsystem=messaging/hornetq-server=default/:write-attribute(name=journal-sync-non-transactional,value=false)
    /subsystem=messaging/hornetq-server=default/:write-attribute(name=journal-file-size,value=10485760)
    /subsystem=messaging/hornetq-server=default/:write-attribute(name=journal-min-files,value=20)
    /subsystem=messaging/hornetq-server=default/:write-attribute(name=journal-compact-min-files,value=20)
    /subsystem=messaging/hornetq-server=default/:write-attribute(name=journal-max-io,value=5000)

    /subsystem=messaging/hornetq-server=default/:write-attribute(name=thread-pool-max-size,value=300)

     

    /subsystem=messaging/hornetq-server=backup/:write-attribute(name=journal-type,value=ASYNCIO)
    /subsystem=messaging/hornetq-server=backup/:write-attribute(name=journal-sync-transactional,value=false)
    /subsystem=messaging/hornetq-server=backup/:write-attribute(name=journal-sync-non-transactional,value=false)
    /subsystem=messaging/hornetq-server=backup/:write-attribute(name=journal-file-size,value=10485760)
    /subsystem=messaging/hornetq-server=backup/:write-attribute(name=journal-min-files,value=20)
    /subsystem=messaging/hornetq-server=backup/:write-attribute(name=journal-compact-min-files,value=20)
    /subsystem=messaging/hornetq-server=backup/:write-attribute(name=journal-max-io,value=5000)

    /subsystem=messaging/hornetq-server=backup/:write-attribute(name=thread-pool-max-size,value=300)

     

     

    If you use the jboss-cli.sh in GUI mode, you can see documentation on the value of each item as you "hover-over-the-item"

     

     

     

    /opt/CA/wildfly-idm/bin/jboss-cli.sh --connect --user=jboss-admin --password=Password01!  --command=:take-snapshot 

    /opt/CA/wildfly-idm/bin/jboss-cli.sh --connect --user=jboss-admin --password=Password01! --file=jboss-aio.cli

    /opt/CA/wildfly-idm/bin/jboss-cli.sh --connect --user=jboss-admin --password=Password01! --command=":reload"

     

     

     

    Same script, but with a few extra keywords

     

     

     

     

    After AIO is configured, you should see this listed in the server.log file

     

     

    grep AIO server.log

    INFO  [org.hornetq.core.server] (ServerService Thread Pool -- 60) HQ221012: Using AIO Journal

     

     

     

    ####   To "read" the new values:   ####

     

    /subsystem=messaging/hornetq-server=default/:read-attribute(name=journal-type)
    /subsystem=messaging/hornetq-server=default/:read-attribute(name=journal-sync-transactional)
    /subsystem=messaging/hornetq-server=default/:read-attribute(name=journal-sync-non-transactional)
    /subsystem=messaging/hornetq-server=default/:read-attribute(name=journal-file-size)
    /subsystem=messaging/hornetq-server=default/:read-attribute(name=journal-min-files)
    /subsystem=messaging/hornetq-server=default/:read-attribute(name=journal-compact-min-files)
    /subsystem=messaging/hornetq-server=default/:read-attribute(name=journal-max-io)

    /subsystem=messaging/hornetq-server=default/:read-attribute(name=thread-pool-max-size)

     

    /subsystem=messaging/hornetq-server=backup/:read-attribute(name=journal-type)
    /subsystem=messaging/hornetq-server=backup/:read-attribute(name=journal-sync-transactional)
    /subsystem=messaging/hornetq-server=backup/:read-attribute(name=journal-sync-non-transactional)
    /subsystem=messaging/hornetq-server=backup/:read-attribute(name=journal-file-size)
    /subsystem=messaging/hornetq-server=backup/:read-attribute(name=journal-min-files)
    /subsystem=messaging/hornetq-server=backup/:read-attribute(name=journal-compact-min-files)
    /subsystem=messaging/hornetq-server=backup/:read-attribute(name=journal-max-io)

    /subsystem=messaging/hornetq-server=backup/:read-attribute(name=thread-pool-max-size)

     

     

     

     

    Cheers,

     

    A.



  • 2.  Re: Wildfly and JMS (NIO to AIO) Performance

    Posted 07-20-2018 05:15 PM

    Process above appears to have positive influence on the use of the maximum pool size for a data source.

     

    Validation exercise:   Increase the maximum pool size to 400 for ALL datasources, restart J2EE; then exercise peak use-cases.     Monitor the active pool size used.   Use this number as the new maximum pool size for performance.   Ensure that this number, along with the other datasources, does NOT overwhelm the connection pool size limitation from the database server.

     

     

     

    Example to update the datasource max connection pool size.

     

     

    /subsystem=datasources/data-source=iam_im-imobjectstoredb-ds/:write-attribute(name=max-pool-size,value=500)

    /subsystem=datasources/data-source=iam_im-imtaskpersistencedb-ds/:write-attribute(name=max-pool-size,value=500)

    /subsystem=datasources/data-source=iam_im-imworkflowdb-ds/:write-attribute(name=max-pool-size,value=500)

     

    /subsystem=datasources/data-source=iam_im-imarchivedb-ds/:write-attribute(name=max-pool-size,value=50)

    /subsystem=datasources/data-source=iam_im-imauditdb-ds/:write-attribute(name=max-pool-size,value=50)

    /subsystem=datasources/data-source=iam_im-imreportsnapshotdb-ds/:write-attribute(name=max-pool-size,value=50)

     

     

     

     

    Other examples:

     

    Update J2EE Data Source entries:

    Update Identity Manager JBOSS/Wildfly Database Ids/Passwords via Jboss-cli.sh 

     

    Other jboss-cli scripts

    Useful Wildfly/JBOSS CLI Monitoring Scripts