cancel
Showing results for 
Search instead for 
Did you mean: 

Backghround process queuing - and delays

Former Member
0 Kudos

Hi,

I'm hoping someone could spare a little time to explain a couple of things to me please.

Each of our servers has a number of work processes, including, for example, 5 BKD sessions.

When a user submits a job to the background it sometimes sits there for ages in the queue with the delay (sec) amount steadily increasing - sometimes up to 4000 - 5000 seconds, even though there are completely free BKD sessions. The users often ask me what is happening to their job and I can't explain it.

As far as I know the submitted jobs are independent of any of the other runing jobs.

So I have 3 main questions please.

1. Can you see if a particular job is submitted to a particular work process - and if you can , can you change this to a free one?

2. Why do these delays happen? As far as I know there is no coding or planned scheduling like this.

3. Why do some jobs get immediately set to a BKD work processes whereas others just sit there with the time delay building up?

I've tried using SAP Help to understand and I can't find any detailed explanation of how this works.

Any help/explanation, much appreciated!!!

Many thanks

Mark Jeffery

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hi Mark

From SM37 it is not possible to see the work process to which the job is assigned. But if Job is active in background then you can see it in SM50.

Regarding the delays, many a times, job could not get the target server to be executed upon, in these cases job is released or gets into ready state, but could not activate.

Try assigning target execution server to these job explicitely while scheduling.

Also please check, SAP note number 165084.

Hope this helps.

Regards

Rahul

Edited by: Rahul Deo on Apr 28, 2008 7:20 PM

Answers (4)

Answers (4)

Former Member
0 Kudos

Thanks to everyone who posted an answer to my queries - I didn't detail the questions quite right which is why Ruchits answer was of most use to me, but thanks to all of you!!

Regards

Mark

Former Member
0 Kudos

Hello Mark,

Most of the questions have been very well answered already however here are a few inputs from my side:

1. Can you see if a particular job is submitted to a particular work process - and if you can , can you change this to a free one?

A job or a program will be assigned to a particular work process only when it gets started not when it is in delayed status. However there is a catch to it. Suppose you create a job will class B or C and it is going in delay and there are processes available for class A jobs then you can change the priority of the job and then when back ground job scheduler runs next time it will consider this job with the new job class and and if at that point of time there are free processes reserved for class A jobs then it will start the job immediately without any further delays.

2. Why do these delays happen? As far as I know there is no coding or planned scheduling like this.

The reasons for the delay have been explained already by Kunal. But there is plan to the scheduling. You see there is some thing called background job scheduler that runs every minute (depends on profile parameter rdisp/btctime) which scans all the jobs waiting in the queue and then triggers the job on various parameters like available background work processes, job class, planned job run time etc.

3. Why do some jobs get immediately set to a BKD work processes whereas others just sit there with the time delay building up?

As explained already scheduler works on certain paramerters.Basically delays will happen when the queue is very long.

To solve this you can either temporarily increase the number off BG work processes or reduce number of class A processes. it depends on situation at hand. From my personal experience I can say the best approach for avoiding these delays can be based on finding out what is causing the delays. Look at at entire queue of released and activve jobs in Sm37 and figure out what is causing the issue.

Additionally if you want to optimize back ground processing I would recommend implementing the suggestions of OSS note 923228. I had done it last year and it really helped us somewhat in achieving better performance. Actually delays can happen even if all the back ground processes are free since next lot of jobs won't get triggered unless batch scheduler does not run again. This OSS note will help you in averting such situations. very handy if you a long list of jobs which have a run time of few seconds.

With Regards.

Ruchit Khushu

Former Member
0 Kudos

Thanks a lot for your reply Ruchit. We had the same problem and you reply helped a lot.

Just one question...

1. Can you see if a particular job is submitted to a particular work process - and if you can , can you change this to a free one?

A job or a program will be assigned to a particular work process only when it gets started not when it is in delayed status. However there is a catch to it. Suppose you create a job will class B or C and it is going in delay and there are  processes available for class A jobs then you can change the priority of the job and then when back ground job scheduler runs next time it will consider this job with the new job class and and if at that point of time there are free processes reserved for class A jobs then it will start the job immediately  without any further delays.

How do we reserve a BGD work process for job class A, B or C?

Salai.

Former Member
0 Kudos

Hi Salai,

You can reserve Work Process for Class A jobs in RZ04.

Check this link

http://help.sap.com/saphelp_470/helpdata/en/c4/3a7f53505211d189550000e829fbbd/content.htm

Thanks,

Samik

Former Member
0 Kudos

Thanks Samik!

Former Member
0 Kudos

Marc,

Some inputs from my side. They might help or they may not.

1. Can you see if a particular job is submitted to a particular work process - and if you can , can you change this to a free one?

As mentioned earlier, you can do this via SM50. The background work process will show the name of the user running the program in the job in most cases and also the program that is occupying the work process under the column Report in SM50.

After a job is assigned to a wp, you cannot "change it to a free one". Logically speaking if there is a free wp, you shouldn't need to switch it, since the new job will take the free one on its own.(I'm guessing this is what you were thinking about)

2. Why do these delays happen? As far as I know there is no coding or planned scheduling like this.

This could be because of a few reasons.

1. No background wp available

2. If there is a delay inspite of background wp being available, the job could be waiting for some other job to start. Simply put, job B is dependent on A and is defined to run after A, job B will not run unless A finishes and show waiting. You can check this if you go to the job B and Start Condition and make sure that it is not dependent on another job.

3. If a job is defined to run after an event, then the same will happen. Same as above to find event

4. Waiting for an input from the program/user

3. Why do some jobs get immediately set to a BKD work processes whereas others just sit there with the time delay building up?

Same explanation as above

Former Member
0 Kudos

>

> 1. Can you see if a particular job is submitted to a particular work process - and if you can , can you change this to a free one?

> 2. Why do these delays happen? As far as I know there is no coding or planned scheduling like this.

> 3. Why do some jobs get immediately set to a BKD work processes whereas others just sit there with the time delay building up?

> Mark Jeffery

When the job starts running (ie, status Active), you can get details in SM37->job details. You can not change the job to another process once it starts running.

Delays happen when there a no available BGD work processes to run the job. Typically happens when jobs are targeted to specific server by users. If a job is accumulating "delay" time, check the job details in SM37, it should be going to a server where the BGD processes are busy or the BGD processes with required job class are not available.

-RK