LongEx Mainframe Quarterly - August 2017
A lot of my consulting work involves reducing CPU usage to save my clients money. As part of this work, I need to estimate how much money any recommendations I make will save. I also need to measure how much money I actually saved once the recommendation has been implemented. Almost everyone pays by MSU, four-hour rolling average MSU (4HRA MSU), or MIPS. So, I need to convert CPU seconds saved into MIPS/MSU for whatever I'm targeting: a batch job, CICS region, Websphere MQ channel initiator etc. Here's how I do it.
To get the CPU usage of whatever I'm targeting, I will use SMF records: usually SMF Type 30 interval records for address spaces, but sometimes SMF Type 110 for CICS transactions, 101s for DB2 Stored Procedures, and IMS Logs for IMS transactions. All of these tell me the CPU consumed in terms of CPU seconds. The type 30s tell me the CPU seconds consumed by a job step in one period, the 110s the CPU seconds consumed by a single transaction etc.
So, I need to convert CPU seconds to MSUs, 4HRA MSUs, or MIPS (depending on how the client is paying). Let's take MSUs to start.
My first step is to go to the IBM Large Systems Programming Reference (LSPR). I find the client's mainframe processor model, and look it up here. Let's say our client has a 2964-725: a z13 with 25 full powered processors. The LSPR for this model looks like:
Let's look at each column:
Converting CPU Seconds to MSUs
We're particularly interested in the MSU and CP columns. So, here's what I do. I calculate an 'MSU factor' as follows:
MSUfactor = MSU / CP / 3600
So, for our 2964-725, the MSU factor is 3313 / 25 / 3600 = 0.0368.
Suppose I have a Connect:Direct region consuming 200 CPU seconds in one hour. This consumes an average of 200 * 0.0368 = 7.36 MSUs over that one hour.
Let's look a bit closer at what I'm doing.
The total MSUs for the box is 3313. This is 3313 / 25 = 125.3 MSUs per CP. Now, MSUs are a rate, whereby CPU seconds is a quantity. So, to convert a quantity to a rate, we need to divide it by a unit of time. I'm only interested in MSUs in one hour, so the CPU seconds need to be divided by the number of seconds in an hour: 3600. Or in other words, the MSU factor needs to be divided by 3600.
Let's double check this. If something consumed 3600*25 = 90,000 CPU seconds in an hour, they would be using the entire capacity of all 25 CPs on the machine. 90,000*0.0368 = 3313 MSUs - the MSU capacity of our machine.
I often use 'peak' MSUs when a client pays for the capacity of a machine, or the peak MSUs used. So, in this case, if my client's peak usage is only for one hour, and my recommendation saves 100 CPU seconds in that hour, I've saved 100*0.03681 = 3.68 MSUs.
Converting CPU Seconds to MIPS
Many of my clients don't pay for MSUs, they pay for MIPS. Our article from 2011 explains more about MIPS and MSUs. The way to convert to MIPS is the same, but uses the PCI value from LSPR.
So, my MIPS factor is:
MIPSfactor = PCI / CP / 3600
For our 2964-725, the MIPS factor will be 28130 / 25 / 3600 = 0.3126.
My Connect:Direct region using 200 CPU seconds in one hour consumes an average of 200*0. 3126 = 62.5 MIPS during that one hour.
If you compare our MSU and MIPS factor, you can see that 1 MSU = 8.5 MIPS. On most processors, 1 MSU is between 8 and 9 MIPS. This is handy when I need to roughly convert between MIPS and MSUs.
Again, I usually use MIPS for clients paying for peak CPU consumption, or for the available CPU. This is often outsourced clients.
Converting CPU Seconds to 4HRA MSUs
Most of my clients don't pay by MSUs or MIPS - they pay by 4HRA MSUs. But the method is similar. I create a 4HRA MSU Factor:
4HRA_MSUFactor = MSU / CP / 3600 / 4
This is the same as my MSU factor, but divided by an extra four, as we're looking at an average over four hours.
So, in our example, my 4HRA MSU Factor = 3313 / 25 / 3600 / 4 = 0.0092.
I now sum all the CPU seconds used by my target subsystem in the peak four hours (4HRA MSUs are an average over four hours). This peak can be obtained from the IBM SCRT reports, or calculated from SMF Type 70 records. I multiply the CPU seconds in this four hour period by this 4HRA MSU factor.
So, if my Connect: Direct consumption over the peak four hours was:
4HRA MSUs = (200+300+90+10)* 0.0092 = 5.52 MSUs.
Once you get the hang of it, converting CPU seconds to MSUs, MIPS or 4HRA MSU is straightforward. However, be careful. Get the number of CPU seconds consumed in the right period. This may be one hour, four or more. And remember that the MIPS, MSUs of 4HRA MSUs are the average for that period.