Improved performance - basic configuration
How you set up a basic scenario for improved performance using shared queues on IBM MQ .
This scenario describes the use of SCM to increase the number of messages that can be stored on a shared queue without incurring the performance cost of using SMDS.
This initial scenario is very similar to that used for emergency storage and uses a:- Queue sharing group, IBM1, that contains a single queue manager, CSQ3. In addition to the administration structure, the queue sharing group defined a single application structure, SCEN2.
- Coupling facility (CF) CF01, in which the SCEN2 application structure is stored as the IBM1SCEN2 structure. This structure has a maximum size of 2 GB.
- Single shared queue, SCEN2.Q, which is configured to use the application structure.
Furthermore, assume that queue manager CSQ3 is already the only member of queue sharing group IBM1.
You must add the definition for structure IBM1SCEN2 to the coupling facility resource manager (CFRM) policy. For simplicity, the structure is defined so that it can be created in only a single coupling facility, CF01, by specifying PREFLIST(CF01).
Sample CFRM policy for structure IBM1SCEN2:STRUCTURE NAME(IBM1SCEN2) SIZE(2048M) INITSIZE(2048M) ALLOWAUTOALT(YES) FULLTHRESHOLD(85) PREFLIST(CF01) ALLOWREALLOCATE(YES) DUPLEX(DISABLED) ENFORCEORDER(NO)
Both the INITSIZE and SIZE keywords have the value 2048M so that the structure cannot resize.
Procedure
-
Refresh the CFRM policy by using the following command:
SETXCF START,POLICY,TYPE=CFRM,POLNAME=IBM1SCEN2
-
Verify that the structure has been created correctly, by using the following command:
D XCF,STR,STRNAME=IBM1SCEN2
Issuing the preceding command gives the following output:RESPONSE=SC61 IXC360I 07.58.51 DISPLAY XCF 581 STRNAME: IBM1SCEN2 STATUS: NOT ALLOCATED POLICY INFORMATION: POLICY SIZE : 2048 M POLICY INITSIZE: 2048 M POLICY MINSIZE : 1536 M FULLTHRESHOLD : 85 ALLOWAUTOALT : YES REBUILD PERCENT: N/A DUPLEX : DISABLED ALLOWREALLOCATE: YES PREFERENCE LIST: CF01 ENFORCEORDER : NO EXCLUSION LIST IS EMPTY EVENT MANAGEMENT: MESSAGE-BASED MANAGER SYSTEM NAME: SC53 MANAGEMENT LEVEL : 01050107
At this point, your structure has not been allocated, shown by the STATUS line, to the queue sharing group.
-
Configure IBM MQ to make use of the structure
defined in the CFRM policy.
- Use the DEFINE CFSTRUCT
command, with the structure name of SCEN2 to create a IBM MQ CFSTRUCT object.
DEFINE CFSTRUCT(SCEN2) CFCONLOS(TOLERATE) CFLEVEL(5) DESCR('Structure for SCM scenario 2') RECOVER(NO) RECAUTO(YES) OFFLOAD(DB2) OFFLD1SZ(64K) OFFLD1TH(70) OFFLD2SZ(64K) OFFLD2TH(80) OFFLD3SZ(64K) OFFLD3TH(90)
- Check the structure, using the DISPLAY CFSTRUCT command.
- Define the SCEN2.Q shared queue, to use the SCEN2 structure,
using the following MQSC command:
DEFINE QLOCAL(SCEN2.Q) QSGDISP(SHARED) CFSTRUCT(SCEN2) MAXDEPTH(999999999)
- Use the DEFINE CFSTRUCT
command, with the structure name of SCEN2 to create a IBM MQ CFSTRUCT object.
- Use IBM MQ Explorer to put a single message to the queue SCEN2.Q and take the message off again.
-
Issue the following command to check that the structure is now allocated:
D XCF,STR,STRNAME=IBM1SCEN2
Review the output from the command, a portion of which is shown, and ensure that the STATUS line shows ALLOCATED.RESPONSE=SC61 IXC360I 08.31.27 DISPLAY XCF 703 STRNAME: IBM1SCEN2 STATUS: ALLOCATED EVENT MANAGEMENT: MESSAGE-BASED TYPE: SERIALIZED LIST POLICY INFORMATION: POLICY SIZE : 2048 M POLICY INITSIZE: 2048 M POLICY MINSIZE : 1536 M FULLTHRESHOLD : 85 ALLOWAUTOALT : YES REBUILD PERCENT: N/A DUPLEX : DISABLED ALLOWREALLOCATE: YES PREFERENCE LIST: CF01 ENFORCEORDER : NO EXCLUSION LIST IS EMPTY
Additionally, note the values of the fields in the SPACE USAGE section:- ENTRIES
- ELEMENTS
- EMCS
- LOCKS
SPACE USAGE IN-USE TOTAL % ENTRIES: 344686 345242 99 ELEMENTS: 6548455 6548467 99 EMCS: 2 780318 0 LOCKS: 1024
Results
You have created the basic configuration. We can now obtain an idea of the baseline performance of your configuration using whatever method you select.
What to do next
You should test the basic scenario. As an example, we can use the following three applications, starting the applications in the order shown and, running them concurrently.- Use a PCF application to request the current depth ( CURDEPTH ) value for SCEN2.Q every five seconds. The output can be used to plot the depth of the queue over time.
- A single threaded getting application repeatedly gets messages from SCEN2.Q, using a get with an infinite wait. To simulate processing of the messages that were removed, the getting application pauses for four milliseconds for every ten messages that it removed.
- A single threaded putting application puts a total of one million 4 KB non-persistent messages
to SCEN2.Q. This application does not pause between putting each message so
messages are put on SCEN2.Q faster than the getting application can get them.
As a result, when the putting application is running, the depth of SCEN2.Q increases.
When structure IBM1SCEN2 is filled, and the putting application receives a MQRC_STORAGE_MEDIUM_FULL reason code, the putting application sleeps for five seconds before attempting to put the next message to the queue.