MQ

 View Only
  • 1.  Understanding MQ log file size.

    IBM Champion
    Posted Fri May 20, 2022 04:55 PM
    During a load test exercise one of our consumer clients reported the following error:
    MQError: CMIT: MQCC = MQCC_FAILED [2] MQRC = MQRC_BACKED_OUT [2003] 
    In our case the error came from issuing a CMIT command to close out a transaction begun with GET.  I have several questions as I work through understanding this, and what actions we should take.

    • The docs give a likely cause as exhausting the log space.  This fits with our scenario and the type of testing we were doing, but are there other common causes for a CMIT failure like this I should investigate?
    • In this scenario is the transaction automatically closed, or should the client execute BACK explicitly?  If the client took no action (other than logging the message) what would the result of the next GET be?  
    • Prior to this error the client was holding transactions open for about 30 seconds, or more.  This is longer than usual and probably contributed to the problem.  Is there a way on the server side of things to limit how long a transaction can be outstanding?  Note, this is a transaction being coordinated by the qmgr and not some other program.
    • I'm pretty sure the log file size needs to be increased.  Per these instructions.  I was reading about how to use the DISPLAY QMSTATUS LOG command to help in the calculations.  Do the LOGINUSE and LOGUTIL attributes represent a snapshot in time, a particular time period, or the high-water mark of this usage?  Do the values reset at some point?
    • Our current log file settings are the defaults:
      Log:
         LogPrimaryFiles=3
         LogSecondaryFiles=2
         LogFilePages=4096
         LogType=CIRCULAR
         LogBufferPages=0
         LogWriteIntegrity=TripleWrite​
      How do I tell for sure if the capacity was reached or exceeded?  The same docs mention the amqsrua command, but unfortunately it's part of the sample files and isn't installed on our image.

    Thanks,
    Jim




    ------------------------------
    Jim Creasman
    ------------------------------


  • 2.  RE: Understanding MQ log file size.

    Posted Mon May 23, 2022 10:27 AM
    The default log size is tiny 48MB and isn't really intended for a production deployment involving persistent messages. It's a bit historical and MQ tries not to change defaults in order not to spring any surprises on someone expecting the "old" behaviour.
    While you can simply increase the number of extents it's a bit more difficult to increase the extent size (a bigger extent size would be preferable).
    The transaction has already been backed out, and any messages locked to the transaction (by a destructive MQGET) released, but the transaction has not been "closed" and an MQBACK needs to be issued on the hConn that started this transaction before it can start a new transaction.
    LOGINUSE is a point in time thing, and LOGUTIL represent a more general estimate of log space usage (as per the documentation).

    ------------------------------
    Andrew Hickson
    ------------------------------



  • 3.  RE: Understanding MQ log file size.

    Posted Mon May 23, 2022 10:27 AM
    The default MQ log size is tiny and not really intended for a production deployment involving persistent messaging. The size (48MB) is historical and like other MQ defaults hasn't evolved over time in order that any recreated queue manager would be as similar as possible to a previous instance.
    The messages involved in the transaction have already been rolled back by the time this return code is received, but the transaction hasn't been cleaned up and the hConn associated with the transaction needs to call MQBACK before it can start a new transaction.
    LOGINUSE is a point in time measuement, while LOGINUSE is an estimate of the broader log usage (as per the documentation).

    ------------------------------
    Andrew Hickson
    ------------------------------



  • 4.  RE: Understanding MQ log file size.

    IBM Champion
    Posted Mon May 23, 2022 05:42 PM
    I spent some time today trying to recreate this problem locally, but was not successful.  I ran MQ in a local Docker container with 
       LogPrimaryFiles=1
       LogSecondaryFiles=0
       LogFilePages=128

    I then ran a producer and two consumer clients that were using transactions, making sure these took several seconds to commit each message.  Everything worked as expected.  Is there a test and/or settings I can use to exhaust the log file space?  I'd like to recreate this issue in a controlled environment to make sure our clients respond correctly.

    Jim



    ------------------------------
    Jim Creasman
    ------------------------------



  • 5.  RE: Understanding MQ log file size.

    IBM Champion
    Posted Mon May 23, 2022 08:13 PM

    Things to check:

    • How big are your messages? The bigger the messages the more log file space an MQPUT will take up.
    • Are your messages persistent?
    Cheers,
    Morag

    ------------------------------
    Morag Hughson
    MQ Technical Education Specialist
    MQGem Software Limited
    Website: https://www.mqgem.com
    ------------------------------



  • 6.  RE: Understanding MQ log file size.

    Posted Mon May 23, 2022 10:10 PM
    You may need the MQ UOW to last more than several seconds, to allow other apps using the log to try rolling past the UOW start point.  Try several minutes, and then pump the other apps harder.

    ------------------------------
    Glenn Baddeley
    Senior Middleware Software Engineer
    Coles Supermarkets Australia Pty Ltd
    ------------------------------