I was looking into a performance problem and tried to follow the documentation to put things into the LLA - but it didnt work as expected. This bog entry tells the journey - go do the bottom to learn magic fix.
With MQ using MQCRTMH and MQDLTMH, they each do a link to the module CSQBCRMH. This is fine if you use just one of these per batch job - but it you loop doing MQCRTMH, MQDLTMH you get a lot of link activity.
If the LINK is loading the member from disk every time - this takes CPU and has disk I/O. (CICS preloads this module so doesnt have the problems)
The MQ performance document MP16 says
The member CSVLLAxx in SYS1.PARMLIB species the LLA setup. The inclusion of a library name in the LIBRARIES statement means that a program copy will always be taken from VLF(Virtual Lookaside Facility) and hence will not usually require I/O when heavily used. Inclusion in the FREEZE statement means that there is no I/O to get the relevant DD statement concatenation directories (this can often be more I/O than the program load itself). Use the operating system F LLA,REFRESH command after any changes to any of these libraries.
I thought great - I'll try it, but it made about 5% difference in CPU. I hunted around and found a really old (2005) document from Martin Packer which said
You enabled module caching by specifying in your COFVLFxx member a new class (CSVLLA) with an EMAJ of LLA and a MAXVIRT (which defaulted to 4096 pages or 16MB). 16MB was large in 1988. Now it's puny.
I checked out our COFVLF00 and MAXVIRT was not specified - so we were using the default of 4096 pages. I added MAXVIRT(32768) and as if by magic I got the performance improvement I expected.
Member COFVLF00 included
I stopped and restart VLF
I created a member SYS1.PARMLIB(CSVLLAMQ) with
and activated it using F LLA,UPDATE=MQ
My program looped doing MQCRTMH, MQSETMP, MQPUT, MQCMT, MQGET, MQINQMP, MQDLTMH.
With the COFVLF properly set up, the cost per loop was 900 microseconds per loop. When it did not use the library in CSVLLAMQ then the cost per loop was 1200 microseconds. Putting the MQ SCSQAUTH library into the LLA and setting MAXVIRT(32768) in COFVLF gave me a 25% reduction in CPU. The elapsed time went from 3940 microseconds to 921 microseconds per loop which shows the elimination of the I/O,
However when I put the following code into my C program it reduced the CPU time to 150 microseconds, and the elapsed time to 190 microsecond.
int (*perfLoad) ( );
perfLoad= (int (*) ( ) ) fetch ("CSQBCRMH"); /* preload for a performance */
Although the loading of modules into the LLA and VLF gave some benefit, the most efficient solution was to load the module into the address space.