3

We have an apex job that gets stuck in "Queued" status for a long time before going into "Processing".

This happens only in Sandbox environment (which was recently refreshed from Prod btw) and not in Prod.

Also as you can see there are no jobs which are queued and this particular job always used to get executed immediately even though it is Batch Apex i.e there is no need for this job to get stuck in "Queued" status for this long.

Can someone one throw me some ideas as to what could be wrong ?enter image description here

6
  • How did you call this batch apex. Did you use database.executeBatch() or did you schedule it? – Chris Duncombe Oct 7 '14 at 11:25
  • That is done via database.executeBatch() – Varun Oct 7 '14 at 11:28
  • Ok, and how long is a 'long time'? 10 minutes, 10 hours, 10 days? – Chris Duncombe Oct 7 '14 at 11:29
  • 3
    There are a lot of factors there. As it is a multi-tenant platform, it could be the time of day you are trying this, or the number of jobs your org is regularly running. If you said it was hours, I might think there was an issue, but 20 minutes, although not ideal, is not outrageous as it is an asynchronous process. – Chris Duncombe Oct 7 '14 at 11:37
  • 2
    You should also keep in mind, that sandbox instances seem to bee more overbooked than production instances, which does lead to slower execution times. – Alexander Johannes Oct 7 '14 at 12:18
1

As you stated at the start this is only a issue in your Sandbox org. This is due to the sandbox org have a less powerful server to run against. According to this article (posted 2013) states production orgs run an 8 node clustered database tier, were as a sandbox is only a 4 node. This my have been increased by now. However if working in your sandbox you will have to be prepared for the speeds of the sandbox server.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.