function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
Peter AubreyPeter Aubrey 

Monitoring, managing & debugging long running Apex requests

Hello everyone,

Looking for some advice. We are encountering the dreaded ConcurrentPerOrgApex limit which I realise can be tricky to deal with. We've researched a number of articles including:
  • https://developer.salesforce.com/blogs/engineering/2013/05/force-com-concurrent-request-limits.html
  • http://www.slideshare.net/developerforce/concurrency-designpatterns-mt
  • http://www.eltoro.it/ArticleViewer?id=a07A000000NPRi8IAH
Salesforce support aren't being the most helpful and wanted to confirm a couple of things:
  1. Documentation states that its Apex, SOQL, etc. that counts towards this limit. We've used Developer Console to look at timelines and looking only at the Apex and DB requests, they are always coming back in a few miliseconds, no where near five seconds. All actvitities may take longer than 5 seconds. So should we be reading the timeline from the start to the end for all parts, or just the Apex and DB rows?
  2. We have Email-to-Case enabled and one Email-to-Apex handler. We've been told that everytime E2C processes an email, the E2A handler is also fired, even though emails are NOT sent to this address. Is this correct? Anyone else found this?
Any other hints and tips on how to track these down without spending 10% of our license fee to get the monitoring option would be greatly appreciated.
Andy BoettcherAndy Boettcher
That's a tough one - normally we'd need to see the larger picture of all what code is running (where and how) in order to really give you some context, but do you have any future or batch jobs that are firing off here that you could make synchronous?
Peter AubreyPeter Aubrey
Hi Andym

Thanks for replying but I think the solution is to make things asynchronous rather than synchronous unless I'm mis-understanding something?

We do have a lot of code and quite a few embedded VF pages however when we've monitored all of these they are never getting close to taking 5 seconds to execute.
Victor Cazacu 4Victor Cazacu 4
Peter, did you find a solution for this? I am running into the same issue when none of my queries take longer than 2 secs but still getting the message. I even setup a remote request timeout limit = 4sec which also did not help... Any other ideas?