MQ

MQ

Join this online group to communicate across IBM product users and experts by sharing advice and best practices with peers and staying up to date regarding product enhancements.

 View Only
  • 1.  MSGDLVSQ - FIFO vs. PRIORITY for deep queues on z/OS

    Posted Wed March 12, 2025 10:20 AM

    Greetings –

      I'm curious to hear from others (and most importantly IBM) whether we should expect to see any appreciable difference in message access time for very deep queues for both types of MSGDLVSQ.  I'm mostly interested w/ whether we will see any difference between the following on z/OS:

    • MSGDLVSQ(PRIORITY) w/ all messages at the same Priority
    • MSGDLVSQ(FIFO)

      I do know about the 20 sub-queues (0-9 / P-NP) and that messages are stored in a linked list for easier access.  I'm wondering about the code path / unnecessary processing that could be occurring using PRIORITY vs. any savings that could be obtained moving to FIFO.

    Any input is greatly appreciated!

    Cheers,

      Art



    ------------------------------
    Arthur Schanz
    ------------------------------


  • 2.  RE: MSGDLVSQ - FIFO vs. PRIORITY for deep queues on z/OS

    Posted Thu March 13, 2025 03:39 AM

    Hi Art,

    I don't have hard numbers to hand, but I would not expect there to be a significant performance difference between the two MSGDLVSQ options in most cases.

    The only real difference between the two is at the time the message is put. 
    For PRIORITY, the message is stored on one of the 20 sub-queues based on the message priority and persistence.
    For FIFO, the message priority is ignored and the messages are treated as having the queue's default priority. This means they are all placed on the default priority's two sub-queues based only on the persistence.

    At the time the messages are got, the logic is entirely the same. MQ looks for the first suitable message starting with the highest priority sub-queue pair and working downwards (with some optimisations to minimise unnecessary scanning). It makes very little difference whether there are messages on all 20 sub-queues or only 1.

    For completeness, the reason for the "in most cases" above is that it is possible to construct scenarios where one setting would perform better than the other.
    e.g.
    - Put 1000 messages with a property "city=London" and a priority of 8.
    - Put 1000 messages with a property "city=Paris" and a priority of 9.
    - Run getting applications which use a selector to get just the London messages.

    On a FIFO queue would have the London messages at the front of the queue as they were put first, but on a PRIORITY queue the would be logically behind the Paris messages, as they have a lower priority.
    The getting applications would perform worse with the PRIORITY setting because more work would be required to reach a matching message.



    ------------------------------
    Doug Burns
    ------------------------------