Analyzing SAP background job data using SAP Lumira
Performance can be impacted by background jobs so for an administrator it is interesting to get an overview of which jobs are running on a given managed SAP system.
A tool that is not so well known in SAP is the BACKGROUND_JOB_ANALYSIS tool. It is available through transaction ST13 and the tool itself can also deliver interesting results in terms of analyzing your background jobs.
The main interesting feature of the tool is the gant chart that it produces when you look for jobs that run for over five minutes If we look at a 24 hour time slice, we can see how the long running jobs are distributed for example.
Floating over one of those blocks with the mouse cursor reveals the background job name and a table on the same result page also displays statistical data on these jobs. The > blocks represent jobs that run longer than five minutes. The * at the bottom next to SJ are short running jobs that run on the same moment in time.
We can derive from above chart that from 00:00:01 to around 05:00:00 the system has some long(er) running background jobs. The above graph isn’t really shocking but I can image you can find SAP systems where the graph looks a little more packed. It could be interesting to look at how those long running jobs can be distributed better over time. Around 04:03 for example you can see a couple of long running jobs run in parallel. They could potentially bottleneck eachother so it could be interesting to schedule one of them at another point in time.
In the job options (two screenshots back) you can select All (only listview). This will give you an overview as you can see in above screenshot. This data can then be exported into Excel. What I did was take the data of five working days 05.08.2013 – 09.08.2013 and combine the data into one Excel sheet.
Then I fired up SAP Lumira, I clicked the shiny “new document” button and browser for my Excel sheet. In above screenshot you can see an extract of the data after it was aquired by SAP Lumira. Note that I did adjust the Excel sheet to some extent, I threw out a number of column which I was not planning to use and I added a column “StartHour” which derived the hour in a “hh” format from the StartTime column because I wanted to see the spread of the # jobs on a 24 hour axis.
How to create a bar char of the top 5 most running jobs
After pulling the data into SAP Lumira, I navigated to the Visualize view and I ended up with 10 Attributes that I can use as you can see in above screenshot.
So now, I want to create a bar chart of the five jobs that run the most often. In order to do that I first have to count the number of occurences of each job in my dataset.
Most tools feature a right click menu so that’s exactly what I did, right click the JobName attribute. Looking at the available options (not all options are shown on the screenshot) the option that makes the most sense to me is “Create a measure” so I clicked that option.
Once I did that, I noticed a new measure under the header “Measures”.
The button next to the newly created measured triggered my attention so I went to check out what options are underneath. By default it was set to Count(Distinct) and my gut feeling said I should switch this to Count(All). I was going to verify the data anyhow against the Excel sheet for the first time to be sure I was picking the right option.
So now, in the right pane, I choose the “bar chart” type of graph and it was now time to define the X Axis and the Y Axis.
On the X Axis, I want to see the jobs and on the Y Axis I want to see how often they run. I dragged the measure that I had just created onto the Y Axis 1 field and the JobName onto the X Axis field and voila, I had a graph. Now you can see that my graph is rather “busy”. I have way too many small background jobs in which I’m not really interested so I have to narrow down the result. I would like to take a look at the top 5.
Again, by just looking around I saw a small downwards pointing arrow in the measure that I dragged onto the Y Axis 1 field so I clicked it to see what options are available. Rank Values sounded like the thing I was looking for so I clicked it to check it out.
By default Top was filled in along with the value 3. I simply changed 3 into 5 and clicked OK.
Et voila, here is my graph of the five most running jobs (looking at a period of five working days).
Using the same techniques as above, I created a few other graphs as you can find below:
Here you have an example of a combination of different measures (duration & frequency). So here I have a map graph which shows me how often a job runs (the size of the map piece) and how long the job runs (darker colour = the job runs longer).
This combination is interesting because the jobs that have a large map piece and are dark coloured are the jobs that you would definitely want to look into from a performance perspective, they are potential candidates for optimization.
There can be lots of interesting graphs that you can build using this data. For example the above map graph adds in the user-id that scheduled the job in SAP. Note that I did change the real user-id to ENDUSER1 😉 for AI_SDK_SP_AUTO_IN_PROCESS.
This can help you identify who scheduled in a long running or often running (or both) job. It can also show you duplicates. You can see that SMBI_INVALIDATE_OLAP_CACHE now has three blocks so it runs under three user-id’s. This is then interesting to look at to see if this is normal or if this job is running multiple times, doing the same thing, while it is not necessary.
I can come up with more examples but I’m sure you would like to try out SAP Lumira yourself. The above examples are easy to reproduce so go and have a look at your background jobs 🙂 .